@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $requestUri = $request->getRequestUri(); |
48 | 48 | |
49 | 49 | $uri = parse_url($requestUri, PHP_URL_PATH); |
50 | - $uri = explode( '/', $uri ); |
|
50 | + $uri = explode('/', $uri); |
|
51 | 51 | return $this->sanitizeUrl(array_slice($uri, ((int) array_search('index.php', $uri) + 1))); |
52 | 52 | } |
53 | 53 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | $filters = []; |
76 | 76 | $array_size = count($array); |
77 | - for ($i=0; $i < $array_size; $i++) { |
|
77 | + for ($i = 0; $i < $array_size; $i++) { |
|
78 | 78 | array_push($filters, 'trim|escape'); |
79 | 79 | } |
80 | 80 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @param mixed $data |
93 | 93 | * @param string $httpHeader |
94 | 94 | */ |
95 | - protected function sendOutput($data, $httpHeaders=array()): void |
|
95 | + protected function sendOutput($data, $httpHeaders = array()): void |
|
96 | 96 | { |
97 | 97 | header_remove('Set-Cookie'); |
98 | 98 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $arrFolders = $folderModel->getFoldersInfo(explode(",", $userData['folders_list'])); |
49 | 49 | $responseData = json_encode($arrFolders); |
50 | 50 | } catch (Error $e) { |
51 | - $strErrorDesc = $e->getMessage() . ' Something went wrong! Please contact support.3'; |
|
51 | + $strErrorDesc = $e->getMessage().' Something went wrong! Please contact support.3'; |
|
52 | 52 | $strErrorHeader = 'HTTP/1.1 500 Internal Server Error'; |
53 | 53 | } |
54 | 54 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | $responseData = json_encode($arrFolder); |
123 | 123 | } catch (Error $e) { |
124 | - $strErrorDesc = $e->getMessage() . ' Something went wrong! Please contact support.1'; |
|
124 | + $strErrorDesc = $e->getMessage().' Something went wrong! Please contact support.1'; |
|
125 | 125 | $strErrorHeader = 'HTTP/1.1 500 Internal Server Error'; |
126 | 126 | } |
127 | 127 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('api') === false) { |
72 | 72 | // Not allowed page |
73 | 73 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
74 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
74 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
75 | 75 | exit; |
76 | 76 | } |
77 | 77 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | <?php |
159 | 159 | $rowsKeys = DB::query( |
160 | 160 | 'SELECT * |
161 | - FROM ' . prefixTable('api') . ' |
|
161 | + FROM ' . prefixTable('api').' |
|
162 | 162 | WHERE type = %s |
163 | 163 | ORDER BY timestamp ASC', |
164 | 164 | 'key' |
@@ -181,15 +181,15 @@ discard block |
||
181 | 181 | <?php |
182 | 182 | foreach ($rowsKeys as $key) { |
183 | 183 | echo ' |
184 | - <tr data-id="' . $key['increment_id'] . '"> |
|
185 | - <td width="50px"><i class="fas fa-trash infotip pointer delete-api-key" title="' . $lang->get('del_button') . '"></i></td> |
|
186 | - <td><span class="edit-api-key pointer">' . $key['label'] . '</span></td> |
|
187 | - <td>' . $key['value']. '</td> |
|
188 | - <td><i class="fas '.((int) $key['enabled'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="enabled" data-increment-id="' . $key['increment_id'] . '"></i></td> |
|
189 | - <td><i class="fas '.((int) $key['allowed_to_create'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_create" data-increment-id="' . $key['increment_id'] . '"></i></td> |
|
190 | - <td><i class="fas '.((int) $key['allowed_to_read'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_read" data-increment-id="' . $key['increment_id'] . '"></i></td> |
|
191 | - <td><i class="fas '.((int) $key['allowed_to_update'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_update" data-increment-id="' . $key['increment_id'] . '"></i></td> |
|
192 | - <td><i class="fas '.((int) $key['allowed_to_delete'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_delete" data-increment-id="' . $key['increment_id'] . '"></i></td> |
|
184 | + <tr data-id="' . $key['increment_id'].'"> |
|
185 | + <td width="50px"><i class="fas fa-trash infotip pointer delete-api-key" title="' . $lang->get('del_button').'"></i></td> |
|
186 | + <td><span class="edit-api-key pointer">' . $key['label'].'</span></td> |
|
187 | + <td>' . $key['value'].'</td> |
|
188 | + <td><i class="fas '.((int) $key['enabled'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="enabled" data-increment-id="'.$key['increment_id'].'"></i></td> |
|
189 | + <td><i class="fas '.((int) $key['allowed_to_create'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_create" data-increment-id="'.$key['increment_id'].'"></i></td> |
|
190 | + <td><i class="fas '.((int) $key['allowed_to_read'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_read" data-increment-id="'.$key['increment_id'].'"></i></td> |
|
191 | + <td><i class="fas '.((int) $key['allowed_to_update'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_update" data-increment-id="'.$key['increment_id'].'"></i></td> |
|
192 | + <td><i class="fas '.((int) $key['allowed_to_delete'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_delete" data-increment-id="'.$key['increment_id'].'"></i></td> |
|
193 | 193 | </tr>'; |
194 | 194 | } ?> |
195 | 195 | </tbody> |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | <div class="col-12 mt-4" id="table-api-ip"> |
225 | 225 | <?php |
226 | 226 | $rowsIps = DB::query( |
227 | - 'SELECT increment_id, label, timestamp value FROM ' . prefixTable('api') . ' |
|
227 | + 'SELECT increment_id, label, timestamp value FROM '.prefixTable('api').' |
|
228 | 228 | WHERE type = %s |
229 | 229 | ORDER BY timestamp ASC', |
230 | 230 | 'ip' |
@@ -242,10 +242,10 @@ discard block |
||
242 | 242 | <?php |
243 | 243 | foreach ($rowsIps as $ip) { |
244 | 244 | echo ' |
245 | - <tr data-id="' . $ip['increment_id'] . '"> |
|
246 | - <td width="50px"><i class="fas fa-trash infotip pointer delete-api-ip" title="' . $lang->get('del_button') . '"></i></td> |
|
247 | - <td><span class="edit-api-ip pointer" data-field="label">' . $ip['label'] . '</span></td> |
|
248 | - <td><span class="edit-api-ip pointer" data-field="value">' . $ip['value'] . '</span></td> |
|
245 | + <tr data-id="' . $ip['increment_id'].'"> |
|
246 | + <td width="50px"><i class="fas fa-trash infotip pointer delete-api-ip" title="' . $lang->get('del_button').'"></i></td> |
|
247 | + <td><span class="edit-api-ip pointer" data-field="label">' . $ip['label'].'</span></td> |
|
248 | + <td><span class="edit-api-ip pointer" data-field="value">' . $ip['value'].'</span></td> |
|
249 | 249 | </tr>'; |
250 | 250 | } ?> |
251 | 251 | </tbody> |
@@ -281,8 +281,8 @@ discard block |
||
281 | 281 | <?php |
282 | 282 | $rowsKeys = DB::query( |
283 | 283 | 'SELECT a.*, u.name, u.lastname, u.login |
284 | - FROM ' . prefixTable('api') . ' AS a |
|
285 | - INNER JOIN ' . prefixTable('users') . ' AS u ON a.user_id = u.id |
|
284 | + FROM ' . prefixTable('api').' AS a |
|
285 | + INNER JOIN ' . prefixTable('users').' AS u ON a.user_id = u.id |
|
286 | 286 | WHERE a.type = %s |
287 | 287 | ORDER BY u.login ASC', |
288 | 288 | 'user' |
@@ -303,13 +303,13 @@ discard block |
||
303 | 303 | <?php |
304 | 304 | foreach ($rowsKeys as $key) { |
305 | 305 | echo ' |
306 | - <tr data-id="' . $key['increment_id'] . '"> |
|
307 | - <td>' . $key['name'] . ' ' . $key['lastname'] . ' (<i>'.$key['login'].'</i>)</td> |
|
308 | - <td><i class="fas '.((int) $key['enabled'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="enabled" data-increment-id="' . $key['increment_id'] . '"></i></td> |
|
309 | - <td><i class="fas '.((int) $key['allowed_to_create'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_create" data-increment-id="' . $key['increment_id'] . '"></i></td> |
|
310 | - <td><i class="fas '.((int) $key['allowed_to_read'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_read" data-increment-id="' . $key['increment_id'] . '"></i></td> |
|
311 | - <td><i class="fas '.((int) $key['allowed_to_update'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_update" data-increment-id="' . $key['increment_id'] . '"></i></td> |
|
312 | - <td><i class="fas '.((int) $key['allowed_to_delete'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_delete" data-increment-id="' . $key['increment_id'] . '"></i></td> |
|
306 | + <tr data-id="' . $key['increment_id'].'"> |
|
307 | + <td>' . $key['name'].' '.$key['lastname'].' (<i>'.$key['login'].'</i>)</td> |
|
308 | + <td><i class="fas '.((int) $key['enabled'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="enabled" data-increment-id="'.$key['increment_id'].'"></i></td> |
|
309 | + <td><i class="fas '.((int) $key['allowed_to_create'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_create" data-increment-id="'.$key['increment_id'].'"></i></td> |
|
310 | + <td><i class="fas '.((int) $key['allowed_to_read'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_read" data-increment-id="'.$key['increment_id'].'"></i></td> |
|
311 | + <td><i class="fas '.((int) $key['allowed_to_update'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_update" data-increment-id="'.$key['increment_id'].'"></i></td> |
|
312 | + <td><i class="fas '.((int) $key['allowed_to_delete'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_delete" data-increment-id="'.$key['increment_id'].'"></i></td> |
|
313 | 313 | </tr>'; |
314 | 314 | } ?> |
315 | 315 | </tbody> |
@@ -72,7 +72,7 @@ |
||
72 | 72 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('tools') === false) { |
73 | 73 | // Not allowed page |
74 | 74 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
75 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
75 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
76 | 76 | exit; |
77 | 77 | } |
78 | 78 | ?> |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('tools') === false) { |
70 | 70 | // Not allowed page |
71 | 71 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
72 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
72 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
73 | 73 | exit; |
74 | 74 | } |
75 | 75 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | </div> |
131 | 131 | <?php |
132 | 132 | // Check if table exists |
133 | -$tableExists = DB::queryFirstField('SHOW TABLES LIKE %s', 'teampass_items_v2');; |
|
133 | +$tableExists = DB::queryFirstField('SHOW TABLES LIKE %s', 'teampass_items_v2'); ; |
|
134 | 134 | if (is_null($tableExists) === true) { |
135 | 135 | echo ' |
136 | 136 | <div class="alert alert-warning" role="warning"><i class="fas fa-lightbulb mr-2"></i>'.$lang->get('table_not_exists').'</div>'; |
@@ -69,7 +69,7 @@ |
||
69 | 69 | ) { |
70 | 70 | // Not allowed page |
71 | 71 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
72 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
72 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
73 | 73 | exit; |
74 | 74 | } |
75 | 75 |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('tasks') === false) { |
74 | 74 | // Not allowed page |
75 | 75 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
76 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
76 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
77 | 77 | exit; |
78 | 78 | } |
79 | 79 | ?> |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | // error |
371 | 371 | toastr.remove(); |
372 | 372 | toastr.error( |
373 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
373 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
374 | 374 | '', { |
375 | 375 | closeButton: true, |
376 | 376 | positionClass: 'toast-bottom-right' |
@@ -393,11 +393,11 @@ discard block |
||
393 | 393 | $('#'+field+'_parameter_value').val(frequency === null ? '' : frequency + ';' +value,); |
394 | 394 | param = value.split(';'); |
395 | 395 | if (param.length === 1) { |
396 | - txt = ' <?php echo $lang->get('at');?> ' + param[0]; |
|
396 | + txt = ' <?php echo $lang->get('at'); ?> ' + param[0]; |
|
397 | 397 | } else { |
398 | - txt = ' <?php echo $lang->get('day');?> ' + param[1] + ' <?php echo $lang->get('at');?> ' + param[0]; |
|
398 | + txt = ' <?php echo $lang->get('day'); ?> ' + param[1] + ' <?php echo $lang->get('at'); ?> ' + param[0]; |
|
399 | 399 | } |
400 | - $('#'+field+'_parameter').val(frequency === null ? '<?php echo $lang->get('not_defined');?>' : (data.message + txt)); |
|
400 | + $('#'+field+'_parameter').val(frequency === null ? '<?php echo $lang->get('not_defined'); ?>' : (data.message + txt)); |
|
401 | 401 | $("#task-define-modal").modal('hide'); |
402 | 402 | $('#task-define-modal-type, #task-define-modal-parameter-hourly-value, #task-define-modal-parameter-daily-value, #task-define-modal-frequency').val(''); |
403 | 403 | } |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | // error |
504 | 504 | toastr.remove(); |
505 | 505 | toastr.error( |
506 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
506 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
507 | 507 | '', { |
508 | 508 | closeButton: true, |
509 | 509 | positionClass: 'toast-bottom-right' |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | // error |
565 | 565 | toastr.remove(); |
566 | 566 | toastr.error( |
567 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
567 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
568 | 568 | '', { |
569 | 569 | closeButton: true, |
570 | 570 | positionClass: 'toast-bottom-right' |
@@ -71,7 +71,7 @@ |
||
71 | 71 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('oauth') === false) { |
72 | 72 | // Not allowed page |
73 | 73 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
74 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
74 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
75 | 75 | exit; |
76 | 76 | } |
77 | 77 |
@@ -71,7 +71,7 @@ |
||
71 | 71 | function reloadCacheTable(): void |
72 | 72 | { |
73 | 73 | // Load expected files |
74 | - require_once __DIR__. '/../sources/main.functions.php'; |
|
74 | + require_once __DIR__.'/../sources/main.functions.php'; |
|
75 | 75 | |
76 | 76 | updateCacheTable('reload', NULL); |
77 | 77 | } |
78 | 78 | \ No newline at end of file |