Commit 4ce45d62 authored by Clemens John's avatar Clemens John

Fix namespaces

Signed-off-by: default avatarClemens John <clemens.john@openitb.com>
parent 700b532d
<?php
namespace ApiServer\Core\Http\Controllers;
namespace ApiServer\CoreJsonApi\Http\Controllers;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
......@@ -24,8 +24,8 @@ use Illuminate\Routing\Controller;
use Illuminate\Http\Request;
use ApiServer\Core\Models\User;
use ApiServer\Core\Models\Role;
use ApiServer\Core\Models\Config;
use ApiServer\Authentication\Mail\ResetPassword;
use ApiServer\Core\Models\Option;
use ApiServer\CoreJsonApi\Mail\ResetPassword;
/**
* User resource representation.
......@@ -47,7 +47,7 @@ class AccessController extends Controller
if(count($userlist) == 1) {
$user->attach(
Role::findOrFail(
Config::where(
Option::where(
'key', 'serverAdminRoleId'
)->firstOrFail()->value
)
......@@ -56,7 +56,7 @@ class AccessController extends Controller
// assign user role
$user->attach(
Role::findOrFail(
Config::where(
Option::where(
'key', 'serverUserRoleId'
)->firstOrFail()->value
)
......@@ -93,7 +93,7 @@ class AccessController extends Controller
}
//generate new jwt that expires in 30 min
$resetTokenTTL = Config::where(
$resetTokenTTL = Option::where(
'key', 'serverPasswordResetTokenTTL'
)->firstOrFail()->value;
......@@ -101,7 +101,7 @@ class AccessController extends Controller
$authToken = \JWTAuth::customClaims($customClaims)->fromUser($user);
//get url to a clients password reset webinterface
$passwordRestUrl = Config::where(
$passwordRestUrl = Option::where(
'key', 'serverPasswordResetURL'
)->firstOrFail()->value;
//send email
......
<?php
namespace ApiServer\Core\Http\Controllers;
namespace ApiServer\CoreJsonApi\Http\Controllers;
use ApiServer\Authentication\Exceptions\Exceptions\UnauthorizedException;
......@@ -13,7 +13,7 @@ class MeController extends DocumentResourceController
}
public function serializer() {
return 'ApiServer\Core\Serializers\UserSerializer';
return 'ApiServer\CoreJsonApi\Serializers\UserSerializer';
}
public function resource() {
......
<?php
namespace ApiServer\Core\Http\Controllers;
namespace ApiServer\CoreJsonApi\Http\Controllers;
use ApiServer\JsonApi\Http\Controllers\DefaultResourceController;
class OptionsController extends DefaultResourceController
{
public function model() {
return 'ApiServer\Core\Models\Config';
return 'ApiServer\Core\Models\Option';
}
public function serializer() {
return 'ApiServer\Core\Serializers\ConfigSerializer';
return 'ApiServer\CoreJsonApi\Serializers\ConfigSerializer';
}
public function resource() {
......
<?php
namespace ApiServer\Core\Http\Controllers;
namespace ApiServer\CoreJsonApi\Http\Controllers;
use ApiServer\JsonApi\Http\Controllers\DefaultResourceController;
......@@ -11,7 +11,7 @@ class PermissionsController extends DefaultResourceController
}
public function serializer() {
return 'ApiServer\Core\Serializers\PermissionSerializer';
return 'ApiServer\CoreJsonApi\Serializers\PermissionSerializer';
}
public function resource() {
......
<?php
namespace ApiServer\Core\Http\Controllers;
namespace ApiServer\CoreJsonApi\Http\Controllers;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
......
<?php namespace ApiServer\Core\Http\Controllers;
<?php
namespace ApiServer\CoreJsonApi\Http\Controllers;
use ApiServer\JsonApi\Http\Controllers\DefaultResourceController;
......@@ -9,7 +11,7 @@ class RolesController extends DefaultResourceController
}
public function serializer() {
return 'ApiServer\Core\Serializers\RoleSerializer';
return 'ApiServer\CoreJsonApi\Serializers\RoleSerializer';
}
public function resource() {
......
<?php
namespace ApiServer\Core\Http\Controllers;
namespace ApiServer\CoreJsonApi\Http\Controllers;
use ApiServer\JsonApi\Http\Controllers\DefaultResourceController;
......@@ -16,7 +16,7 @@ class UsersController extends DefaultResourceController
}
public function serializer() {
return 'ApiServer\Core\Serializers\UserSerializer';
return 'ApiServer\CoreJsonApi\Serializers\UserSerializer';
}
public function resource() {
......
......@@ -4,13 +4,8 @@ Route::group([
'namespace' => '\ApiServer\CoreJsonApi\Http\Controllers',
'middleware' => 'cors'], function()
{
// TODO: DEPRECATED (remove)
Route::post('/users/signup', 'UsersController@signup');
Route::post('/signup', 'UsersController@signup');
// TODO: DEPRECATED (remove)
Route::post('/users/initiate-password-reset', 'UsersController@initiatePasswordReset');
Route::post('/initiate-password-reset', 'UsersController@initiatePasswordReset');
Route::post('/users/signup', 'AccessController@signup');
Route::post('/users/initiate-password-reset', 'AccessController@initiatePasswordReset');
/**
* Routes using JWT auth
......
<?php
namespace ApiServer\Core\Mail;
namespace ApiServer\CoreJsonApi\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
......
......@@ -13,7 +13,7 @@ class ModuleServiceProvider extends ServiceProvider
public function boot()
{
require __DIR__ . '/Http/routes.php';
require __DIR__ . '/../Http/routes.php';
}
}
......
<?php
namespace ApiServer\Core\Serializers;
namespace ApiServer\CoreJsonApi\Serializers;
use ApiServer\JsonApi\Serializers\BaseSerializer;
class ConfigSerializer extends BaseSerializer
{
protected $type = 'config';
protected $model = 'ApiServer\Core\Models\Config';
protected $model = 'ApiServer\Core\Models\Option';
public function getAttributes($model, array $fields = null)
{
......
<?php namespace ApiServer\Core\Serializers;
<?php namespace ApiServer\CoreJsonApi\Serializers;
use ApiServer\JsonApi\Serializers\BaseSerializer;
use ApiServer\Core\Models\Permission;
......
<?php
namespace ApiServer\JsonApi\Serializers;
namespace ApiServer\CoreJsonApi\Serializers;
class ResourceSerializer extends BasicSerializer
{
......
<?php namespace ApiServer\Core\Serializers;
<?php
namespace ApiServer\CoreJsonApi\Serializers;
use ApiServer\JsonApi\Serializers\BaseSerializer;
use ApiServer\Core\Models\Role;
......
<?php
namespace ApiServer\Core\Serializers;
namespace ApiServer\CoreJsonApi\Serializers;
use ApiServer\JsonApi\Serializers\BaseSerializer;
use ApiServer\Core\Models\User;
......
<?php
namespace ApiServer\Core\Transformers;
namespace ApiServer\CoreJsonApi\Transformers;
use League\Fractal\TransformerAbstract;
......
<?php
namespace ApiServer\Core\Transformers;
namespace ApiServer\CoreJsonApi\Transformers;
use League\Fractal\TransformerAbstract;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment