@@ -2,10 +2,8 @@ |
||
2 | 2 | namespace App\Shell; |
3 | 3 | |
4 | 4 | use Cake\Console\Shell; |
5 | -use Cake\Filesystem\Folder; |
|
6 | 5 | use Cake\Filesystem\File; |
7 | 6 | use Cake\Core\Configure; |
8 | -use Cake\Core\Configure\Engine\PhpConfig; |
|
9 | 7 | |
10 | 8 | class InstallShell extends Shell |
11 | 9 | { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | // Admin account |
28 | 28 | |
29 | 29 | |
30 | - if(!Configure::read('Security.salt')) |
|
30 | + if (!Configure::read('Security.salt')) |
|
31 | 31 | { |
32 | 32 | $salt = $this->in('Salt:'); |
33 | 33 | } |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | Configure::write('Datasources.default.quoteIdentifiers', false); |
49 | 49 | Configure::write('Datasources.default.url', env('DATABASE_URL', null)); |
50 | 50 | $file = new File('config/app_local.php', false); |
51 | - if(!$file->exists()) { |
|
52 | - if($ris = Configure::dump('app_local', 'default')) { |
|
51 | + if (!$file->exists()) { |
|
52 | + if ($ris = Configure::dump('app_local', 'default')) { |
|
53 | 53 | $this->out("Wrote config file app_local.php"); |
54 | 54 | } |
55 | 55 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | |
8 | 8 | Router::defaultRouteClass(DashedRoute::class); |
9 | 9 | |
10 | -Router::scope('/', function (RouteBuilder $routes) { |
|
10 | +Router::scope('/', function(RouteBuilder $routes) { |
|
11 | 11 | |
12 | 12 | $routes->connect('/', ['controller' => 'dashboard', 'action' => 'index']); |
13 | 13 | $routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']); |
@@ -90,7 +90,7 @@ |
||
90 | 90 | */ |
91 | 91 | $file = new File('config/app_local.php', false); |
92 | 92 | if($file->exists()) { |
93 | - Configure::load('app_local', 'default'); |
|
93 | + Configure::load('app_local', 'default'); |
|
94 | 94 | } |
95 | 95 | $file->close(); |
96 | 96 | /* |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * shared configuration. |
90 | 90 | */ |
91 | 91 | $file = new File('config/app_local.php', false); |
92 | -if($file->exists()) { |
|
92 | +if ($file->exists()) { |
|
93 | 93 | Configure::load('app_local', 'default'); |
94 | 94 | } |
95 | 95 | $file->close(); |
@@ -172,12 +172,12 @@ discard block |
||
172 | 172 | /* |
173 | 173 | * Setup detectors for mobile and tablet. |
174 | 174 | */ |
175 | -Request::addDetector('mobile', function ($request) { |
|
175 | +Request::addDetector('mobile', function($request) { |
|
176 | 176 | $detector = new \Detection\MobileDetect(); |
177 | 177 | |
178 | 178 | return $detector->isMobile(); |
179 | 179 | }); |
180 | -Request::addDetector('tablet', function ($request) { |
|
180 | +Request::addDetector('tablet', function($request) { |
|
181 | 181 | $detector = new \Detection\MobileDetect(); |
182 | 182 | |
183 | 183 | return $detector->isTablet(); |
@@ -65,7 +65,6 @@ |
||
65 | 65 | use Cake\Network\Request; |
66 | 66 | use Cake\Utility\Inflector; |
67 | 67 | use Cake\Utility\Security; |
68 | -use Cake\Filesystem\Folder; |
|
69 | 68 | use Cake\Filesystem\File; |
70 | 69 | use Cake\Routing\DispatcherFactory; |
71 | 70 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | $this->addBehavior('Timestamp'); |
40 | 40 | |
41 | - $this->hasMany('Tickets', [ |
|
41 | + $this->hasMany('Tickets', [ |
|
42 | 42 | 'foreignKey' => 'tickettype_id' |
43 | 43 | ]); |
44 | 44 |
@@ -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 |
@@ -43,10 +43,10 @@ |
||
43 | 43 | $this->hasMany('Operations', [ |
44 | 44 | 'foreignKey' => 'ticket_id' |
45 | 45 | ]); |
46 | - $this->belongsTo('Tickettypes', [ |
|
46 | + $this->belongsTo('Tickettypes', [ |
|
47 | 47 | 'foreignKey' => 'tickettype_id' |
48 | 48 | ]); |
49 | - $this->belongsTo('Ticketstatuses', [ |
|
49 | + $this->belongsTo('Ticketstatuses', [ |
|
50 | 50 | 'foreignKey' => 'ticketstatus_id' |
51 | 51 | ]); |
52 | 52 | } |
@@ -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 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | 'password' |
40 | 40 | ]; |
41 | 41 | |
42 | - protected function _setPassword($password) |
|
42 | + protected function _setPassword($password) |
|
43 | 43 | { |
44 | 44 | return (new DefaultPasswordHasher)->hash($password); |
45 | 45 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | { |
21 | 21 | $tickettypes = $this->paginate($this->Tickettypes); |
22 | 22 | |
23 | - $title = "Type of ticket"; |
|
23 | + $title = "Type of ticket"; |
|
24 | 24 | |
25 | 25 | $this->set(compact(['tickettypes', 'title'])); |
26 | 26 | $this->set('_serialize', ['tickettypes']); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | } |
20 | 20 | |
21 | 21 | |
22 | - /** |
|
22 | + /** |
|
23 | 23 | * Index method |
24 | 24 | * |
25 | 25 | * @return \Cake\Network\Response|null |
@@ -115,19 +115,19 @@ discard block |
||
115 | 115 | return $this->redirect(['action' => 'index']); |
116 | 116 | } |
117 | 117 | |
118 | - public function login() { |
|
119 | - if ($this->request->is('post')) { |
|
118 | + public function login() { |
|
119 | + if ($this->request->is('post')) { |
|
120 | 120 | $user = $this->Auth->identify(); |
121 | - $this->set('lu', $user); |
|
121 | + $this->set('lu', $user); |
|
122 | 122 | if ($user) { |
123 | 123 | $this->Auth->setUser($user); |
124 | 124 | return $this->redirect($this->Auth->redirectUrl()); |
125 | 125 | } |
126 | 126 | $this->Flash->error(__('Invalid username or password, try again')); |
127 | 127 | } |
128 | - } |
|
129 | - public function logout() |
|
130 | - { |
|
131 | - return $this->redirect($this->Auth->logout()); |
|
132 | - } |
|
128 | + } |
|
129 | + public function logout() |
|
130 | + { |
|
131 | + return $this->redirect($this->Auth->logout()); |
|
132 | + } |
|
133 | 133 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * Add method |
54 | 54 | * |
55 | - * @return \Cake\Network\Response|null Redirects on successful add, renders view otherwise. |
|
55 | + * @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise. |
|
56 | 56 | */ |
57 | 57 | public function add() |
58 | 58 | { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * Edit method |
75 | 75 | * |
76 | 76 | * @param string|null $id User id. |
77 | - * @return \Cake\Network\Response|null Redirects on successful edit, renders view otherwise. |
|
77 | + * @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise. |
|
78 | 78 | * @throws \Cake\Network\Exception\NotFoundException When record not found. |
79 | 79 | */ |
80 | 80 | public function edit($id = null) |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * Delete method |
100 | 100 | * |
101 | 101 | * @param string|null $id User id. |
102 | - * @return \Cake\Network\Response|null Redirects to index. |
|
102 | + * @return \Cake\Http\Response|null Redirects to index. |
|
103 | 103 | * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. |
104 | 104 | */ |
105 | 105 | public function delete($id = null) |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | // ask if the permissions should be changed |
45 | 45 | if ($io->isInteractive()) { |
46 | - $validator = function ($arg) { |
|
46 | + $validator = function($arg) { |
|
47 | 47 | if (in_array($arg, ['Y', 'y', 'N', 'n'])) { |
48 | 48 | return $arg; |
49 | 49 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | public static function setFolderPermissions($dir, $io) |
129 | 129 | { |
130 | 130 | // Change the permissions on a path and output the results. |
131 | - $changePerms = function ($path, $perms, $io) { |
|
131 | + $changePerms = function($path, $perms, $io) { |
|
132 | 132 | // Get permission bits from stat(2) result. |
133 | 133 | $currentPerms = fileperms($path) & 0777; |
134 | 134 | if (($currentPerms & $perms) == $perms) { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | }; |
145 | 145 | |
146 | - $walker = function ($dir, $perms, $io) use (&$walker, $changePerms) { |
|
146 | + $walker = function($dir, $perms, $io) use (&$walker, $changePerms) { |
|
147 | 147 | $files = array_diff(scandir($dir), ['.', '..']); |
148 | 148 | foreach ($files as $file) { |
149 | 149 | $path = $dir . '/' . $file; |