@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace App\Model\Table; |
| 3 | 3 | |
| 4 | -use Cake\ORM\Query; |
|
| 5 | 4 | use Cake\ORM\RulesChecker; |
| 6 | 5 | use Cake\ORM\Table; |
| 7 | 6 | use Cake\Validation\Validator; |
@@ -14,10 +14,6 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | namespace App\View; |
| 16 | 16 | |
| 17 | -use Cake\Event\EventManager; |
|
| 18 | -use Cake\Network\Request; |
|
| 19 | -use Cake\Network\Response; |
|
| 20 | - |
|
| 21 | 17 | /** |
| 22 | 18 | * A view class that is used for AJAX responses. |
| 23 | 19 | * Currently only switches the default layout and sets the response type - |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | $this->loadComponent('Flash'); |
| 46 | 46 | $this->loadComponent('Security'); |
| 47 | 47 | $this->loadComponent('Csrf'); |
| 48 | - $this->loadComponent('Auth', [ |
|
| 49 | - 'authorize' => ['Controller'], |
|
| 48 | + $this->loadComponent('Auth', [ |
|
| 49 | + 'authorize' => ['Controller'], |
|
| 50 | 50 | 'authenticate' => [ |
| 51 | 51 | 'Form' => [ |
| 52 | 52 | 'fields' => [ |
@@ -59,25 +59,25 @@ discard block |
||
| 59 | 59 | 'controller' => 'Users', |
| 60 | 60 | 'action' => 'login' |
| 61 | 61 | ], |
| 62 | - 'logoutAction' => [ |
|
| 62 | + 'logoutAction' => [ |
|
| 63 | 63 | 'controller' => 'Users', |
| 64 | 64 | 'action' => 'login' |
| 65 | 65 | ], |
| 66 | - 'unauthorizedRedirect' => $this->referer() |
|
| 67 | - ]); |
|
| 68 | - $this->Auth->allow(); |
|
| 66 | + 'unauthorizedRedirect' => $this->referer() |
|
| 67 | + ]); |
|
| 68 | + $this->Auth->allow(); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - public function isAuthorized($user) |
|
| 72 | - { |
|
| 73 | - // Admin can access every action |
|
| 74 | - if (isset($user['role']) && $user['role'] === 'admin') { |
|
| 75 | - return true; |
|
| 76 | - } |
|
| 71 | + public function isAuthorized($user) |
|
| 72 | + { |
|
| 73 | + // Admin can access every action |
|
| 74 | + if (isset($user['role']) && $user['role'] === 'admin') { |
|
| 75 | + return true; |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | - // Default permit |
|
| 79 | - return true; |
|
| 80 | - } |
|
| 78 | + // Default permit |
|
| 79 | + return true; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -1,8 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace App\Model\Table; |
| 3 | 3 | |
| 4 | -use Cake\ORM\Query; |
|
| 5 | -use Cake\ORM\RulesChecker; |
|
| 6 | 4 | use Cake\ORM\Table; |
| 7 | 5 | use Cake\Validation\Validator; |
| 8 | 6 | |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace App\Model\Table; |
| 3 | 3 | |
| 4 | -use Cake\ORM\Query; |
|
| 5 | 4 | use Cake\ORM\RulesChecker; |
| 6 | 5 | use Cake\ORM\Table; |
| 7 | 6 | use Cake\Validation\Validator; |