@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ) { |
78 | 78 | // Not allowed page |
79 | 79 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
80 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
80 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
81 | 81 | exit; |
82 | 82 | } |
83 | 83 | |
@@ -138,14 +138,14 @@ discard block |
||
138 | 138 | // Prepare variables |
139 | 139 | $post_key = filter_var($dataReceived['encryptionKey'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
140 | 140 | |
141 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
141 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
142 | 142 | |
143 | 143 | // get a token |
144 | 144 | $token = GenerateCryptKey(20, false, true, true, false, true); |
145 | 145 | |
146 | 146 | //save file |
147 | - $filename = time() . '-' . $token . '.sql'; |
|
148 | - $filepath = $SETTINGS['path_to_files_folder'] . '/' . $filename; |
|
147 | + $filename = time().'-'.$token.'.sql'; |
|
148 | + $filepath = $SETTINGS['path_to_files_folder'].'/'.$filename; |
|
149 | 149 | $handle = fopen($filepath, 'w+'); |
150 | 150 | |
151 | 151 | if ($handle === false) { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $tables = array(); |
164 | 164 | $result = DB::query('SHOW TABLES'); |
165 | 165 | foreach ($result as $row) { |
166 | - $tables[] = $row['Tables_in_' . DB_NAME]; |
|
166 | + $tables[] = $row['Tables_in_'.DB_NAME]; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | $backupSuccess = true; |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | if (empty($pre) || substr_count($table, $pre) > 0) { |
174 | 174 | $table = safeString($table); |
175 | 175 | // Write table drop and creation |
176 | - fwrite($handle, 'DROP TABLE IF EXISTS ' . $table . ";\n"); |
|
177 | - $row2 = DB::queryFirstRow('SHOW CREATE TABLE ' . $table); |
|
178 | - fwrite($handle, safeString($row2['Create Table']) . ";\n\n"); |
|
176 | + fwrite($handle, 'DROP TABLE IF EXISTS '.$table.";\n"); |
|
177 | + $row2 = DB::queryFirstRow('SHOW CREATE TABLE '.$table); |
|
178 | + fwrite($handle, safeString($row2['Create Table']).";\n\n"); |
|
179 | 179 | |
180 | 180 | // Get field information |
181 | 181 | DB::query( |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | |
202 | 202 | foreach ($rows as $record) { |
203 | - $insertQuery = 'INSERT INTO ' . $table . ' VALUES('; |
|
203 | + $insertQuery = 'INSERT INTO '.$table.' VALUES('; |
|
204 | 204 | $values = array(); |
205 | 205 | |
206 | 206 | foreach ($record as $value) { |
@@ -208,11 +208,11 @@ discard block |
||
208 | 208 | if ($value === null) { |
209 | 209 | $values[] = 'NULL'; |
210 | 210 | } else { |
211 | - $values[] = '"' . addslashes(preg_replace("/\n/", '\\n', $value)) . '"'; |
|
211 | + $values[] = '"'.addslashes(preg_replace("/\n/", '\\n', $value)).'"'; |
|
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
215 | - $insertQuery .= implode(',', $values) . ");\n"; |
|
215 | + $insertQuery .= implode(',', $values).");\n"; |
|
216 | 216 | fwrite($handle, $insertQuery); |
217 | 217 | |
218 | 218 | // Flush buffer periodically to free memory |
@@ -242,14 +242,14 @@ discard block |
||
242 | 242 | prepareFileWithDefuse( |
243 | 243 | 'encrypt', |
244 | 244 | $filepath, |
245 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename, |
|
245 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename, |
|
246 | 246 | $post_key |
247 | 247 | ); |
248 | 248 | |
249 | 249 | // Do clean |
250 | 250 | unlink($filepath); |
251 | 251 | rename( |
252 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename, |
|
252 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename, |
|
253 | 253 | $filepath |
254 | 254 | ); |
255 | 255 | } |
@@ -270,9 +270,9 @@ discard block |
||
270 | 270 | array( |
271 | 271 | 'error' => false, |
272 | 272 | 'message' => '', |
273 | - 'download' => 'sources/downloadFile.php?name=' . urlencode($filename) . |
|
274 | - '&sub=files&file=' . $filename . '&type=sql&key=' . $session->get('key') . '&key_tmp=' . |
|
275 | - $session->get('user-key_tmp') . '&pathIsFiles=1', |
|
273 | + 'download' => 'sources/downloadFile.php?name='.urlencode($filename). |
|
274 | + '&sub=files&file='.$filename.'&type=sql&key='.$session->get('key').'&key_tmp='. |
|
275 | + $session->get('user-key_tmp').'&pathIsFiles=1', |
|
276 | 276 | ), |
277 | 277 | 'encode' |
278 | 278 | ); |
@@ -333,13 +333,13 @@ discard block |
||
333 | 333 | error_log('DEBUG: Offset -> '.$post_offset.'/'.$post_totalSize.' | File -> '.$post_clearFilename.' | key -> '.$post_key); |
334 | 334 | } |
335 | 335 | |
336 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
336 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
337 | 337 | |
338 | 338 | if (empty($post_clearFilename) === true) { |
339 | 339 | // Get filename from database |
340 | 340 | $data = DB::queryFirstRow( |
341 | 341 | 'SELECT valeur |
342 | - FROM ' . prefixTable('misc') . ' |
|
342 | + FROM ' . prefixTable('misc').' |
|
343 | 343 | WHERE increment_id = %i', |
344 | 344 | $post_backupFile |
345 | 345 | ); |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | $post_backupFile = safeString($data['valeur']); |
367 | 367 | |
368 | 368 | // Verify file exists |
369 | - if (!file_exists($SETTINGS['path_to_files_folder'] . '/' . $post_backupFile)) { |
|
369 | + if (!file_exists($SETTINGS['path_to_files_folder'].'/'.$post_backupFile)) { |
|
370 | 370 | echo prepareExchangedData( |
371 | 371 | array( |
372 | 372 | 'error' => true, |
@@ -383,8 +383,8 @@ discard block |
||
383 | 383 | // Decrypt the file |
384 | 384 | $ret = prepareFileWithDefuse( |
385 | 385 | 'decrypt', |
386 | - $SETTINGS['path_to_files_folder'] . '/' . $post_backupFile, |
|
387 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $post_backupFile, |
|
386 | + $SETTINGS['path_to_files_folder'].'/'.$post_backupFile, |
|
387 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$post_backupFile, |
|
388 | 388 | $post_key |
389 | 389 | ); |
390 | 390 | |
@@ -401,8 +401,8 @@ discard block |
||
401 | 401 | } |
402 | 402 | |
403 | 403 | // Do clean |
404 | - fileDelete($SETTINGS['path_to_files_folder'] . '/' . $post_backupFile, $SETTINGS); |
|
405 | - $post_backupFile = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $post_backupFile; |
|
404 | + fileDelete($SETTINGS['path_to_files_folder'].'/'.$post_backupFile, $SETTINGS); |
|
405 | + $post_backupFile = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$post_backupFile; |
|
406 | 406 | } else { |
407 | 407 | echo prepareExchangedData( |
408 | 408 | array( |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | DB::query($query); |
485 | 485 | $executedQueries++; |
486 | 486 | } catch (Exception $e) { |
487 | - $errors[] = "Error executing query: " . $e->getMessage() . " - Query: " . substr($query, 0, 100) . "..."; |
|
487 | + $errors[] = "Error executing query: ".$e->getMessage()." - Query: ".substr($query, 0, 100)."..."; |
|
488 | 488 | } |
489 | 489 | $query = ''; |
490 | 490 | } |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | } catch (Exception $e) { |
501 | 501 | // Rollback transaction on any exception |
502 | 502 | DB::rollback(); |
503 | - $errors[] = "Transaction failed: " . $e->getMessage(); |
|
503 | + $errors[] = "Transaction failed: ".$e->getMessage(); |
|
504 | 504 | } |
505 | 505 | |
506 | 506 | // Calculate the new offset |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | echo prepareExchangedData( |
516 | 516 | array( |
517 | 517 | 'error' => true, |
518 | - 'message' => 'Errors occurred during import: ' . implode('; ', $errors), |
|
518 | + 'message' => 'Errors occurred during import: '.implode('; ', $errors), |
|
519 | 519 | 'newOffset' => $newOffset, |
520 | 520 | 'totalSize' => $post_totalSize, |
521 | 521 | 'clearFilename' => $post_backupFile, |
@@ -137,14 +137,14 @@ discard block |
||
137 | 137 | && $t->personal_folder == 0 |
138 | 138 | ) { |
139 | 139 | // get $t->parent_id |
140 | - $data = DB::queryFirstRow('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', $t->parent_id); |
|
140 | + $data = DB::queryFirstRow('SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', $t->parent_id); |
|
141 | 141 | if ($t->nlevel == 1) { |
142 | 142 | $data['title'] = $lang->get('root'); |
143 | 143 | } |
144 | 144 | |
145 | 145 | // get rights on this folder |
146 | 146 | $arrayRights = array(); |
147 | - $rows = DB::query('SELECT fonction_id FROM ' . prefixTable('rights') . ' WHERE authorized=%i AND tree_id = %i', 1, $t->id); |
|
147 | + $rows = DB::query('SELECT fonction_id FROM '.prefixTable('rights').' WHERE authorized=%i AND tree_id = %i', 1, $t->id); |
|
148 | 148 | foreach ($rows as $record) { |
149 | 149 | array_push($arrayRights, $record['fonction_id']); |
150 | 150 | } |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | 'SELECT m.valeur AS valeur, n.renewal_period AS renewal_period, |
163 | 163 | n.bloquer_creation AS bloquer_creation, n.bloquer_modification AS bloquer_modification, |
164 | 164 | n.fa_icon AS fa_icon, n.fa_icon_selected AS fa_icon_selected |
165 | - FROM ' . prefixTable('misc') . ' AS m, |
|
166 | - ' . prefixTable('nested_tree') . ' AS n |
|
165 | + FROM ' . prefixTable('misc').' AS m, |
|
166 | + ' . prefixTable('nested_tree').' AS n |
|
167 | 167 | WHERE m.type=%s AND m.intitule = n.id AND m.intitule = %i', |
168 | 168 | 'complex', |
169 | 169 | $t->id |
@@ -191,16 +191,16 @@ discard block |
||
191 | 191 | $arrayColumns['folderComplexity'] = ''; |
192 | 192 | } |
193 | 193 | |
194 | - if (is_null($node_data)=== false) { |
|
194 | + if (is_null($node_data) === false) { |
|
195 | 195 | $arrayColumns['renewalPeriod'] = (int) $node_data['renewal_period']; |
196 | 196 | } else { |
197 | - $arrayColumns['renewalPeriod']=0; |
|
197 | + $arrayColumns['renewalPeriod'] = 0; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | //col7 |
201 | 201 | $data7 = DB::queryFirstRow( |
202 | 202 | 'SELECT bloquer_creation,bloquer_modification |
203 | - FROM ' . prefixTable('nested_tree') . ' |
|
203 | + FROM ' . prefixTable('nested_tree').' |
|
204 | 204 | WHERE id = %i', |
205 | 205 | intval($t->id) |
206 | 206 | ); |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | // Get info about this folder |
359 | 359 | $dataFolder = DB::queryFirstRow( |
360 | 360 | 'SELECT * |
361 | - FROM ' . prefixTable('nested_tree') . ' |
|
361 | + FROM ' . prefixTable('nested_tree').' |
|
362 | 362 | WHERE id = %i', |
363 | 363 | $inputData['id'] |
364 | 364 | ); |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | //check if parent folder is personal |
395 | 395 | $dataParent = DB::queryFirstRow( |
396 | 396 | 'SELECT personal_folder, bloquer_creation, bloquer_modification |
397 | - FROM ' . prefixTable('nested_tree') . ' |
|
397 | + FROM ' . prefixTable('nested_tree').' |
|
398 | 398 | WHERE id = %i', |
399 | 399 | $inputData['parentId'] |
400 | 400 | ); |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | // get complexity level for this folder |
424 | 424 | $data = DB::queryFirstRow( |
425 | 425 | 'SELECT valeur |
426 | - FROM ' . prefixTable('misc') . ' |
|
426 | + FROM ' . prefixTable('misc').' |
|
427 | 427 | WHERE intitule = %i AND type = %s', |
428 | 428 | $inputData['parentId'], |
429 | 429 | 'complex' |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | array( |
435 | 435 | 'error' => true, |
436 | 436 | 'message' => $lang->get('error_folder_complexity_lower_than_top_folder') |
437 | - . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]', |
|
437 | + . ' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]', |
|
438 | 438 | ), |
439 | 439 | 'encode' |
440 | 440 | ); |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | // Check if parent folder is personal |
595 | 595 | $dataParent = DB::queryFirstRow( |
596 | 596 | 'SELECT personal_folder |
597 | - FROM ' . prefixTable('nested_tree') . ' |
|
597 | + FROM ' . prefixTable('nested_tree').' |
|
598 | 598 | WHERE id = %i', |
599 | 599 | $inputData['parentId'] |
600 | 600 | ); |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | echo prepareExchangedData( |
635 | 635 | array( |
636 | 636 | 'error' => $creationStatus['error'], |
637 | - 'message' => $creationStatus['error'] === true ? $lang->get('error_not_allowed_to') : $lang->get('folder_created') , |
|
637 | + 'message' => $creationStatus['error'] === true ? $lang->get('error_not_allowed_to') : $lang->get('folder_created'), |
|
638 | 638 | 'newId' => $creationStatus['newId'], |
639 | 639 | ), |
640 | 640 | 'encode' |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | echo prepareExchangedData( |
683 | 683 | array( |
684 | 684 | 'error' => true, |
685 | - 'message' => $lang->get('error_not_allowed_to'). " (You can't delete the root folder)", |
|
685 | + 'message' => $lang->get('error_not_allowed_to')." (You can't delete the root folder)", |
|
686 | 686 | ), |
687 | 687 | 'encode' |
688 | 688 | ); |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | // Ensure that user has access to all folders |
693 | 693 | $foldersAccessible = DB::query( |
694 | 694 | 'SELECT id |
695 | - FROM ' . prefixTable('nested_tree') . ' |
|
695 | + FROM ' . prefixTable('nested_tree').' |
|
696 | 696 | WHERE id IN %li AND id IN %li', |
697 | 697 | $post_folders, |
698 | 698 | $session->get('user-accessible_folders') |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | echo prepareExchangedData( |
707 | 707 | array( |
708 | 708 | 'error' => true, |
709 | - 'message' => $lang->get('error_not_allowed_to') . ' (The following folders are not accessible or do not exist: ' . implode(', ', $missingFolders) . ')', |
|
709 | + 'message' => $lang->get('error_not_allowed_to').' (The following folders are not accessible or do not exist: '.implode(', ', $missingFolders).')', |
|
710 | 710 | ), |
711 | 711 | 'encode' |
712 | 712 | ); |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | // Check if parent folder is personal |
724 | 724 | $dataParent = DB::queryFirstRow( |
725 | 725 | 'SELECT personal_folder |
726 | - FROM ' . prefixTable('nested_tree') . ' |
|
726 | + FROM ' . prefixTable('nested_tree').' |
|
727 | 727 | WHERE id = %i', |
728 | 728 | $folderId |
729 | 729 | ); |
@@ -769,10 +769,10 @@ discard block |
||
769 | 769 | prefixTable('misc'), |
770 | 770 | array( |
771 | 771 | 'type' => 'folder_deleted', |
772 | - 'intitule' => 'f' . $thisSubFolders->id, |
|
773 | - 'valeur' => $thisSubFolders->id . ', ' . $thisSubFolders->parent_id . ', ' . |
|
774 | - $thisSubFolders->title . ', ' . $thisSubFolders->nleft . ', ' . $thisSubFolders->nright . ', ' . |
|
775 | - $thisSubFolders->nlevel . ', 0, 0, 0, 0', |
|
772 | + 'intitule' => 'f'.$thisSubFolders->id, |
|
773 | + 'valeur' => $thisSubFolders->id.', '.$thisSubFolders->parent_id.', '. |
|
774 | + $thisSubFolders->title.', '.$thisSubFolders->nleft.', '.$thisSubFolders->nright.', '. |
|
775 | + $thisSubFolders->nlevel.', 0, 0, 0, 0', |
|
776 | 776 | 'created_at' => time(), |
777 | 777 | ) |
778 | 778 | ); |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | |
782 | 782 | //delete items & logs |
783 | 783 | $itemsInSubFolder = DB::query( |
784 | - 'SELECT id FROM ' . prefixTable('items') . ' |
|
784 | + 'SELECT id FROM '.prefixTable('items').' |
|
785 | 785 | WHERE id_tree=%i', |
786 | 786 | $thisSubFolders->id |
787 | 787 | ); |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | } |
812 | 812 | |
813 | 813 | //Update CACHE table |
814 | - updateCacheTable('delete_value',(int) $item['id']); |
|
814 | + updateCacheTable('delete_value', (int) $item['id']); |
|
815 | 815 | } |
816 | 816 | |
817 | 817 | //Actualize the variable |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | // Check if target parent folder is personal |
922 | 922 | $dataParent = DB::queryFirstRow( |
923 | 923 | 'SELECT personal_folder |
924 | - FROM ' . prefixTable('nested_tree') . ' |
|
924 | + FROM ' . prefixTable('nested_tree').' |
|
925 | 925 | WHERE id = %i', |
926 | 926 | $post_target_folder_id |
927 | 927 | ); |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | // get complexity of current node |
976 | 976 | $nodeComplexity = DB::queryFirstRow( |
977 | 977 | 'SELECT valeur |
978 | - FROM ' . prefixTable('misc') . ' |
|
978 | + FROM ' . prefixTable('misc').' |
|
979 | 979 | WHERE intitule = %i AND type= %s', |
980 | 980 | $nodeInfo->id, |
981 | 981 | 'complex' |
@@ -1052,7 +1052,7 @@ discard block |
||
1052 | 1052 | // If it is a subfolder, then give access to it for all roles that allows the parent folder |
1053 | 1053 | $rows = DB::query( |
1054 | 1054 | 'SELECT role_id, type |
1055 | - FROM ' . prefixTable('roles_values') . ' |
|
1055 | + FROM ' . prefixTable('roles_values').' |
|
1056 | 1056 | WHERE folder_id = %i', |
1057 | 1057 | $parentId |
1058 | 1058 | ); |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | // if parent folder has Custom Fields Categories then add to this child one too |
1072 | 1072 | $rows = DB::query( |
1073 | 1073 | 'SELECT id_category |
1074 | - FROM ' . prefixTable('categories_folders') . ' |
|
1074 | + FROM ' . prefixTable('categories_folders').' |
|
1075 | 1075 | WHERE id_folder = %i', |
1076 | 1076 | $nodeInfo->id |
1077 | 1077 | ); |
@@ -1090,7 +1090,7 @@ discard block |
||
1090 | 1090 | |
1091 | 1091 | $rows = DB::query( |
1092 | 1092 | 'SELECT * |
1093 | - FROM ' . prefixTable('items') . ' |
|
1093 | + FROM ' . prefixTable('items').' |
|
1094 | 1094 | WHERE id_tree = %i', |
1095 | 1095 | $nodeInfo->id |
1096 | 1096 | ); |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | // if it is then don't copy it |
1100 | 1100 | $item_deleted = DB::queryFirstRow( |
1101 | 1101 | 'SELECT * |
1102 | - FROM ' . prefixTable('log_items') . ' |
|
1102 | + FROM ' . prefixTable('log_items').' |
|
1103 | 1103 | WHERE id_item = %i AND action = %s |
1104 | 1104 | ORDER BY date DESC |
1105 | 1105 | LIMIT 0, 1', |
@@ -1110,7 +1110,7 @@ discard block |
||
1110 | 1110 | |
1111 | 1111 | $item_restored = DB::queryFirstRow( |
1112 | 1112 | 'SELECT * |
1113 | - FROM ' . prefixTable('log_items') . ' |
|
1113 | + FROM ' . prefixTable('log_items').' |
|
1114 | 1114 | WHERE id_item = %i AND action = %s |
1115 | 1115 | ORDER BY date DESC |
1116 | 1116 | LIMIT 0, 1', |
@@ -1125,7 +1125,7 @@ discard block |
||
1125 | 1125 | // Get the ITEM object key for the user |
1126 | 1126 | $userKey = DB::queryFirstRow( |
1127 | 1127 | 'SELECT share_key |
1128 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
1128 | + FROM ' . prefixTable('sharekeys_items').' |
|
1129 | 1129 | WHERE user_id = %i AND object_id = %i', |
1130 | 1130 | $session->get('user-id'), |
1131 | 1131 | $record['id'] |
@@ -1287,7 +1287,7 @@ discard block |
||
1287 | 1287 | // Get path |
1288 | 1288 | $text = ''; |
1289 | 1289 | foreach ($tree->getPath($folder->id, false) as $fld) { |
1290 | - $text .= empty($text) === true ? ' [<i>' . $fld->title : ' > ' . $fld->title; |
|
1290 | + $text .= empty($text) === true ? ' [<i>'.$fld->title : ' > '.$fld->title; |
|
1291 | 1291 | } |
1292 | 1292 | |
1293 | 1293 | // Save array |
@@ -1297,7 +1297,7 @@ discard block |
||
1297 | 1297 | 'id' => (int) $folder->id, |
1298 | 1298 | 'label' => $folder->title, |
1299 | 1299 | 'level' => $folder->nlevel, |
1300 | - 'path' => empty($text) === true ? '' : $text . '</i>]' |
|
1300 | + 'path' => empty($text) === true ? '' : $text.'</i>]' |
|
1301 | 1301 | ) |
1302 | 1302 | ); |
1303 | 1303 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('users') === 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 | ?> |
@@ -325,8 +325,8 @@ discard block |
||
325 | 325 | if (store.get('teampassApplication').formUserAction === "add_new_user") { |
326 | 326 | var data = { |
327 | 327 | 'receipt': $('#form-email').val(), |
328 | - 'subject': 'TEAMPASS - <?php echo $lang->get('temporary_encryption_code');?>', |
|
329 | - 'body': '<?php echo $lang->get('email_body_new_user');?>', |
|
328 | + 'subject': 'TEAMPASS - <?php echo $lang->get('temporary_encryption_code'); ?>', |
|
329 | + 'body': '<?php echo $lang->get('email_body_new_user'); ?>', |
|
330 | 330 | 'pre_replace' : { |
331 | 331 | '#code#' : store.get('teampassUser').admin_new_user_temporary_encryption_code, |
332 | 332 | '#login#' : store.get('teampassUser').admin_new_user_login, |
@@ -336,8 +336,8 @@ discard block |
||
336 | 336 | } else { |
337 | 337 | var data = { |
338 | 338 | 'receipt': $('#form-email').val(), |
339 | - 'subject': 'TEAMPASS - <?php echo $lang->get('temporary_encryption_code');?>', |
|
340 | - 'body': '<?php echo $lang->get('email_body_temporary_encryption_code');?>', |
|
339 | + 'subject': 'TEAMPASS - <?php echo $lang->get('temporary_encryption_code'); ?>', |
|
340 | + 'body': '<?php echo $lang->get('email_body_temporary_encryption_code'); ?>', |
|
341 | 341 | 'pre_replace' : { |
342 | 342 | '#enc_code#' : store.get('teampassUser').admin_new_user_temporary_encryption_code, |
343 | 343 | } |
@@ -532,14 +532,14 @@ discard block |
||
532 | 532 | } |
533 | 533 | // Inform user |
534 | 534 | $("#warningModalBody").html('<b><?php echo $lang->get('encryption_keys'); ?> - ' + |
535 | - stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + ']<span id="warningModalBody_extra">' + $nbItemsToConvert + '</span> ' + |
|
535 | + stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + ']<span id="warningModalBody_extra">' + $nbItemsToConvert + '</span> ' + |
|
536 | 536 | '... <?php echo $lang->get('please_wait'); ?><i class="fa-solid fa-spinner fa-pulse ml-3 text-primary"></i>'); |
537 | 537 | |
538 | 538 | // If expected, show the OPT to the admin |
539 | 539 | if (constVisibleOTP === true) { |
540 | 540 | toastr.info( |
541 | - '<?php echo $lang->get('show_encryption_code_to_admin');?> <div><input class="form-control form-item-control flex-nowrap" value="' + userTemporaryCode + '" readonly></div>' |
|
542 | - + '<br /><button type="button" class="btn clear"><?php echo $lang->get('close');?></button>', |
|
541 | + '<?php echo $lang->get('show_encryption_code_to_admin'); ?> <div><input class="form-control form-item-control flex-nowrap" value="' + userTemporaryCode + '" readonly></div>' |
|
542 | + + '<br /><button type="button" class="btn clear"><?php echo $lang->get('close'); ?></button>', |
|
543 | 543 | '<?php echo $lang->get('information'); ?>', |
544 | 544 | { |
545 | 545 | extendedTimeOut: 0, |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | var data = { |
559 | 559 | action: step, |
560 | 560 | start: start, |
561 | - length: <?php echo NUMBER_ITEMS_IN_BATCH;?>, |
|
561 | + length: <?php echo NUMBER_ITEMS_IN_BATCH; ?>, |
|
562 | 562 | user_id: userId, |
563 | 563 | } |
564 | 564 | if (debugJavascript === true) { |
@@ -1395,7 +1395,7 @@ discard block |
||
1395 | 1395 | } else { |
1396 | 1396 | // Show icon or not |
1397 | 1397 | if ($('#user-disabled').prop('checked') === true) { |
1398 | - $('#user-login-'+userID).before('<i class="fa-solid fa-user-slash infotip text-danger mr-2" title="<?php echo $lang->get('account_is_locked');?>" id="user-disable-'+userID+'"></i>'); |
|
1398 | + $('#user-login-'+userID).before('<i class="fa-solid fa-user-slash infotip text-danger mr-2" title="<?php echo $lang->get('account_is_locked'); ?>" id="user-disable-'+userID+'"></i>'); |
|
1399 | 1399 | } else { |
1400 | 1400 | $('#user-disable-'+userID).remove(); |
1401 | 1401 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('users') === 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 | |
@@ -92,24 +92,24 @@ discard block |
||
92 | 92 | // If administrator then all roles are shown |
93 | 93 | // else only the Roles the users is associated to. |
94 | 94 | if ((int) $session->get('user-admin') === 1) { |
95 | - $optionsManagedBy .= '<option value="0">' . $lang->get('administrators_only') . '</option>'; |
|
95 | + $optionsManagedBy .= '<option value="0">'.$lang->get('administrators_only').'</option>'; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | $rows = DB::query( |
99 | 99 | 'SELECT id, title, creator_id |
100 | - FROM ' . prefixTable('roles_title') . ' |
|
100 | + FROM ' . prefixTable('roles_title').' |
|
101 | 101 | ORDER BY title ASC' |
102 | 102 | ); |
103 | 103 | foreach ($rows as $record) { |
104 | 104 | if ((int) $session->get('user-admin') === 1 || in_array($record['id'], $session->get('user-roles_array')) === true) { |
105 | - $optionsManagedBy .= '<option value="' . $record['id'] . '">' . $lang->get('managers_of') . ' ' . addslashes($record['title']) . '</option>'; |
|
105 | + $optionsManagedBy .= '<option value="'.$record['id'].'">'.$lang->get('managers_of').' '.addslashes($record['title']).'</option>'; |
|
106 | 106 | } |
107 | 107 | if ( |
108 | 108 | (int) $session->get('user-admin') === 1 |
109 | 109 | || (((int) $session->get('user-manager') === 1 || (int) $session->get('user-can_manage_all_users') === 1) |
110 | 110 | && (in_array($record['id'], $userRoles) === true) || (int) $record['creator_id'] === (int) $session->get('user-id')) |
111 | 111 | ) { |
112 | - $optionsRoles .= '<option value="' . $record['id'] . '">' . addslashes($record['title']) . '</option>'; |
|
112 | + $optionsRoles .= '<option value="'.$record['id'].'">'.addslashes($record['title']).'</option>'; |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | for ($y = 1; $y < $t->nlevel; ++$y) { |
125 | 125 | $ident .= ' '; |
126 | 126 | } |
127 | - $foldersList .= '<option value="' . $t->id . '">' . $ident . htmlspecialchars($t->title, ENT_COMPAT, 'UTF-8') . '</option>'; |
|
127 | + $foldersList .= '<option value="'.$t->id.'">'.$ident.htmlspecialchars($t->title, ENT_COMPAT, 'UTF-8').'</option>'; |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
@@ -161,13 +161,13 @@ discard block |
||
161 | 161 | </button><?php |
162 | 162 | echo isset($SETTINGS['ldap_mode']) === true && (int) $SETTINGS['ldap_mode'] === 1 && (int) $session->get('user-admin') === 1 ? |
163 | 163 | '<button type="button" class="btn btn-primary btn-sm tp-action mr-2" data-action="ldap-sync"> |
164 | - <i class="fa-solid fa-address-card mr-2"></i>' . $lang->get('ldap_synchronization') . ' |
|
164 | + <i class="fa-solid fa-address-card mr-2"></i>' . $lang->get('ldap_synchronization').' |
|
165 | 165 | </button>' : ''; |
166 | 166 | ?> |
167 | 167 | </button><?php |
168 | 168 | echo isset($SETTINGS['oauth2_enabled']) === true && (int) $SETTINGS['oauth2_enabled'] === 1 && (int) $session->get('user-admin') === 1 ? |
169 | 169 | '<button type="button" class="btn btn-primary btn-sm tp-action mr-2" data-action="oauth2-sync"> |
170 | - <i class="fa-solid fa-plug mr-2"></i>' . $lang->get('oauth2_synchronization') . ' |
|
170 | + <i class="fa-solid fa-plug mr-2"></i>' . $lang->get('oauth2_synchronization').' |
|
171 | 171 | </button>' : ''; |
172 | 172 | ?> |
173 | 173 | </h3> |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | |
176 | 176 | <!-- /.card-header --> |
177 | 177 | <div class="card-body form" id="users-list"> |
178 | - <label><input type="checkbox" id="warnings_display" class="tp-action pointer" data-action="refresh"><span class="ml-2 pointer"><?php echo $lang->get('display_warning_icons');?></span></label> |
|
178 | + <label><input type="checkbox" id="warnings_display" class="tp-action pointer" data-action="refresh"><span class="ml-2 pointer"><?php echo $lang->get('display_warning_icons'); ?></span></label> |
|
179 | 179 | <table id="table-users" class="table table-striped nowrap table-responsive-sm"> |
180 | 180 | <thead> |
181 | 181 | <tr> |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | <?php |
240 | 240 | foreach (TP_PW_COMPLEXITY as $entry) { |
241 | 241 | echo ' |
242 | - <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>'; |
|
242 | + <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>'; |
|
243 | 243 | } |
244 | 244 | ?> |
245 | 245 | </select> |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | <?php |
317 | 317 | foreach (TP_PW_COMPLEXITY as $entry) { |
318 | 318 | echo ' |
319 | - <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>'; |
|
319 | + <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>'; |
|
320 | 320 | } |
321 | 321 | ?> |
322 | 322 | </select> |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ) { |
78 | 78 | // Not allowed page |
79 | 79 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
80 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
80 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
81 | 81 | exit; |
82 | 82 | } |
83 | 83 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | if (isset($order['column']) && preg_match('#^(asc|desc)$#i', $order['dir'])) { |
129 | 129 | $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT); |
130 | 130 | $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
131 | - $sOrder .= $aColumns[$columnIndex] . ' ' . $dir . ', '; |
|
131 | + $sOrder .= $aColumns[$columnIndex].' '.$dir.', '; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | $sOrder = substr_replace($sOrder, '', -2); |
@@ -152,15 +152,15 @@ discard block |
||
152 | 152 | |
153 | 153 | if ($letter !== '' && $letter !== 'None') { |
154 | 154 | $sWhere .= ' AND ('; |
155 | - $sWhere .= $aColumns[1] . " LIKE '" . $letter . "%' OR "; |
|
156 | - $sWhere .= $aColumns[2] . " LIKE '" . $letter . "%' OR "; |
|
157 | - $sWhere .= $aColumns[3] . " LIKE '" . $letter . "%' "; |
|
155 | + $sWhere .= $aColumns[1]." LIKE '".$letter."%' OR "; |
|
156 | + $sWhere .= $aColumns[2]." LIKE '".$letter."%' OR "; |
|
157 | + $sWhere .= $aColumns[3]." LIKE '".$letter."%' "; |
|
158 | 158 | $sWhere .= ')'; |
159 | 159 | } elseif ($searchValue !== '') { |
160 | 160 | $sWhere .= ' AND ('; |
161 | - $sWhere .= $aColumns[1] . " LIKE '" . $searchValue . "%' OR "; |
|
162 | - $sWhere .= $aColumns[2] . " LIKE '" . $searchValue . "%' OR "; |
|
163 | - $sWhere .= $aColumns[3] . " LIKE '" . $searchValue . "%' "; |
|
161 | + $sWhere .= $aColumns[1]." LIKE '".$searchValue."%' OR "; |
|
162 | + $sWhere .= $aColumns[2]." LIKE '".$searchValue."%' OR "; |
|
163 | + $sWhere .= $aColumns[3]." LIKE '".$searchValue."%' "; |
|
164 | 164 | $sWhere .= ')'; |
165 | 165 | } |
166 | 166 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | // Check for existing lock |
247 | 247 | $unlock_at = DB::queryFirstField( |
248 | 248 | 'SELECT MAX(unlock_at) |
249 | - FROM ' . prefixTable('auth_failures') . ' |
|
249 | + FROM ' . prefixTable('auth_failures').' |
|
250 | 250 | WHERE unlock_at > %s AND source = %s AND value = %s', |
251 | 251 | date('Y-m-d H:i:s', time()), |
252 | 252 | 'login', |
@@ -255,33 +255,31 @@ discard block |
||
255 | 255 | |
256 | 256 | // Get some infos about user |
257 | 257 | $userDisplayInfos = |
258 | - (isset($userDate['date']) ? '<i class=\"fas fa-calendar-day infotip text-info ml-2\" title=\"'.$lang->get('creation_date').': '.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $userDate['date']).'\"></i>' : '') |
|
258 | + (isset($userDate['date']) ? '<i class=\"fas fa-calendar-day infotip text-info ml-2\" title=\"'.$lang->get('creation_date').': '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $userDate['date']).'\"></i>' : '') |
|
259 | 259 | . |
260 | 260 | ((int) $record['last_connexion'] > 0 ? '<i class=\"far fa-clock infotip text-info ml-2\" title=\"'.$lang->get('index_last_seen').": ". |
261 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['last_connexion']).'\"></i>' : '') |
|
261 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['last_connexion']).'\"></i>' : '') |
|
262 | 262 | . |
263 | 263 | ((int) $record['user_ip'] > 0 ? '<i class=\"fas fa-street-view infotip text-info ml-1\" title=\"'.$lang->get('ip').": ".($record['user_ip']).'\"></i>' : '') |
264 | 264 | . |
265 | 265 | (($record['auth_type'] === 'ldap' || $record['auth_type'] === 'oauth2') ? '<i class=\"far fa-address-book infotip text-warning ml-1\" title=\"'.$lang->get('managed_through_ad').'\"></i>' : '') |
266 | 266 | . |
267 | 267 | ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['admin'] !== 1 && ((int) $SETTINGS['duo'] === 1 || (int) $SETTINGS['google_authentication'] === 1)) ? |
268 | - ((int) $record['mfa_enabled'] === 1 ? '' : '<i class=\"fa-solid fa-fingerprint infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('mfa_disabled_for_user').'\"></i>') : |
|
269 | - '' |
|
268 | + ((int) $record['mfa_enabled'] === 1 ? '' : '<i class=\"fa-solid fa-fingerprint infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('mfa_disabled_for_user').'\"></i>') : '' |
|
270 | 269 | ) |
271 | 270 | . |
272 | 271 | (($unlock_at) ? '<i class=\"fas fa-solid text-red fa-lock infotip text-info ml-1\" title=\"'.$lang->get('bruteforce_unlock_at').$unlock_at.'\"></i>' : ''); |
273 | 272 | if ($request->query->filter('display_warnings', '', FILTER_VALIDATE_BOOLEAN) === true) { |
274 | 273 | $userDisplayInfos .= '<br>'. |
275 | 274 | ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['admin'] !== 1 && is_null($record['keys_recovery_time']) === true) ? |
276 | - '<i class=\"fa-solid fa-download infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('recovery_keys_not_downloaded').'\"></i>' : |
|
277 | - '' |
|
275 | + '<i class=\"fa-solid fa-download infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('recovery_keys_not_downloaded').'\"></i>' : '' |
|
278 | 276 | ). |
279 | 277 | ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['pw_passwordlib'] === 1) ? '<i class=\"fa-solid fa-person-walking-luggage infotip ml-1\" style=\"color:Tomato\" title=\"Old password encryption. Shall login to initialize.\"></i>' : ''); |
280 | 278 | } |
281 | 279 | |
282 | 280 | $sOutput .= '["<span data-id=\"'.$record['id'].'\" data-fullname=\"'. |
283 | - (empty($record['name']) === false ? htmlentities($record['name'], ENT_QUOTES|ENT_SUBSTITUTE|ENT_DISALLOWED) : '').' '. |
|
284 | - (empty($record['lastname']) === false ? htmlentities($record['lastname'], ENT_QUOTES|ENT_SUBSTITUTE|ENT_DISALLOWED) : ''). |
|
281 | + (empty($record['name']) === false ? htmlentities($record['name'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED) : '').' '. |
|
282 | + (empty($record['lastname']) === false ? htmlentities($record['lastname'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED) : ''). |
|
285 | 283 | '\" data-auth-type=\"'.$record['auth_type'].'\" data-special=\"'.$record['special'].'\" data-mfa-enabled=\"'.$record['mfa_enabled'].'\" data-otp-provided=\"'.(isset($record['otp_provided']) === true ? $record['otp_provided'] : '').'\"></span>", '; |
286 | 284 | //col2 |
287 | 285 | $sOutput .= '"'. |
@@ -71,7 +71,7 @@ discard block |
||
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 | ?> |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | if (data[i].selected_role === 1) { |
227 | 227 | selected_role = data[i].id; |
228 | 228 | } |
229 | - html_admin_by += '<option value="' + data[i].id + '"><?php echo $lang->get('managers_of') . ' '; ?>' + data[i].title + '</option>'; |
|
229 | + html_admin_by += '<option value="' + data[i].id + '"><?php echo $lang->get('managers_of').' '; ?>' + data[i].title + '</option>'; |
|
230 | 230 | html_roles += '<option value="' + data[i].id + '">' + data[i].title + '</option>'; |
231 | 231 | } |
232 | 232 | $('#oauth_new_user_is_administrated_by') |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | }).fail(function(error) { |
256 | 256 | toastr.remove(); |
257 | 257 | toastr.error( |
258 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + error, |
|
258 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + error, |
|
259 | 259 | '', { |
260 | 260 | closeButton: true, |
261 | 261 | positionClass: 'toast-bottom-right' |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('admin') === false) { |
69 | 69 | // Not allowed page |
70 | 70 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
71 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
71 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
72 | 72 | exit; |
73 | 73 | } |
74 | 74 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | // error |
170 | 170 | toastr.remove(); |
171 | 171 | toastr.error( |
172 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
172 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
173 | 173 | '', { |
174 | 174 | closeButton: true, |
175 | 175 | positionClass: 'toast-bottom-right' |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | // error |
249 | 249 | toastr.remove(); |
250 | 250 | toastr.error( |
251 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
251 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
252 | 252 | '', { |
253 | 253 | closeButton: true, |
254 | 254 | positionClass: 'toast-bottom-right' |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | // error |
311 | 311 | toastr.remove(); |
312 | 312 | toastr.error( |
313 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
313 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
314 | 314 | '', { |
315 | 315 | closeButton: true, |
316 | 316 | positionClass: 'toast-bottom-right' |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | // error |
405 | 405 | toastr.remove(); |
406 | 406 | toastr.error( |
407 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
407 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
408 | 408 | '', { |
409 | 409 | closeButton: true, |
410 | 410 | positionClass: 'toast-bottom-right' |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | |
434 | 434 | //const className = result.success ? 'success' : 'error'; |
435 | 435 | const icon = result.success ? '<i class="fa-solid fa-check text-success mr-1"></i>' : '<i class="fa-solid fa-xmark text-danger mr-1"></i>'; |
436 | - const message = result.success ? '<?php echo $lang->get('server_returned_data');?>' : 'Error: ' + result.error; |
|
436 | + const message = result.success ? '<?php echo $lang->get('server_returned_data'); ?>' : 'Error: ' + result.error; |
|
437 | 437 | |
438 | 438 | output += '<li>' + icon + '<b>' + file + '</b><br/>' + message + '</li>'; |
439 | 439 | }); |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | // error |
465 | 465 | toastr.remove(); |
466 | 466 | toastr.error( |
467 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
467 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
468 | 468 | '', { |
469 | 469 | closeButton: true, |
470 | 470 | positionClass: 'toast-bottom-right' |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('items') === 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 | |
@@ -1056,7 +1056,7 @@ discard block |
||
1056 | 1056 | // |
1057 | 1057 | } else if ($(this).data('item-action') === 'link') { |
1058 | 1058 | // Add link to clipboard. |
1059 | - navigator.clipboard.writeText("<?php echo $SETTINGS['cpassman_url'];?>/index.php?page=items&group="+store.get('teampassItem').folderId+"&id="+store.get('teampassItem').id); |
|
1059 | + navigator.clipboard.writeText("<?php echo $SETTINGS['cpassman_url']; ?>/index.php?page=items&group="+store.get('teampassItem').folderId+"&id="+store.get('teampassItem').id); |
|
1060 | 1060 | |
1061 | 1061 | // Display message. |
1062 | 1062 | toastr.remove(); |
@@ -2698,7 +2698,7 @@ discard block |
||
2698 | 2698 | progress: "#form-item-password-strength", |
2699 | 2699 | score: "#form-item-password-strength" |
2700 | 2700 | }, |
2701 | - scores: [<?php echo TP_PW_STRENGTH_1;?>, <?php echo TP_PW_STRENGTH_2;?>, <?php echo TP_PW_STRENGTH_3;?>, <?php echo TP_PW_STRENGTH_4;?>, <?php echo TP_PW_STRENGTH_5;?>], |
|
2701 | + scores: [<?php echo TP_PW_STRENGTH_1; ?>, <?php echo TP_PW_STRENGTH_2; ?>, <?php echo TP_PW_STRENGTH_3; ?>, <?php echo TP_PW_STRENGTH_4; ?>, <?php echo TP_PW_STRENGTH_5; ?>], |
|
2702 | 2702 | }, |
2703 | 2703 | i18n : { |
2704 | 2704 | t: function (key) { |
@@ -2725,7 +2725,7 @@ discard block |
||
2725 | 2725 | <?php |
2726 | 2726 | $max_file_size = ''; |
2727 | 2727 | if (strrpos($SETTINGS['upload_maxfilesize'], 'mb') === false) { |
2728 | - $max_file_size = $SETTINGS['upload_maxfilesize'] . 'mb'; |
|
2728 | + $max_file_size = $SETTINGS['upload_maxfilesize'].'mb'; |
|
2729 | 2729 | } else { |
2730 | 2730 | $max_file_size = $SETTINGS['upload_maxfilesize']; |
2731 | 2731 | } |
@@ -4647,7 +4647,7 @@ discard block |
||
4647 | 4647 | (retData.edition_locked_delay === null ? |
4648 | 4648 | '' |
4649 | 4649 | : |
4650 | - ' : ' + retData.edition_locked_delay + ' <?php echo $lang->get('seconds');?>'), |
|
4650 | + ' : ' + retData.edition_locked_delay + ' <?php echo $lang->get('seconds'); ?>'), |
|
4651 | 4651 | '', { |
4652 | 4652 | timeOut: 5000, |
4653 | 4653 | progressBar: true |
@@ -4804,7 +4804,7 @@ discard block |
||
4804 | 4804 | |
4805 | 4805 | // Show passwords inputs and form |
4806 | 4806 | $('#dialog-ldap-user-change-password-info') |
4807 | - .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>') |
|
4807 | + .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>') |
|
4808 | 4808 | .removeClass('hidden'); |
4809 | 4809 | $('#dialog-ldap-user-change-password').removeClass('hidden'); |
4810 | 4810 | } else if (data.error_type !== 'undefined') { |
@@ -4823,7 +4823,7 @@ discard block |
||
4823 | 4823 | |
4824 | 4824 | // Show passwords inputs and form |
4825 | 4825 | $('#dialog-ldap-user-change-password-info') |
4826 | - .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>') |
|
4826 | + .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>') |
|
4827 | 4827 | .removeClass('hidden'); |
4828 | 4828 | $('#dialog-ldap-user-change-password').removeClass('hidden'); |
4829 | 4829 | }); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('options') === 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 | |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | // get list of all timezones |
323 | 323 | foreach ($zones as $key => $zone) { |
324 | 324 | echo ' |
325 | - <option value="' . $key . '"', isset($SETTINGS['timezone']) === true && (int) $SETTINGS['timezone'] === $key ? ' selected' : '', '>' . $zone . '</option>'; |
|
325 | + <option value="' . $key.'"', isset($SETTINGS['timezone']) === true && (int) $SETTINGS['timezone'] === $key ? ' selected' : '', '>'.$zone.'</option>'; |
|
326 | 326 | } |
327 | 327 | ?> |
328 | 328 | </select> |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $languagesList = $languagesList ?? []; |
375 | 375 | foreach ($languagesList as $teampassLang) { |
376 | 376 | echo ' |
377 | - <option value="' . $teampassLang . '"', isset($SETTINGS['default_language']) === true && (int) $SETTINGS['default_language'] === $teampassLang ? ' selected' : '', '>' . $teampassLang . '</option>'; |
|
377 | + <option value="' . $teampassLang.'"', isset($SETTINGS['default_language']) === true && (int) $SETTINGS['default_language'] === $teampassLang ? ' selected' : '', '>'.$teampassLang.'</option>'; |
|
378 | 378 | } |
379 | 379 | ?> |
380 | 380 | </select> |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | <?php |
472 | 472 | foreach (TP_PW_COMPLEXITY as $complex) { |
473 | 473 | echo ' |
474 | - <option value="' . $complex[0] . '"', isset($SETTINGS['personal_saltkey_security_level']) === true && (int) $SETTINGS['personal_saltkey_security_level'] === $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>'; |
|
474 | + <option value="' . $complex[0].'"', isset($SETTINGS['personal_saltkey_security_level']) === true && (int) $SETTINGS['personal_saltkey_security_level'] === $complex[0] ? ' selected' : '', '>'.$complex[1].'</option>'; |
|
475 | 475 | } |
476 | 476 | ?> |
477 | 477 | </select> |
@@ -848,7 +848,7 @@ discard block |
||
848 | 848 | $roles = getRolesTitles(); |
849 | 849 | foreach ($roles as $role) { |
850 | 850 | echo ' |
851 | - <option value="' . htmlspecialchars($role['id']) . '"', in_array($role['id'], $arrRolesToPrint) === true ? ' selected' : '', '>' . htmlspecialchars(addslashes($role['title'])) . '</option>'; |
|
851 | + <option value="' . htmlspecialchars($role['id']).'"', in_array($role['id'], $arrRolesToPrint) === true ? ' selected' : '', '>'.htmlspecialchars(addslashes($role['title'])).'</option>'; |
|
852 | 852 | } |
853 | 853 | } |
854 | 854 | ?> |
@@ -1075,7 +1075,7 @@ discard block |
||
1075 | 1075 | <?php |
1076 | 1076 | foreach (TP_PW_COMPLEXITY as $complex) { |
1077 | 1077 | echo ' |
1078 | - <option value="' . $complex[0] . '"', isset($SETTINGS['offline_key_level']) === true && (int) $SETTINGS['offline_key_level'] === $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>'; |
|
1078 | + <option value="' . $complex[0].'"', isset($SETTINGS['offline_key_level']) === true && (int) $SETTINGS['offline_key_level'] === $complex[0] ? ' selected' : '', '>'.$complex[1].'</option>'; |
|
1079 | 1079 | } |
1080 | 1080 | ?> |
1081 | 1081 | </select> |