@@ -82,7 +82,7 @@ |
||
82 | 82 | return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); |
83 | 83 | } |
84 | 84 | |
85 | -function get_authorization_header(){ |
|
85 | +function get_authorization_header() { |
|
86 | 86 | $superGlobal = new SuperGlobal(); |
87 | 87 | $headers = null; |
88 | 88 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | use Firebase\JWT\JWT; |
28 | 28 | use Firebase\JWT\Key; |
29 | 29 | |
30 | -require_once API_ROOT_PATH . "/Model/Database.php"; |
|
30 | +require_once API_ROOT_PATH."/Model/Database.php"; |
|
31 | 31 | |
32 | 32 | |
33 | 33 | class AuthModel extends Database |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function getUserAuth(string $login, string $password, string $apikey): array |
46 | 46 | { |
47 | 47 | // Sanitize |
48 | - include_once API_ROOT_PATH . '/../sources/main.functions.php'; |
|
48 | + include_once API_ROOT_PATH.'/../sources/main.functions.php'; |
|
49 | 49 | $inputData = dataSanitizer( |
50 | 50 | [ |
51 | 51 | 'login' => isset($login) === true ? $login : '', |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | 'password' => 'trim|escape', |
58 | 58 | 'apikey' => 'trim|escape', |
59 | 59 | ], |
60 | - API_ROOT_PATH . '/..' |
|
60 | + API_ROOT_PATH.'/..' |
|
61 | 61 | ); |
62 | 62 | if (empty($inputData['login']) === true || empty($inputData['apikey']) === true) { |
63 | 63 | return ["error" => "Login failed0.", "info" => "Empty entry"]; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | // Check apikey |
67 | 67 | if (empty($inputData['password']) === true) { |
68 | 68 | // case where it is a generic key |
69 | - $apiInfo = $this->select("SELECT count(*) FROM " . prefixTable('api') . " WHERE value='".$inputData['apikey']."' AND label='".$inputData['login']."'"); |
|
69 | + $apiInfo = $this->select("SELECT count(*) FROM ".prefixTable('api')." WHERE value='".$inputData['apikey']."' AND label='".$inputData['login']."'"); |
|
70 | 70 | if ((int) $apiInfo[0]['count(*)'] === 0) { |
71 | 71 | return ["error" => "Login failed1.", "info" => "apikey : Not valid"]; |
72 | 72 | } |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | // Check if user exists |
78 | 78 | $userInfoRes = $this->select( |
79 | 79 | "SELECT u.id, u.pw, u.public_key, u.private_key, u.personal_folder, u.fonction_id, u.groupes_visibles, u.groupes_interdits, a.value AS user_api_key |
80 | - FROM " . prefixTable('users') . " AS u |
|
81 | - INNER JOIN " . prefixTable('api') . " AS a ON (a.user_id=u.id) |
|
80 | + FROM " . prefixTable('users')." AS u |
|
81 | + INNER JOIN " . prefixTable('api')." AS a ON (a.user_id=u.id) |
|
82 | 82 | WHERE login='".$inputData['login']."'"); |
83 | 83 | if (count($userInfoRes) === 0) { |
84 | 84 | return ["error" => "Login failed3.", "info" => "apikey : Not valid"]; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | private function createUserJWT(int $id, string $login, int $pf_enabled, string $pubkey, string $privkey, string $folders, string $items): array |
133 | 133 | { |
134 | - include API_ROOT_PATH . '/../includes/config/tp.config.php'; |
|
134 | + include API_ROOT_PATH.'/../includes/config/tp.config.php'; |
|
135 | 135 | |
136 | 136 | $payload = [ |
137 | 137 | 'username' => $login, |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | |
176 | 176 | // Get folders from the roles |
177 | 177 | if (empty($userFunctionId) === false) { |
178 | - $rows = $this->select("SELECT * FROM " . prefixTable('roles_values') . " WHERE role_id IN (".$userFunctionId.") AND type IN ('W', 'ND', 'NE', 'NDNE', 'R')"); |
|
178 | + $rows = $this->select("SELECT * FROM ".prefixTable('roles_values')." WHERE role_id IN (".$userFunctionId.") AND type IN ('W', 'ND', 'NE', 'NDNE', 'R')"); |
|
179 | 179 | foreach ($rows as $record) { |
180 | 180 | if ($record['type'] === 'R') { |
181 | 181 | array_push($readOnlyFolders, $record['folder_id']); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | // Does this user is allowed to see other items |
198 | 198 | $inc = 0; |
199 | - $rows = $this->select("SELECT id, id_tree FROM " . prefixTable('items') . " WHERE restricted_to LIKE '".$userInfo['id']."'". |
|
199 | + $rows = $this->select("SELECT id, id_tree FROM ".prefixTable('items')." WHERE restricted_to LIKE '".$userInfo['id']."'". |
|
200 | 200 | (empty($userFunctionId) === false ? ' AND id_tree NOT IN ('.$userFunctionId.')' : '')); |
201 | 201 | foreach ($rows as $record) { |
202 | 202 | // Exclude restriction on item if folder is fully accessible |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | |
207 | 207 | // Check for the users roles if some specific rights exist on items |
208 | 208 | $rows = $this->select("SELECT i.id_tree, r.item_id |
209 | - FROM " . prefixTable('items') . " as i |
|
210 | - INNER JOIN " . prefixTable('restriction_to_roles') . " as r ON (r.item_id=i.id) |
|
209 | + FROM " . prefixTable('items')." as i |
|
210 | + INNER JOIN " . prefixTable('restriction_to_roles')." as r ON (r.item_id=i.id) |
|
211 | 211 | WHERE ".(empty($userFunctionId) === false ? ' id_tree NOT IN ('.$userFunctionId.') AND ' : '')." i.id_tree != '' |
212 | 212 | ORDER BY i.id_tree ASC"); |
213 | 213 | foreach ($rows as $record) { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | // Add all personal folders |
222 | 222 | $rows = $this->select( |
223 | 223 | 'SELECT id |
224 | - FROM ' . prefixTable('nested_tree') . ' |
|
224 | + FROM ' . prefixTable('nested_tree').' |
|
225 | 225 | WHERE title = '.$userInfo['id'].' AND personal_folder = 1'. |
226 | 226 | (empty($userFunctionId) === false ? ' AND id NOT IN ('.$userFunctionId.')' : ''). |
227 | 227 | ' LIMIT 0,1' |
@@ -68,7 +68,7 @@ |
||
68 | 68 | DB::debugmode(false); |
69 | 69 | $rows = DB::query( |
70 | 70 | 'SELECT * |
71 | - FROM ' . prefixTable('processes') . ' |
|
71 | + FROM ' . prefixTable('processes').' |
|
72 | 72 | WHERE is_in_progress = %i AND process_type = %s |
73 | 73 | ORDER BY increment_id ASC LIMIT 0,10', |
74 | 74 | 0, |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | */ |
91 | 91 | function provideLog(string $message, array $SETTINGS) |
92 | 92 | { |
93 | - echo '\n' . (string) date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time()) . ' - '.$message . '\n'; |
|
93 | + echo '\n'.(string) date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time()).' - '.$message.'\n'; |
|
94 | 94 | } |
95 | 95 | |
96 | -function performVisibleFoldersHtmlUpdate (int $user_id) |
|
96 | +function performVisibleFoldersHtmlUpdate(int $user_id) |
|
97 | 97 | { |
98 | 98 | $html = []; |
99 | 99 | |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | |
104 | 104 | // get current folders visible for user |
105 | 105 | $cache_tree = DB::queryFirstRow( |
106 | - 'SELECT increment_id, data FROM ' . prefixTable('cache_tree') . ' WHERE user_id = %i', |
|
106 | + 'SELECT increment_id, data FROM '.prefixTable('cache_tree').' WHERE user_id = %i', |
|
107 | 107 | $user_id |
108 | 108 | ); |
109 | - $folders = json_decode($cache_tree['data'], true);//print_r($folders); |
|
109 | + $folders = json_decode($cache_tree['data'], true); //print_r($folders); |
|
110 | 110 | foreach ($folders as $folder) { |
111 | 111 | $idFolder = (int) explode("li_", $folder['id'])[1]; |
112 | 112 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | // get folder info |
121 | 121 | $folder = DB::queryFirstRow( |
122 | - 'SELECT title, parent_id, personal_folder FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', |
|
122 | + 'SELECT title, parent_id, personal_folder FROM '.prefixTable('nested_tree').' WHERE id = %i', |
|
123 | 123 | $idFolder |
124 | 124 | ); |
125 | 125 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('statistics') === false) { |
66 | 66 | // Not allowed page |
67 | 67 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
68 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
68 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
69 | 69 | exit; |
70 | 70 | } |
71 | 71 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('profile') === 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 | ?> |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | }) |
96 | 96 | |
97 | 97 | // Select user properties |
98 | - $('#profile-user-language option[value=<?php echo $session->get('user-language');?>').attr('selected','selected'); |
|
98 | + $('#profile-user-language option[value=<?php echo $session->get('user-language'); ?>').attr('selected','selected'); |
|
99 | 99 | |
100 | 100 | |
101 | 101 | // AVATAR IMPORT |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | $('#profile-user-email').val(data.email) |
263 | 263 | |
264 | 264 | // reload page in case of language change |
265 | - if ($('#profile-user-language').val().toLowerCase() !== '<?php echo $session->get('user-language');?>') { |
|
265 | + if ($('#profile-user-language').val().toLowerCase() !== '<?php echo $session->get('user-language'); ?>') { |
|
266 | 266 | // prepare reload |
267 | 267 | $(this).delay(3000).queue(function() { |
268 | 268 | document.location.href = "index.php?page=profile"; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | // Inform user |
274 | 274 | toastr.remove(); |
275 | 275 | toastr.info( |
276 | - '<?php echo $lang->get('alert_page_will_reload') . ' ... ' . $lang->get('please_wait'); ?>', |
|
276 | + '<?php echo $lang->get('alert_page_will_reload').' ... '.$lang->get('please_wait'); ?>', |
|
277 | 277 | '', { |
278 | 278 | timeOut: 3000, |
279 | 279 | progressBar: true |
@@ -377,27 +377,27 @@ discard block |
||
377 | 377 | "defaultText": "<?php echo $lang->get('index_pw_level_txt'); ?>", |
378 | 378 | "ratings": [ |
379 | 379 | { |
380 | - "minScore": <?php echo TP_PW_STRENGTH_1;?>, |
|
380 | + "minScore": <?php echo TP_PW_STRENGTH_1; ?>, |
|
381 | 381 | "className": "meterWarn", |
382 | 382 | "text": "<?php echo $lang->get('complex_level1'); ?>" |
383 | 383 | }, |
384 | 384 | { |
385 | - "minScore": <?php echo TP_PW_STRENGTH_2;?>, |
|
385 | + "minScore": <?php echo TP_PW_STRENGTH_2; ?>, |
|
386 | 386 | "className": "meterWarn", |
387 | 387 | "text": "<?php echo $lang->get('complex_level2'); ?>" |
388 | 388 | }, |
389 | 389 | { |
390 | - "minScore": <?php echo TP_PW_STRENGTH_3;?>, |
|
390 | + "minScore": <?php echo TP_PW_STRENGTH_3; ?>, |
|
391 | 391 | "className": "meterGood", |
392 | 392 | "text": "<?php echo $lang->get('complex_level3'); ?>" |
393 | 393 | }, |
394 | 394 | { |
395 | - "minScore": <?php echo TP_PW_STRENGTH_4;?>, |
|
395 | + "minScore": <?php echo TP_PW_STRENGTH_4; ?>, |
|
396 | 396 | "className": "meterGood", |
397 | 397 | "text": "<?php echo $lang->get('complex_level4'); ?>" |
398 | 398 | }, |
399 | 399 | { |
400 | - "minScore": <?php echo TP_PW_STRENGTH_5;?>, |
|
400 | + "minScore": <?php echo TP_PW_STRENGTH_5; ?>, |
|
401 | 401 | "className": "meterExcel", |
402 | 402 | "text": "<?php echo $lang->get('complex_level5'); ?>" |
403 | 403 | } |
@@ -490,27 +490,27 @@ discard block |
||
490 | 490 | "defaultText": "<?php echo $lang->get('index_pw_level_txt'); ?>", |
491 | 491 | "ratings": [ |
492 | 492 | { |
493 | - "minScore": <?php echo TP_PW_STRENGTH_1;?>, |
|
493 | + "minScore": <?php echo TP_PW_STRENGTH_1; ?>, |
|
494 | 494 | "className": "meterWarn", |
495 | 495 | "text": "<?php echo $lang->get('complex_level1'); ?>" |
496 | 496 | }, |
497 | 497 | { |
498 | - "minScore": <?php echo TP_PW_STRENGTH_2;?>, |
|
498 | + "minScore": <?php echo TP_PW_STRENGTH_2; ?>, |
|
499 | 499 | "className": "meterWarn", |
500 | 500 | "text": "<?php echo $lang->get('complex_level2'); ?>" |
501 | 501 | }, |
502 | 502 | { |
503 | - "minScore": <?php echo TP_PW_STRENGTH_3;?>, |
|
503 | + "minScore": <?php echo TP_PW_STRENGTH_3; ?>, |
|
504 | 504 | "className": "meterGood", |
505 | 505 | "text": "<?php echo $lang->get('complex_level3'); ?>" |
506 | 506 | }, |
507 | 507 | { |
508 | - "minScore": <?php echo TP_PW_STRENGTH_4;?>, |
|
508 | + "minScore": <?php echo TP_PW_STRENGTH_4; ?>, |
|
509 | 509 | "className": "meterGood", |
510 | 510 | "text": "<?php echo $lang->get('complex_level4'); ?>" |
511 | 511 | }, |
512 | 512 | { |
513 | - "minScore": <?php echo TP_PW_STRENGTH_5;?>, |
|
513 | + "minScore": <?php echo TP_PW_STRENGTH_5; ?>, |
|
514 | 514 | "className": "meterExcel", |
515 | 515 | "text": "<?php echo $lang->get('complex_level5'); ?>" |
516 | 516 | } |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | } |
527 | 527 | }); |
528 | 528 | |
529 | - $('#profile-keys_download-date').text('<?php echo null === $session->get('user-keys_recovery_time') ? $lang->get('none') : date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $session->get('user-keys_recovery_time')); ?>'); |
|
529 | + $('#profile-keys_download-date').text('<?php echo null === $session->get('user-keys_recovery_time') ? $lang->get('none') : date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $session->get('user-keys_recovery_time')); ?>'); |
|
530 | 530 | |
531 | 531 | $("#open-dialog-keys-download").on('click', function(event) { |
532 | 532 | event.preventDefault(); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('favourites') === false) { |
66 | 66 | // Not allowed page |
67 | 67 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
68 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
68 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
69 | 69 | exit; |
70 | 70 | } |
71 | 71 | |
@@ -118,12 +118,12 @@ discard block |
||
118 | 118 | if (empty($fav) === false) { |
119 | 119 | $data = DB::queryFirstRow( |
120 | 120 | 'SELECT i.label, i.description, i.id, i.id_tree, t.title |
121 | - FROM ' . prefixTable('items') . ' as i |
|
122 | - INNER JOIN ' . prefixTable('nested_tree') . ' as t ON (t.id = i.id_tree) |
|
121 | + FROM ' . prefixTable('items').' as i |
|
122 | + INNER JOIN ' . prefixTable('nested_tree').' as t ON (t.id = i.id_tree) |
|
123 | 123 | WHERE i.id = %i', |
124 | 124 | $fav |
125 | 125 | ); |
126 | - if (! empty($data['label'])) { |
|
126 | + if (!empty($data['label'])) { |
|
127 | 127 | ?> |
128 | 128 | <tr> |
129 | 129 | <td> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('folders') === false) { |
67 | 67 | // Not allowed page |
68 | 68 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
69 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
69 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
70 | 70 | exit; |
71 | 71 | } |
72 | 72 | |
@@ -99,28 +99,28 @@ discard block |
||
99 | 99 | $complexityHtml = '<div id="hidden-select-complexity" class="hidden"><select id="select-complexity" class="form-control form-item-control save-me">'; |
100 | 100 | $complexitySelect = ''; |
101 | 101 | foreach (TP_PW_COMPLEXITY as $level) { |
102 | - $complexitySelect .= '<option value="' . $level[0] . '">' . $level[1] . '</option>'; |
|
102 | + $complexitySelect .= '<option value="'.$level[0].'">'.$level[1].'</option>'; |
|
103 | 103 | } |
104 | -$complexityHtml .= $complexitySelect . '</select></div>'; |
|
104 | +$complexityHtml .= $complexitySelect.'</select></div>'; |
|
105 | 105 | |
106 | 106 | /* Get full tree structure */ |
107 | 107 | $tst = $tree->getDescendants(); |
108 | 108 | // prepare options list |
109 | -$droplist = '<option value="na">---' . $lang->get('select') . '---</option>'; |
|
109 | +$droplist = '<option value="na">---'.$lang->get('select').'---</option>'; |
|
110 | 110 | if ((int) $session->get('user-admin') === 1 || (int) $session->get('user-manager') === 1 || (int) $session->get('user-can_create_root_folder') === 1) { |
111 | - $droplist .= '<option value="0">' . $lang->get('root') . '</option>'; |
|
111 | + $droplist .= '<option value="0">'.$lang->get('root').'</option>'; |
|
112 | 112 | } |
113 | 113 | foreach ($tst as $t) { |
114 | 114 | if ( |
115 | 115 | in_array($t->id, $session->get('user-accessible_folders')) === true |
116 | 116 | && in_array($t->id, $session->get('user-personal_visible_folders')) === false |
117 | 117 | ) { |
118 | - $droplist .= '<option value="' . $t->id . '">' . addslashes($t->title); |
|
118 | + $droplist .= '<option value="'.$t->id.'">'.addslashes($t->title); |
|
119 | 119 | $text = ''; |
120 | 120 | foreach ($tree->getPath($t->id, false) as $fld) { |
121 | - $text .= empty($text) === true ? ' [' . $fld->title : ' > ' . $fld->title; |
|
121 | + $text .= empty($text) === true ? ' ['.$fld->title : ' > '.$fld->title; |
|
122 | 122 | } |
123 | - $droplist .= (empty($text) === true ? '' : $text . '</i>]') . '</option>'; |
|
123 | + $droplist .= (empty($text) === true ? '' : $text.'</i>]').'</option>'; |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
@@ -199,14 +199,14 @@ discard block |
||
199 | 199 | <label><?php echo $lang->get('icon'); ?></label> |
200 | 200 | <input type="text" class="form-control form-folder-control purify" id="new-folder-add-icon" data-field="icon"> |
201 | 201 | <small class='form-text text-muted'> |
202 | - <?php echo $lang->get('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL;?>" target="_blank"><i class="fas fa-external-link-alt ml-1"></i></a> |
|
202 | + <?php echo $lang->get('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL; ?>" target="_blank"><i class="fas fa-external-link-alt ml-1"></i></a> |
|
203 | 203 | </small> |
204 | 204 | </div> |
205 | 205 | <div class="form-group"> |
206 | 206 | <label><?php echo $lang->get('icon_on_selection'); ?></label> |
207 | 207 | <input type="text" class="form-control form-folder-control purify" id="new-folder-add-icon-selected" data-field="iconSelected"> |
208 | 208 | <small class='form-text text-muted'> |
209 | - <?php echo $lang->get('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL;?>" target="_blank"><i class="fas fa-external-link-alt ml-1"></i></a> |
|
209 | + <?php echo $lang->get('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL; ?>" target="_blank"><i class="fas fa-external-link-alt ml-1"></i></a> |
|
210 | 210 | </small> |
211 | 211 | </div> |
212 | 212 | <div class="form-group"> |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | <th scope="col" min-width="200px"><?php echo $lang->get('group'); ?></th> |
298 | 298 | <th scope="col" min-width="200px"><?php echo $lang->get('group_parent'); ?></th> |
299 | 299 | <th scope="col" width="50px"><i class="fas fa-gavel fa-lg infotip" title="<?php echo $lang->get('password_strength'); ?>"></i></th> |
300 | - <th scope="col" width="50px"><i class="fas fa-recycle fa-lg infotip" title="<?php echo $lang->get('group_pw_duration') . ' ' . $lang->get('group_pw_duration_tip'); ?>"></i></th> |
|
300 | + <th scope="col" width="50px"><i class="fas fa-recycle fa-lg infotip" title="<?php echo $lang->get('group_pw_duration').' '.$lang->get('group_pw_duration_tip'); ?>"></i></th> |
|
301 | 301 | <th scope="col" width="50px"><i class="fas fa-pen fa-lg infotip" title="<?php echo $lang->get('auth_creation_without_complexity'); ?>"></i></th> |
302 | 302 | <th scope="col" width="50px"><i class="fas fa-edit fa-lg infotip" title="<?php echo $lang->get('auth_modification_without_complexity'); ?>"></i></th> |
303 | 303 | <th scope="col" width="50px"><i class="fas fa-folder fa-lg infotip" title="<?php echo $lang->get('icon'); ?>"></i></th> |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('users') === false) { |
63 | 63 | // Not allowed page |
64 | 64 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
65 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
65 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
66 | 66 | exit; |
67 | 67 | } |
68 | 68 | |
@@ -85,24 +85,24 @@ discard block |
||
85 | 85 | // If administrator then all roles are shown |
86 | 86 | // else only the Roles the users is associated to. |
87 | 87 | if ((int) $session->get('user-admin') === 1) { |
88 | - $optionsManagedBy .= '<option value="0">' . $lang->get('administrators_only') . '</option>'; |
|
88 | + $optionsManagedBy .= '<option value="0">'.$lang->get('administrators_only').'</option>'; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | $rows = DB::query( |
92 | 92 | 'SELECT id, title, creator_id |
93 | - FROM ' . prefixTable('roles_title') . ' |
|
93 | + FROM ' . prefixTable('roles_title').' |
|
94 | 94 | ORDER BY title ASC' |
95 | 95 | ); |
96 | 96 | foreach ($rows as $record) { |
97 | 97 | if ((int) $session->get('user-admin') === 1 || in_array($record['id'], $session->get('user-roles_array')) === true) { |
98 | - $optionsManagedBy .= '<option value="' . $record['id'] . '">' . $lang->get('managers_of') . ' ' . addslashes($record['title']) . '</option>'; |
|
98 | + $optionsManagedBy .= '<option value="'.$record['id'].'">'.$lang->get('managers_of').' '.addslashes($record['title']).'</option>'; |
|
99 | 99 | } |
100 | 100 | if ( |
101 | 101 | (int) $session->get('user-admin') === 1 |
102 | 102 | || (((int) $session->get('user-manager') === 1 || (int) $session->get('user-can_manage_all_users') === 1) |
103 | 103 | && (in_array($record['id'], $userRoles) === true) || (int) $record['creator_id'] === (int) $session->get('user-id')) |
104 | 104 | ) { |
105 | - $optionsRoles .= '<option value="' . $record['id'] . '">' . addslashes($record['title']) . '</option>'; |
|
105 | + $optionsRoles .= '<option value="'.$record['id'].'">'.addslashes($record['title']).'</option>'; |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | for ($y = 1; $y < $t->nlevel; ++$y) { |
118 | 118 | $ident .= ' '; |
119 | 119 | } |
120 | - $foldersList .= '<option value="' . $t->id . '">' . $ident . htmlspecialchars($t->title, ENT_COMPAT, 'UTF-8') . '</option>'; |
|
120 | + $foldersList .= '<option value="'.$t->id.'">'.$ident.htmlspecialchars($t->title, ENT_COMPAT, 'UTF-8').'</option>'; |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | </button><?php |
155 | 155 | echo isset($SETTINGS['ldap_mode']) === true && (int) $SETTINGS['ldap_mode'] === 1 && (int) $session->get('user-admin') === 1 ? |
156 | 156 | '<button type="button" class="btn btn-primary btn-sm tp-action mr-2" data-action="ldap-sync"> |
157 | - <i class="fa-solid fa-address-card mr-2"></i>' . $lang->get('ldap_synchronization') . ' |
|
157 | + <i class="fa-solid fa-address-card mr-2"></i>' . $lang->get('ldap_synchronization').' |
|
158 | 158 | </button>' : ''; |
159 | 159 | ?> |
160 | 160 | </h3> |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | <?php |
227 | 227 | foreach (TP_PW_COMPLEXITY as $entry) { |
228 | 228 | echo ' |
229 | - <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>'; |
|
229 | + <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>'; |
|
230 | 230 | } |
231 | 231 | ?> |
232 | 232 | </select> |