@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | || isset($SETTINGS['allow_import']) === false || (int) $SETTINGS['allow_import'] !== 1) { |
| 71 | 71 | // Not allowed page |
| 72 | 72 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 73 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 73 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 74 | 74 | exit; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | if ((int) $session->get('user-admin') === 1) { |
| 87 | 87 | $folderOptions = ''; |
| 88 | - $rows = DB::query('SELECT id, title FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0); |
|
| 88 | + $rows = DB::query('SELECT id, title FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0); |
|
| 89 | 89 | foreach ($rows as $record) { |
| 90 | - $folderOptions .= '<option value="' . $record['id'] . '">' . htmlspecialchars($record['title'], ENT_QUOTES, 'UTF-8') . '</option>'; |
|
| 90 | + $folderOptions .= '<option value="'.$record['id'].'">'.htmlspecialchars($record['title'], ENT_QUOTES, 'UTF-8').'</option>'; |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | <?php |
| 190 | 190 | $complexitySelect = ''; |
| 191 | 191 | foreach (TP_PW_COMPLEXITY as $level) { |
| 192 | - $complexitySelect .= '<option value="' . $level[0] . '">' . $level[1] . '</option>'; |
|
| 192 | + $complexitySelect .= '<option value="'.$level[0].'">'.$level[1].'</option>'; |
|
| 193 | 193 | } |
| 194 | 194 | echo $complexitySelect; |
| 195 | 195 | ?> |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('import') === 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 | ?> |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | const errorMessages = JSON.parse(response.message); |
| 512 | 512 | let errorHtml = '<ul>'; |
| 513 | 513 | errorMessages.forEach(function(error) { |
| 514 | - errorHtml += '<li><?php echo $lang->get('import_error_folder_creation');?> "<b>'+error.errorPath+'</b>": '+error.errorMessage+'</li>'; |
|
| 514 | + errorHtml += '<li><?php echo $lang->get('import_error_folder_creation'); ?> "<b>'+error.errorPath+'</b>": '+error.errorMessage+'</li>'; |
|
| 515 | 515 | }); |
| 516 | 516 | |
| 517 | 517 | $('#import-feedback-progress-text').html( |
@@ -997,7 +997,7 @@ discard block |
||
| 997 | 997 | // Isolate first item |
| 998 | 998 | if (itemsList.length > 0) { |
| 999 | 999 | $('#import-feedback-progress-text') |
| 1000 | - .html('<i class="fa-solid fa-cog fa-spin ml-4 mr-2"></i><?php echo $lang->get('operation_progress');?> ('+((counter*100)/itemsNumber).toFixed(0)+'%)'); |
|
| 1000 | + .html('<i class="fa-solid fa-cog fa-spin ml-4 mr-2"></i><?php echo $lang->get('operation_progress'); ?> ('+((counter*100)/itemsNumber).toFixed(0)+'%)'); |
|
| 1001 | 1001 | |
| 1002 | 1002 | data = { |
| 1003 | 1003 | 'edit-all': $('#import-keepass-edit-all-checkbox').prop('checked') === true ? 1 : 0, |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | ) { |
| 77 | 77 | // Not allowed page |
| 78 | 78 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 79 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 79 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 80 | 80 | exit; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | // Is a date sent? |
| 102 | 102 | $dateCriteria = $request->query->get('dateCriteria'); |
| 103 | 103 | if ($dateCriteria !== null && !empty($dateCriteria)) { |
| 104 | - $sWhere .= ' AND a.del_value < ' . round(filter_var($dateCriteria, FILTER_SANITIZE_NUMBER_INT) / 1000, 0); |
|
| 104 | + $sWhere .= ' AND a.del_value < '.round(filter_var($dateCriteria, FILTER_SANITIZE_NUMBER_INT) / 1000, 0); |
|
| 105 | 105 | } |
| 106 | 106 | //echo $sWhere; |
| 107 | 107 | /* BUILD QUERY */ |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $start = $request->query->getInt('start', 0); |
| 111 | 111 | $length = $request->query->getInt('length', -1); |
| 112 | 112 | if ($length !== -1) { |
| 113 | - $sLimit = ' LIMIT ' . $start . ', ' . $length; |
|
| 113 | + $sLimit = ' LIMIT '.$start.', '.$length; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | //Ordering |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $columnIndex = filter_var($order[0]['column'], FILTER_SANITIZE_NUMBER_INT); |
| 124 | 124 | |
| 125 | 125 | if (array_key_exists($columnIndex, $aColumns)) { |
| 126 | - $sOrder .= $aColumns[$columnIndex] . ' ' . $order[0]['dir']; |
|
| 126 | + $sOrder .= $aColumns[$columnIndex].' '.$order[0]['dir']; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | // Supprimez la virgule finale si elle existe |
@@ -147,9 +147,9 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | if ($letter !== '' && $letter !== 'None') { |
| 149 | 149 | $sWhere .= ' AND '; |
| 150 | - $sWhere .= $aColumns[1] . " LIKE '" . $letter . "%' OR "; |
|
| 151 | - $sWhere .= $aColumns[2] . " LIKE '" . $letter . "%' OR "; |
|
| 152 | - $sWhere .= $aColumns[3] . " LIKE '" . $letter . "%' "; |
|
| 150 | + $sWhere .= $aColumns[1]." LIKE '".$letter."%' OR "; |
|
| 151 | + $sWhere .= $aColumns[2]." LIKE '".$letter."%' OR "; |
|
| 152 | + $sWhere .= $aColumns[3]." LIKE '".$letter."%' "; |
|
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
@@ -160,26 +160,26 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | if ($searchValue !== '') { |
| 162 | 162 | $sWhere = ' AND '; |
| 163 | - $sWhere .= $aColumns[1] . " LIKE '" . $searchValue . "%' OR "; |
|
| 164 | - $sWhere .= $aColumns[2] . " LIKE '" . $searchValue . "%' OR "; |
|
| 165 | - $sWhere .= $aColumns[3] . " LIKE '" . $searchValue . "%' "; |
|
| 163 | + $sWhere .= $aColumns[1]." LIKE '".$searchValue."%' OR "; |
|
| 164 | + $sWhere .= $aColumns[2]." LIKE '".$searchValue."%' OR "; |
|
| 165 | + $sWhere .= $aColumns[3]." LIKE '".$searchValue."%' "; |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | $rows = DB::query( |
| 171 | 171 | 'SELECT a.item_id, i.label, a.del_value, i.id_tree |
| 172 | - FROM ' . prefixTable('automatic_del') . ' AS a |
|
| 173 | - INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' . |
|
| 172 | + FROM ' . prefixTable('automatic_del').' AS a |
|
| 173 | + INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'. |
|
| 174 | 174 | $sWhere. |
| 175 | 175 | (string) $sOrder |
| 176 | 176 | ); |
| 177 | 177 | $iTotal = DB::count(); |
| 178 | 178 | $rows = DB::query( |
| 179 | 179 | 'SELECT a.item_id, i.label, a.del_value, i.id_tree |
| 180 | - FROM ' . prefixTable('automatic_del') . ' AS a |
|
| 181 | - INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' . |
|
| 182 | - $sWhere . |
|
| 180 | + FROM ' . prefixTable('automatic_del').' AS a |
|
| 181 | + INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'. |
|
| 182 | + $sWhere. |
|
| 183 | 183 | $sLimit |
| 184 | 184 | ); |
| 185 | 185 | $iFilteredTotal = DB::count(); |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | * Output |
| 188 | 188 | */ |
| 189 | 189 | $sOutput = '{'; |
| 190 | -$sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', '; |
|
| 190 | +$sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', '; |
|
| 191 | 191 | $sOutput .= '"iTotalRecords": '.$iTotal.', '; |
| 192 | 192 | $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', '; |
| 193 | 193 | $sOutput .= '"aaData": '; |
@@ -201,18 +201,18 @@ discard block |
||
| 201 | 201 | // start the line |
| 202 | 202 | $sOutput .= '['; |
| 203 | 203 | // Column 1 |
| 204 | - $sOutput .= '"<i class=\"fas fa-external-link-alt pointer text-primary mr-2\" onclick=\"showItemCard($(this))\" data-item-id=\"' . $record['item_id'] . '\" data-item-tree-id=\"' . $record['id_tree'] . '\"></i>", '; |
|
| 204 | + $sOutput .= '"<i class=\"fas fa-external-link-alt pointer text-primary mr-2\" onclick=\"showItemCard($(this))\" data-item-id=\"'.$record['item_id'].'\" data-item-tree-id=\"'.$record['id_tree'].'\"></i>", '; |
|
| 205 | 205 | // Column 2 |
| 206 | - $sOutput .= '"' . $record['label'] . '", '; |
|
| 206 | + $sOutput .= '"'.$record['label'].'", '; |
|
| 207 | 207 | // Column 3 |
| 208 | - $sOutput .= '"' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['del_value']) . '", '; |
|
| 208 | + $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['del_value']).'", '; |
|
| 209 | 209 | // Column 4 |
| 210 | 210 | $path = []; |
| 211 | 211 | $treeDesc = $tree->getPath($record['id_tree'], true); |
| 212 | 212 | foreach ($treeDesc as $t) { |
| 213 | 213 | array_push($path, $t->title); |
| 214 | 214 | } |
| 215 | - $sOutput .= '"' . implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path) . '"],'; |
|
| 215 | + $sOutput .= '"'.implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path).'"],'; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | if (count($rows) > 0) { |
@@ -80,8 +80,9 @@ discard block |
||
| 80 | 80 | $session = SessionManager::getSession(); |
| 81 | 81 | |
| 82 | 82 | // Random encryption key |
| 83 | -if ($session->get('key') === null) |
|
| 83 | +if ($session->get('key') === null) { |
|
| 84 | 84 | $session->set('key', generateQuickPassword(30, false)); |
| 85 | +} |
|
| 85 | 86 | |
| 86 | 87 | $request = SymfonyRequest::createFromGlobals(); |
| 87 | 88 | $configManager = new ConfigManager(); |
@@ -980,7 +981,10 @@ discard block |
||
| 980 | 981 | <input type="password" class="form-control" id="dialog-ldap-user-build-keys-database-code"> |
| 981 | 982 | <br/> |
| 982 | 983 | </div> |
| 983 | - <div class="input-group mb-3<?php if ($session_auth_type === 'oauth2') echo ' hidden'; ?>"> |
|
| 984 | + <div class="input-group mb-3<?php if ($session_auth_type === 'oauth2') { |
|
| 985 | + echo ' hidden'; |
|
| 986 | +} |
|
| 987 | +?>"> |
|
| 984 | 988 | <div class="input-group-prepend"> |
| 985 | 989 | <span class="input-group-text"><?php echo $lang->get('provide_your_current_password'); ?></span> |
| 986 | 990 | </div> |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | csrfProtector::init(); |
| 73 | 73 | |
| 74 | 74 | // Load functions |
| 75 | -require_once __DIR__. '/includes/config/include.php'; |
|
| 75 | +require_once __DIR__.'/includes/config/include.php'; |
|
| 76 | 76 | require_once __DIR__.'/sources/main.functions.php'; |
| 77 | 77 | |
| 78 | 78 | // init |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $SETTINGS = $antiXss->xss_clean($SETTINGS); |
| 107 | 107 | |
| 108 | 108 | // Load Core library |
| 109 | -require_once $SETTINGS['cpassman_dir'] . '/sources/core.php'; |
|
| 109 | +require_once $SETTINGS['cpassman_dir'].'/sources/core.php'; |
|
| 110 | 110 | // Prepare POST variables |
| 111 | 111 | $post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
| 112 | 112 | $session_user_language = $session->get('user-language'); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | if ($hasSuperPrivilege > 0) { |
| 161 | 161 | if (defined('MYSQL_LOG') && MYSQL_LOG === true) { |
| 162 | 162 | DB::query("SET GLOBAL general_log = 'ON'"); |
| 163 | - DB::query("SET GLOBAL general_log_file = " . (defined('MYSQL_LOG_FILE') ? MYSQL_LOG_FILE : "'/var/log/teampass_mysql_query.log'")); |
|
| 163 | + DB::query("SET GLOBAL general_log_file = ".(defined('MYSQL_LOG_FILE') ? MYSQL_LOG_FILE : "'/var/log/teampass_mysql_query.log'")); |
|
| 164 | 164 | } else { |
| 165 | 165 | DB::query("SET GLOBAL general_log = 'OFF'"); |
| 166 | 166 | } |
@@ -171,8 +171,8 @@ discard block |
||
| 171 | 171 | //get default language |
| 172 | 172 | $dataLanguage = DB::queryFirstRow( |
| 173 | 173 | 'SELECT m.valeur AS valeur, l.flag AS flag |
| 174 | - FROM ' . prefixTable('misc') . ' AS m |
|
| 175 | - INNER JOIN ' . prefixTable('languages') . ' AS l ON (m.valeur = l.name) |
|
| 174 | + FROM ' . prefixTable('misc').' AS m |
|
| 175 | + INNER JOIN ' . prefixTable('languages').' AS l ON (m.valeur = l.name) |
|
| 176 | 176 | WHERE m.type=%s_type AND m.intitule=%s_intitule', |
| 177 | 177 | [ |
| 178 | 178 | 'type' => 'admin', |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $session_user_language = $SETTINGS['default_language']; |
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | -$lang = new Language($session_user_language, __DIR__. '/includes/language/'); |
|
| 206 | +$lang = new Language($session_user_language, __DIR__.'/includes/language/'); |
|
| 207 | 207 | |
| 208 | 208 | if (isset($SETTINGS['cpassman_dir']) === false || $SETTINGS['cpassman_dir'] === '') { |
| 209 | 209 | $SETTINGS['cpassman_dir'] = __DIR__; |
@@ -277,29 +277,29 @@ discard block |
||
| 277 | 277 | </script> |
| 278 | 278 | |
| 279 | 279 | <!-- IonIcons --> |
| 280 | - <link rel="stylesheet" href="includes/css/ionicons.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 280 | + <link rel="stylesheet" href="includes/css/ionicons.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 281 | 281 | <!-- Theme style --> |
| 282 | - <link rel="stylesheet" href="plugins/adminlte/css/adminlte.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 283 | - <link rel="stylesheet" href="plugins/pace-progress/themes/corner-indicator.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/css" /> |
|
| 284 | - <link rel="stylesheet" href="plugins/select2/css/select2.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/css" /> |
|
| 285 | - <link rel="stylesheet" href="plugins/select2/theme/select2-bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/css" /> |
|
| 282 | + <link rel="stylesheet" href="plugins/adminlte/css/adminlte.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 283 | + <link rel="stylesheet" href="plugins/pace-progress/themes/corner-indicator.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/css" /> |
|
| 284 | + <link rel="stylesheet" href="plugins/select2/css/select2.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/css" /> |
|
| 285 | + <link rel="stylesheet" href="plugins/select2/theme/select2-bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/css" /> |
|
| 286 | 286 | <!-- Theme style --> |
| 287 | - <link rel="stylesheet" href="includes/css/teampass.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 287 | + <link rel="stylesheet" href="includes/css/teampass.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 288 | 288 | <!-- Google Font: Source Sans Pro --> |
| 289 | - <link rel="stylesheet" type="text/css" href="includes/fonts/fonts.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 289 | + <link rel="stylesheet" type="text/css" href="includes/fonts/fonts.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 290 | 290 | <!-- Altertify --> |
| 291 | - <link rel="stylesheet" href="plugins/alertifyjs/css/alertify.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" /> |
|
| 292 | - <link rel="stylesheet" href="plugins/alertifyjs/css/themes/bootstrap.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" /> |
|
| 291 | + <link rel="stylesheet" href="plugins/alertifyjs/css/alertify.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" /> |
|
| 292 | + <link rel="stylesheet" href="plugins/alertifyjs/css/themes/bootstrap.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" /> |
|
| 293 | 293 | <!-- Toastr --> |
| 294 | - <link rel="stylesheet" href="plugins/toastr/toastr.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" /> |
|
| 294 | + <link rel="stylesheet" href="plugins/toastr/toastr.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" /> |
|
| 295 | 295 | <!-- favicon --> |
| 296 | - <link rel="shortcut icon" type="image/png" href="<?php echo $favicon;?>"/> |
|
| 296 | + <link rel="shortcut icon" type="image/png" href="<?php echo $favicon; ?>"/> |
|
| 297 | 297 | <!-- manifest (PWA) --> |
| 298 | - <link rel="manifest" href="manifest.json?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 298 | + <link rel="manifest" href="manifest.json?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 299 | 299 | <!-- Custom style --> |
| 300 | 300 | <?php |
| 301 | - if (file_exists(__DIR__ . '/includes/css/custom.css') === true) {?> |
|
| 302 | - <link rel="stylesheet" href="includes/css/custom.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 301 | + if (file_exists(__DIR__.'/includes/css/custom.css') === true) {?> |
|
| 302 | + <link rel="stylesheet" href="includes/css/custom.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 303 | 303 | <?php |
| 304 | 304 | } ?> |
| 305 | 305 | </head> |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | <div class="dropdown show"> |
| 347 | 347 | <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown"> |
| 348 | 348 | <?php |
| 349 | - echo $session_name . ' ' . $session_lastname; ?> |
|
| 349 | + echo $session_name.' '.$session_lastname; ?> |
|
| 350 | 350 | </a> |
| 351 | 351 | |
| 352 | 352 | <div class="dropdown-menu dropdown-menu-right"> |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | </a> |
| 371 | 371 | <?php |
| 372 | 372 | } ?> |
| 373 | - <a class="dropdown-item user-menu<?php echo (int) $session_user_admin === 1 ? ' hidden' : '';?>" href="#" data-name="generate-new_keys"> |
|
| 373 | + <a class="dropdown-item user-menu<?php echo (int) $session_user_admin === 1 ? ' hidden' : ''; ?>" href="#" data-name="generate-new_keys"> |
|
| 374 | 374 | <i class="fa-solid fa-spray-can-sparkles fa-fw mr-2"></i><?php echo $lang->get('generate_new_keys'); ?> |
| 375 | 375 | </a> |
| 376 | 376 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | <!-- Main Sidebar Container --> |
| 405 | 405 | <aside class="main-sidebar sidebar-dark-primary elevation-4"> |
| 406 | 406 | <!-- Brand Logo --> |
| 407 | - <a href="<?php echo $cpassman_url . '/index.php?page=' . ((int) $session_user_admin === 1 ? 'admin' : 'items'); ?>" class="brand-link"> |
|
| 407 | + <a href="<?php echo $cpassman_url.'/index.php?page='.((int) $session_user_admin === 1 ? 'admin' : 'items'); ?>" class="brand-link"> |
|
| 408 | 408 | <img src="includes/images/teampass-logo2-home.png" alt="Teampass Logo" class="brand-image"> |
| 409 | 409 | <span class="brand-text font-weight-light"><?php echo TP_TOOL_NAME; ?></span> |
| 410 | 410 | </a> |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | <a href="#" data-name="items" class="nav-link', $get['page'] === 'items' ? ' active' : '', '"> |
| 423 | 423 | <i class="nav-icon fa-solid fa-key"></i> |
| 424 | 424 | <p> |
| 425 | - ' . $lang->get('pw') . ' |
|
| 425 | + ' . $lang->get('pw').' |
|
| 426 | 426 | </p> |
| 427 | 427 | </a> |
| 428 | 428 | </li>'; |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '"> |
| 436 | 436 | <i class="nav-icon fa-solid fa-file-import"></i> |
| 437 | 437 | <p> |
| 438 | - ' . $lang->get('import') . ' |
|
| 438 | + ' . $lang->get('import').' |
|
| 439 | 439 | </p> |
| 440 | 440 | </a> |
| 441 | 441 | </li>'; |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | <a href="#" data-name="export" class="nav-link', $get['page'] === 'export' ? ' active' : '', '"> |
| 457 | 457 | <i class="nav-icon fa-solid fa-file-export"></i> |
| 458 | 458 | <p> |
| 459 | - ' . $lang->get('export') . ' |
|
| 459 | + ' . $lang->get('export').' |
|
| 460 | 460 | </p> |
| 461 | 461 | </a> |
| 462 | 462 | </li>'; |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | <a href="#" data-name="search" class="nav-link', $get['page'] === 'search' ? ' active' : '', '"> |
| 484 | 484 | <i class="nav-icon fa-solid fa-search"></i> |
| 485 | 485 | <p> |
| 486 | - ' . $lang->get('find') . ' |
|
| 486 | + ' . $lang->get('find').' |
|
| 487 | 487 | </p> |
| 488 | 488 | </a> |
| 489 | 489 | </li>'; |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | <a href="#" data-name="favourites" class="nav-link', $get['page'] === 'favourites' ? ' active' : '', '"> |
| 500 | 500 | <i class="nav-icon fa-solid fa-star"></i> |
| 501 | 501 | <p> |
| 502 | - ' . $lang->get('favorites') . ' |
|
| 502 | + ' . $lang->get('favorites').' |
|
| 503 | 503 | </p> |
| 504 | 504 | </a> |
| 505 | 505 | </li>'; |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | <a href="#" data-name="suggestion" class="nav-link', $get['page'] === 'suggestion' ? ' active' : '', '"> |
| 530 | 530 | <i class="nav-icon fa-solid fa-lightbulb"></i> |
| 531 | 531 | <p> |
| 532 | - ' . $lang->get('suggestion_menu') . ' |
|
| 532 | + ' . $lang->get('suggestion_menu').' |
|
| 533 | 533 | </p> |
| 534 | 534 | </a> |
| 535 | 535 | </li>'; |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | <a href="#" data-name="admin" class="nav-link', $get['page'] === 'admin' ? ' active' : '', '"> |
| 543 | 543 | <i class="nav-icon fa-solid fa-info"></i> |
| 544 | 544 | <p> |
| 545 | - ' . $lang->get('admin_main') . ' |
|
| 545 | + ' . $lang->get('admin_main').' |
|
| 546 | 546 | </p> |
| 547 | 547 | </a> |
| 548 | 548 | </li> |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | <a href="#" class="nav-link"> |
| 551 | 551 | <i class="nav-icon fa-solid fa-wrench"></i> |
| 552 | 552 | <p> |
| 553 | - ' . $lang->get('admin_settings') . ' |
|
| 553 | + ' . $lang->get('admin_settings').' |
|
| 554 | 554 | <i class="fa-solid fa-angle-left right"></i> |
| 555 | 555 | </p> |
| 556 | 556 | </a> |
@@ -558,63 +558,63 @@ discard block |
||
| 558 | 558 | <li class="nav-item"> |
| 559 | 559 | <a href="#" data-name="options" class="nav-link', $get['page'] === 'options' ? ' active' : '', '"> |
| 560 | 560 | <i class="fa-solid fa-check-double nav-icon"></i> |
| 561 | - <p>' . $lang->get('options') . '</p> |
|
| 561 | + <p>' . $lang->get('options').'</p> |
|
| 562 | 562 | </a> |
| 563 | 563 | </li> |
| 564 | 564 | <li class="nav-item"> |
| 565 | 565 | <a href="#" data-name="2fa" class="nav-link', $get['page'] === '2fa' ? ' active' : '', '"> |
| 566 | 566 | <i class="fa-solid fa-qrcode nav-icon"></i> |
| 567 | - <p>' . $lang->get('mfa_short') . '</p> |
|
| 567 | + <p>' . $lang->get('mfa_short').'</p> |
|
| 568 | 568 | </a> |
| 569 | 569 | </li> |
| 570 | 570 | <li class="nav-item"> |
| 571 | 571 | <a href="#" data-name="api" class="nav-link', $get['page'] === 'api' ? ' active' : '', '"> |
| 572 | 572 | <i class="fa-solid fa-cubes nav-icon"></i> |
| 573 | - <p>' . $lang->get('api') . '</p> |
|
| 573 | + <p>' . $lang->get('api').'</p> |
|
| 574 | 574 | </a> |
| 575 | 575 | </li> |
| 576 | 576 | <li class="nav-item"> |
| 577 | 577 | <a href="#" data-name="backups" class="nav-link', $get['page'] === 'backups' ? ' active' : '', '"> |
| 578 | 578 | <i class="fa-solid fa-database nav-icon"></i> |
| 579 | - <p>' . $lang->get('backups') . '</p> |
|
| 579 | + <p>' . $lang->get('backups').'</p> |
|
| 580 | 580 | </a> |
| 581 | 581 | </li> |
| 582 | 582 | <li class="nav-item"> |
| 583 | 583 | <a href="#" data-name="emails" class="nav-link', $get['page'] === 'emails' ? ' active' : '', '"> |
| 584 | 584 | <i class="fa-solid fa-envelope nav-icon"></i> |
| 585 | - <p>' . $lang->get('emails') . '</p> |
|
| 585 | + <p>' . $lang->get('emails').'</p> |
|
| 586 | 586 | </a> |
| 587 | 587 | </li> |
| 588 | 588 | <li class="nav-item"> |
| 589 | 589 | <a href="#" data-name="fields" class="nav-link', $get['page'] === 'fields' ? ' active' : '', '"> |
| 590 | 590 | <i class="fa-solid fa-keyboard nav-icon"></i> |
| 591 | - <p>' . $lang->get('fields') . '</p> |
|
| 591 | + <p>' . $lang->get('fields').'</p> |
|
| 592 | 592 | </a> |
| 593 | 593 | </li> |
| 594 | 594 | <li class="nav-item"> |
| 595 | 595 | <a href="#" data-name="ldap" class="nav-link', $get['page'] === 'ldap' ? ' active' : '', '"> |
| 596 | 596 | <i class="fa-solid fa-id-card nav-icon"></i> |
| 597 | - <p>' . $lang->get('ldap') . '</p> |
|
| 597 | + <p>' . $lang->get('ldap').'</p> |
|
| 598 | 598 | </a> |
| 599 | 599 | </li> |
| 600 | 600 | |
| 601 | 601 | <li class="nav-item"> |
| 602 | 602 | <a href="#" data-name="oauth" class="nav-link', $get['page'] === 'oauth' ? ' active' : '', '"> |
| 603 | 603 | <i class="fa-solid fa-plug nav-icon"></i> |
| 604 | - <p>' . $lang->get('oauth') . '</p> |
|
| 604 | + <p>' . $lang->get('oauth').'</p> |
|
| 605 | 605 | </a> |
| 606 | 606 | </li> |
| 607 | 607 | |
| 608 | 608 | <li class="nav-item"> |
| 609 | 609 | <a href="#" data-name="uploads" class="nav-link', $get['page'] === 'uploads' ? ' active' : '', '"> |
| 610 | 610 | <i class="fa-solid fa-file-upload nav-icon"></i> |
| 611 | - <p>' . $lang->get('uploads') . '</p> |
|
| 611 | + <p>' . $lang->get('uploads').'</p> |
|
| 612 | 612 | </a> |
| 613 | 613 | </li> |
| 614 | 614 | <li class="nav-item"> |
| 615 | 615 | <a href="#" data-name="statistics" class="nav-link', $get['page'] === 'statistics' ? ' active' : '', '"> |
| 616 | 616 | <i class="fa-solid fa-chart-bar nav-icon"></i> |
| 617 | - <p>' . $lang->get('statistics') . '</p> |
|
| 617 | + <p>' . $lang->get('statistics').'</p> |
|
| 618 | 618 | </a> |
| 619 | 619 | </li> |
| 620 | 620 | </ul> |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | <li class="nav-item"> |
| 626 | 626 | <a href="#" data-name="tasks" class="nav-link', $get['page'] === 'tasks' ? ' active' : '', '"> |
| 627 | 627 | <i class="fa-solid fa-tasks nav-icon"></i> |
| 628 | - <p>' . $lang->get('tasks') . '</p> |
|
| 628 | + <p>' . $lang->get('tasks').'</p> |
|
| 629 | 629 | </a> |
| 630 | 630 | </li>'; |
| 631 | 631 | } |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | <a href="#" data-name="tools" class="nav-link', $get['page'] === 'tools' ? ' active' : '', '"> |
| 637 | 637 | <i class="nav-icon fa-solid fa-person-drowning"></i> |
| 638 | 638 | <p> |
| 639 | - ' . $lang->get('tools') . ' |
|
| 639 | + ' . $lang->get('tools').' |
|
| 640 | 640 | </p> |
| 641 | 641 | </a> |
| 642 | 642 | </li>'; |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '"> |
| 647 | 647 | <i class="nav-icon fa-solid fa-file-import"></i> |
| 648 | 648 | <p> |
| 649 | - ' . $lang->get('import') . ' |
|
| 649 | + ' . $lang->get('import').' |
|
| 650 | 650 | </p> |
| 651 | 651 | </a> |
| 652 | 652 | </li>'; |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | <a href="#" data-name="folders" class="nav-link', $get['page'] === 'folders' ? ' active' : '', '"> |
| 663 | 663 | <i class="nav-icon fa-solid fa-folder-open"></i> |
| 664 | 664 | <p> |
| 665 | - ' . $lang->get('folders') . ' |
|
| 665 | + ' . $lang->get('folders').' |
|
| 666 | 666 | </p> |
| 667 | 667 | </a> |
| 668 | 668 | </li> |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | <a href="#" data-name="roles" class="nav-link', $get['page'] === 'roles' ? ' active' : '', '"> |
| 671 | 671 | <i class="nav-icon fa-solid fa-graduation-cap"></i> |
| 672 | 672 | <p> |
| 673 | - ' . $lang->get('roles') . ' |
|
| 673 | + ' . $lang->get('roles').' |
|
| 674 | 674 | </p> |
| 675 | 675 | </a> |
| 676 | 676 | </li> |
@@ -678,38 +678,38 @@ discard block |
||
| 678 | 678 | <a href="#" data-name="users" class="nav-link', $get['page'] === 'users' ? ' active' : '', '"> |
| 679 | 679 | <i class="nav-icon fa-solid fa-users"></i> |
| 680 | 680 | <p> |
| 681 | - ' . $lang->get('users') . ' |
|
| 681 | + ' . $lang->get('users').' |
|
| 682 | 682 | </p> |
| 683 | 683 | </a> |
| 684 | 684 | </li> |
| 685 | 685 | <li class="nav-item has-treeview', $menuUtilities === true ? ' menu-open' : '', '"> |
| 686 | 686 | <a href="#" class="nav-link"> |
| 687 | 687 | <i class="nav-icon fa-solid fa-cubes"></i> |
| 688 | - <p>' . $lang->get('admin_views') . '<i class="fa-solid fa-angle-left right"></i></p> |
|
| 688 | + <p>' . $lang->get('admin_views').'<i class="fa-solid fa-angle-left right"></i></p> |
|
| 689 | 689 | </a> |
| 690 | 690 | <ul class="nav nav-treeview"> |
| 691 | 691 | <li class="nav-item"> |
| 692 | 692 | <a href="#" data-name="utilities.renewal" class="nav-link', $get['page'] === 'utilities.renewal' ? ' active' : '', '"> |
| 693 | 693 | <i class="far fa-calendar-alt nav-icon"></i> |
| 694 | - <p>' . $lang->get('renewal') . '</p> |
|
| 694 | + <p>' . $lang->get('renewal').'</p> |
|
| 695 | 695 | </a> |
| 696 | 696 | </li> |
| 697 | 697 | <li class="nav-item"> |
| 698 | 698 | <a href="#" data-name="utilities.deletion" class="nav-link', $get['page'] === 'utilities.deletion' ? ' active' : '', '"> |
| 699 | 699 | <i class="fa-solid fa-trash-alt nav-icon"></i> |
| 700 | - <p>' . $lang->get('deletion') . '</p> |
|
| 700 | + <p>' . $lang->get('deletion').'</p> |
|
| 701 | 701 | </a> |
| 702 | 702 | </li> |
| 703 | 703 | <li class="nav-item"> |
| 704 | 704 | <a href="#" data-name="utilities.logs" class="nav-link', $get['page'] === 'utilities.logs' ? ' active' : '', '"> |
| 705 | 705 | <i class="fa-solid fa-history nav-icon"></i> |
| 706 | - <p>' . $lang->get('logs') . '</p> |
|
| 706 | + <p>' . $lang->get('logs').'</p> |
|
| 707 | 707 | </a> |
| 708 | 708 | </li> |
| 709 | 709 | <li class="nav-item"> |
| 710 | 710 | <a href="#" data-name="utilities.database" class="nav-link', $get['page'] === 'utilities.database' ? ' active' : '', '"> |
| 711 | 711 | <i class="fa-solid fa-database nav-icon"></i> |
| 712 | - <p>' . $lang->get('database') . '</p> |
|
| 712 | + <p>' . $lang->get('database').'</p> |
|
| 713 | 713 | </a> |
| 714 | 714 | </li> |
| 715 | 715 | </ul> |
@@ -720,10 +720,10 @@ discard block |
||
| 720 | 720 | <!-- /.sidebar-menu --> |
| 721 | 721 | <div class="menu-footer"> |
| 722 | 722 | <div class="" id="sidebar-footer"> |
| 723 | - <i class="fa-solid fa-clock-o mr-2 infotip text-info pointer" title="<?php echo htmlspecialchars($lang->get('server_time') . ' ' . |
|
| 724 | - date($date_format, (int) $server['request_time']) . ' - ' . |
|
| 723 | + <i class="fa-solid fa-clock-o mr-2 infotip text-info pointer" title="<?php echo htmlspecialchars($lang->get('server_time').' '. |
|
| 724 | + date($date_format, (int) $server['request_time']).' - '. |
|
| 725 | 725 | date($time_format, (int) $server['request_time']), ENT_QUOTES, 'UTF-8'); ?>"></i> |
| 726 | - <i class="fa-solid fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online . ' ' . $lang->get('users_online'); ?>"></i> |
|
| 726 | + <i class="fa-solid fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online.' '.$lang->get('users_online'); ?>"></i> |
|
| 727 | 727 | <a href="<?php echo DOCUMENTATION_URL; ?>" target="_blank" class="text-info"><i class="fa-solid fa-book mr-2 infotip" title="<?php echo $lang->get('documentation_canal'); ?>"></i></a> |
| 728 | 728 | <a href="<?php echo HELP_URL; ?>" target="_blank" class="text-info"><i class="fa-solid fa-life-ring mr-2 infotip" title="<?php echo $lang->get('admin_help'); ?>"></i></a> |
| 729 | 729 | <?php if ($session_user_admin === 1) : ?><i class="fa-solid fa-bug infotip pointer text-info" title="<?php echo $lang->get('bugs_page'); ?>" onclick="generateBugReport()"></i><?php endif; ?> |
@@ -880,7 +880,7 @@ discard block |
||
| 880 | 880 | </div> |
| 881 | 881 | <div class="mt-3"> |
| 882 | 882 | <label> |
| 883 | - <span class="mr-2 pointer fw-normal"><i class="fa-solid fa-eye mr-2 text-orange"></i><?php echo $lang->get('show_user_password');?></span> |
|
| 883 | + <span class="mr-2 pointer fw-normal"><i class="fa-solid fa-eye mr-2 text-orange"></i><?php echo $lang->get('show_user_password'); ?></span> |
|
| 884 | 884 | <input type="checkbox" id="dialog-admin-change-user-password-do-show-password" class="pointer"> |
| 885 | 885 | </label> |
| 886 | 886 | </div> |
@@ -1039,7 +1039,7 @@ discard block |
||
| 1039 | 1039 | |
| 1040 | 1040 | <div class="alert alert-danger mt-3" role="alert"> |
| 1041 | 1041 | <label> |
| 1042 | - <span class="mr-2 pointer fw-normal"><?php echo $lang->get('ignore_this_password_is_lost');?></span> |
|
| 1042 | + <span class="mr-2 pointer fw-normal"><?php echo $lang->get('ignore_this_password_is_lost'); ?></span> |
|
| 1043 | 1043 | <input type="checkbox" id="depiapc-ignore-password" class="pointer flat-blue"> |
| 1044 | 1044 | </label> |
| 1045 | 1045 | </div> |
@@ -1063,34 +1063,34 @@ discard block |
||
| 1063 | 1063 | if ($get['page'] === 'items') { |
| 1064 | 1064 | // SHow page with Items |
| 1065 | 1065 | if ((int) $session_user_admin !== 1) { |
| 1066 | - include $SETTINGS['cpassman_dir'] . '/pages/items.php'; |
|
| 1066 | + include $SETTINGS['cpassman_dir'].'/pages/items.php'; |
|
| 1067 | 1067 | } elseif ((int) $session_user_admin === 1) { |
| 1068 | - include $SETTINGS['cpassman_dir'] . '/pages/admin.php'; |
|
| 1068 | + include $SETTINGS['cpassman_dir'].'/pages/admin.php'; |
|
| 1069 | 1069 | } else { |
| 1070 | 1070 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 1071 | 1071 | //not allowed page |
| 1072 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 1072 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 1073 | 1073 | } |
| 1074 | 1074 | } elseif (in_array($get['page'], array_keys($mngPages)) === true) { |
| 1075 | 1075 | // Define if user is allowed to see management pages |
| 1076 | 1076 | if ($session_user_admin === 1) { |
| 1077 | 1077 | // deepcode ignore FileInclusion: $get['page'] is secured through usage of array_keys test bellow |
| 1078 | - include $SETTINGS['cpassman_dir'] . '/pages/' . basename($mngPages[$get['page']]); |
|
| 1078 | + include $SETTINGS['cpassman_dir'].'/pages/'.basename($mngPages[$get['page']]); |
|
| 1079 | 1079 | } elseif ($session_user_manager === 1 || $session_user_human_resources === 1) { |
| 1080 | 1080 | if ($get['page'] === 'manage_main' || $get['page'] === 'manage_settings' |
| 1081 | 1081 | ) { |
| 1082 | 1082 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 1083 | 1083 | //not allowed page |
| 1084 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 1084 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 1085 | 1085 | } |
| 1086 | 1086 | } else { |
| 1087 | 1087 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 1088 | 1088 | //not allowed page |
| 1089 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 1089 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 1090 | 1090 | } |
| 1091 | - } elseif (empty($get['page']) === false && file_exists($SETTINGS['cpassman_dir'] . '/pages/' . $get['page'] . '.php') === true) { |
|
| 1091 | + } elseif (empty($get['page']) === false && file_exists($SETTINGS['cpassman_dir'].'/pages/'.$get['page'].'.php') === true) { |
|
| 1092 | 1092 | // deepcode ignore FileInclusion: $get['page'] is tested against file_exists just below |
| 1093 | - include $SETTINGS['cpassman_dir'] . '/pages/' . basename($get['page'] . '.php'); |
|
| 1093 | + include $SETTINGS['cpassman_dir'].'/pages/'.basename($get['page'].'.php'); |
|
| 1094 | 1094 | } else { |
| 1095 | 1095 | $session->set('system-array_roles', ERR_NOT_EXIST); |
| 1096 | 1096 | //page doesn't exist |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | <footer class="main-footer"> |
| 1120 | 1120 | <!-- To the right --> |
| 1121 | 1121 | <div class="float-right d-none d-sm-inline"> |
| 1122 | - <?php echo $lang->get('version_alone'); ?> <?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?> |
|
| 1122 | + <?php echo $lang->get('version_alone'); ?> <?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?> |
|
| 1123 | 1123 | </div> |
| 1124 | 1124 | <!-- Default to the left --> |
| 1125 | 1125 | <strong>Copyright © <?php echo TP_COPYRIGHT; ?> <a href="<?php echo TEAMPASS_URL; ?>"><?php echo TP_TOOL_NAME; ?></a>.</strong> All rights reserved. |
@@ -1133,7 +1133,7 @@ discard block |
||
| 1133 | 1133 | echo ' |
| 1134 | 1134 | <input type="hidden" id="temps_restant" value="', $session->get('user-session_duration') ?? '', '" />'; |
| 1135 | 1135 | // display an item in the context of OTV link |
| 1136 | -} elseif ((null === $session->get('user-validite_pw')|| empty($session->get('user-validite_pw')) === true || empty($session->get('user-id')) === true) |
|
| 1136 | +} elseif ((null === $session->get('user-validite_pw') || empty($session->get('user-validite_pw')) === true || empty($session->get('user-id')) === true) |
|
| 1137 | 1137 | && empty($get['otv']) === false |
| 1138 | 1138 | ) { |
| 1139 | 1139 | // case where one-shot viewer |
@@ -1152,7 +1152,7 @@ discard block |
||
| 1152 | 1152 | FILTER_SANITIZE_URL |
| 1153 | 1153 | ) |
| 1154 | 1154 | ); |
| 1155 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 1155 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 1156 | 1156 | } |
| 1157 | 1157 | } elseif (//(empty($session->get('user-id')) === false && $session->get('user-id') !== null) || |
| 1158 | 1158 | empty($session->get('user-id')) === true |
@@ -1177,7 +1177,7 @@ discard block |
||
| 1177 | 1177 | } |
| 1178 | 1178 | |
| 1179 | 1179 | // LOGIN form |
| 1180 | - include $SETTINGS['cpassman_dir'] . '/includes/core/login.php'; |
|
| 1180 | + include $SETTINGS['cpassman_dir'].'/includes/core/login.php'; |
|
| 1181 | 1181 | |
| 1182 | 1182 | } else { |
| 1183 | 1183 | // Clear session |
@@ -1210,153 +1210,153 @@ discard block |
||
| 1210 | 1210 | <!-- REQUIRED SCRIPTS --> |
| 1211 | 1211 | |
| 1212 | 1212 | <!-- Font Awesome Icons --> |
| 1213 | - <link href="plugins/fontawesome-free-6/css/fontawesome.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" rel="stylesheet"> |
|
| 1214 | - <link href="plugins/fontawesome-free-6/css/solid.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" rel="stylesheet"> |
|
| 1215 | - <link href="plugins/fontawesome-free-6/css/regular.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" rel="stylesheet"> |
|
| 1216 | - <link href="plugins/fontawesome-free-6/css/brands.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" rel="stylesheet"> |
|
| 1217 | - <link href="plugins/fontawesome-free-6/css/v5-font-face.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" rel="stylesheet" /> |
|
| 1213 | + <link href="plugins/fontawesome-free-6/css/fontawesome.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" rel="stylesheet"> |
|
| 1214 | + <link href="plugins/fontawesome-free-6/css/solid.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" rel="stylesheet"> |
|
| 1215 | + <link href="plugins/fontawesome-free-6/css/regular.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" rel="stylesheet"> |
|
| 1216 | + <link href="plugins/fontawesome-free-6/css/brands.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" rel="stylesheet"> |
|
| 1217 | + <link href="plugins/fontawesome-free-6/css/v5-font-face.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" rel="stylesheet" /> |
|
| 1218 | 1218 | <!-- jQuery --> |
| 1219 | - <script src="plugins/jquery/jquery.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1220 | - <script src="plugins/jquery/jquery.cookie.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/javascript"></script> |
|
| 1219 | + <script src="plugins/jquery/jquery.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1220 | + <script src="plugins/jquery/jquery.cookie.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/javascript"></script> |
|
| 1221 | 1221 | <!-- jQuery UI --> |
| 1222 | - <script src="plugins/jqueryUI/jquery-ui.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1223 | - <link rel="stylesheet" href="plugins/jqueryUI/jquery-ui.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1222 | + <script src="plugins/jqueryUI/jquery-ui.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1223 | + <link rel="stylesheet" href="plugins/jqueryUI/jquery-ui.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1224 | 1224 | <!-- Popper --> |
| 1225 | - <script src="plugins/popper/umd/popper.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1225 | + <script src="plugins/popper/umd/popper.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1226 | 1226 | <!-- Bootstrap --> |
| 1227 | - <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1227 | + <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1228 | 1228 | <!-- AdminLTE --> |
| 1229 | - <script src="plugins/adminlte/js/adminlte.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1229 | + <script src="plugins/adminlte/js/adminlte.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1230 | 1230 | <!-- Altertify --> |
| 1231 | 1231 | <!--<script type="text/javascript" src="plugins/alertifyjs/alertify.min.js"></script>--> |
| 1232 | 1232 | <!-- Toastr --> |
| 1233 | - <script type="text/javascript" src="plugins/toastr/toastr.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1233 | + <script type="text/javascript" src="plugins/toastr/toastr.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1234 | 1234 | <!-- STORE.JS --> |
| 1235 | - <script type="text/javascript" src="plugins/store.js/dist/store.everything.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1235 | + <script type="text/javascript" src="plugins/store.js/dist/store.everything.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1236 | 1236 | <!-- cryptojs-aesphp --> |
| 1237 | - <script type="text/javascript" src="includes/libraries/cryptojs/crypto-js.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1238 | - <script type="text/javascript" src="includes/libraries/cryptojs/encryption.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1237 | + <script type="text/javascript" src="includes/libraries/cryptojs/crypto-js.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1238 | + <script type="text/javascript" src="includes/libraries/cryptojs/encryption.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1239 | 1239 | <!-- pace --> |
| 1240 | - <script type="text/javascript" data-pace-options='{ "ajax": true, "eventLag": false }' src="plugins/pace-progress/pace.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1240 | + <script type="text/javascript" data-pace-options='{ "ajax": true, "eventLag": false }' src="plugins/pace-progress/pace.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1241 | 1241 | <!-- select2 --> |
| 1242 | - <script type="text/javascript" src="plugins/select2/js/select2.full.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1242 | + <script type="text/javascript" src="plugins/select2/js/select2.full.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1243 | 1243 | <!-- simplePassMeter --> |
| 1244 | - <link rel="stylesheet" href="plugins/simplePassMeter/simplePassMeter.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/css" /> |
|
| 1245 | - <script type="text/javascript" src="plugins/simplePassMeter/simplePassMeter.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1244 | + <link rel="stylesheet" href="plugins/simplePassMeter/simplePassMeter.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/css" /> |
|
| 1245 | + <script type="text/javascript" src="plugins/simplePassMeter/simplePassMeter.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1246 | 1246 | <!-- platform --> |
| 1247 | - <script type="text/javascript" src="plugins/platform/platform.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1247 | + <script type="text/javascript" src="plugins/platform/platform.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1248 | 1248 | <!-- radiobuttons --> |
| 1249 | - <link rel="stylesheet" href="plugins/radioforbuttons/bootstrap-buttons.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/css" /> |
|
| 1250 | - <script type="text/javascript" src="plugins/radioforbuttons/jquery.radiosforbuttons.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1249 | + <link rel="stylesheet" href="plugins/radioforbuttons/bootstrap-buttons.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/css" /> |
|
| 1250 | + <script type="text/javascript" src="plugins/radioforbuttons/jquery.radiosforbuttons.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1251 | 1251 | <!-- ICHECK --> |
| 1252 | 1252 | <!--<link rel="stylesheet" href="./plugins/icheck-material/icheck-material.min.css">--> |
| 1253 | - <link rel="stylesheet" href="./plugins/icheck/skins/all.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1254 | - <script type="text/javascript" src="./plugins/icheck/icheck.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1253 | + <link rel="stylesheet" href="./plugins/icheck/skins/all.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1254 | + <script type="text/javascript" src="./plugins/icheck/icheck.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1255 | 1255 | <!-- bootstrap-add-clear --> |
| 1256 | - <script type="text/javascript" src="plugins/bootstrap-add-clear/bootstrap-add-clear.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1256 | + <script type="text/javascript" src="plugins/bootstrap-add-clear/bootstrap-add-clear.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1257 | 1257 | <!-- DOMPurify --> |
| 1258 | - <script type="text/javascript" src="plugins/DOMPurify/purify.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1258 | + <script type="text/javascript" src="plugins/DOMPurify/purify.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1259 | 1259 | |
| 1260 | 1260 | <?php |
| 1261 | 1261 | $get['page'] = $request->query->filter('page', null, FILTER_SANITIZE_SPECIAL_CHARS); |
| 1262 | 1262 | if ($menuAdmin === true) { |
| 1263 | 1263 | ?> |
| 1264 | - <link rel="stylesheet" href="./plugins/toggles/css/toggles.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" /> |
|
| 1265 | - <link rel="stylesheet" href="./plugins/toggles/css/toggles-modern.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" /> |
|
| 1266 | - <script src="./plugins/toggles/toggles.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/javascript"></script> |
|
| 1264 | + <link rel="stylesheet" href="./plugins/toggles/css/toggles.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" /> |
|
| 1265 | + <link rel="stylesheet" href="./plugins/toggles/css/toggles-modern.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" /> |
|
| 1266 | + <script src="./plugins/toggles/toggles.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/javascript"></script> |
|
| 1267 | 1267 | <!-- InputMask --> |
| 1268 | - <script src="./plugins/inputmask/jquery.inputmask.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1268 | + <script src="./plugins/inputmask/jquery.inputmask.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1269 | 1269 | <!-- Sortable --> |
| 1270 | 1270 | <!--<script src="./plugins/sortable/jquery.sortable.js"></script>--> |
| 1271 | 1271 | <!-- PLUPLOAD --> |
| 1272 | - <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1272 | + <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1273 | 1273 | <!-- DataTables --> |
| 1274 | - <link rel="stylesheet" src="./plugins/datatables/css/jquery.dataTables.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1275 | - <link rel="stylesheet" src="./plugins/datatables/css/dataTables.bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1276 | - <script type="text/javascript" src="./plugins/datatables/js/jquery.dataTables.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1277 | - <script type="text/javascript" src="./plugins/datatables/js/dataTables.bootstrap4.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1278 | - <link rel="stylesheet" src="./plugins/datatables/extensions/Responsive-2.2.2/css/responsive.bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1279 | - <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/dataTables.responsive.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1280 | - <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/responsive.bootstrap4.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1281 | - <script type="text/javascript" src="./plugins/datatables/plugins/select.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1282 | - <link rel="stylesheet" src="./plugins/datatables/extensions/Scroller-1.5.0/css/scroller.bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1283 | - <script type="text/javascript" src="./plugins/datatables/extensions/Scroller-1.5.0/js/dataTables.scroller.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1274 | + <link rel="stylesheet" src="./plugins/datatables/css/jquery.dataTables.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1275 | + <link rel="stylesheet" src="./plugins/datatables/css/dataTables.bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1276 | + <script type="text/javascript" src="./plugins/datatables/js/jquery.dataTables.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1277 | + <script type="text/javascript" src="./plugins/datatables/js/dataTables.bootstrap4.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1278 | + <link rel="stylesheet" src="./plugins/datatables/extensions/Responsive-2.2.2/css/responsive.bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1279 | + <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/dataTables.responsive.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1280 | + <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/responsive.bootstrap4.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1281 | + <script type="text/javascript" src="./plugins/datatables/plugins/select.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1282 | + <link rel="stylesheet" src="./plugins/datatables/extensions/Scroller-1.5.0/css/scroller.bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1283 | + <script type="text/javascript" src="./plugins/datatables/extensions/Scroller-1.5.0/js/dataTables.scroller.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1284 | 1284 | <?php |
| 1285 | 1285 | } elseif (isset($get['page']) === true) { |
| 1286 | 1286 | if (in_array($get['page'], ['items', 'import']) === true) { |
| 1287 | 1287 | ?> |
| 1288 | - <link rel="stylesheet" href="./plugins/jstree/themes/default/style.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" /> |
|
| 1289 | - <link rel="stylesheet" href="./plugins/jstree/themes/default-dark/style.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" /> |
|
| 1290 | - <script src="./plugins/jstree/jstree.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/javascript"></script> |
|
| 1288 | + <link rel="stylesheet" href="./plugins/jstree/themes/default/style.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" /> |
|
| 1289 | + <link rel="stylesheet" href="./plugins/jstree/themes/default-dark/style.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" /> |
|
| 1290 | + <script src="./plugins/jstree/jstree.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/javascript"></script> |
|
| 1291 | 1291 | <!-- countdownTimer --> |
| 1292 | - <script src="./plugins/jquery.countdown360/jquery.countdown360.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1292 | + <script src="./plugins/jquery.countdown360/jquery.countdown360.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1293 | 1293 | <!-- SUMMERNOTE --> |
| 1294 | - <link rel="stylesheet" href="./plugins/summernote/summernote-bs4.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1295 | - <script src="./plugins/summernote/summernote-bs4.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1294 | + <link rel="stylesheet" href="./plugins/summernote/summernote-bs4.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1295 | + <script src="./plugins/summernote/summernote-bs4.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1296 | 1296 | <!-- date-picker --> |
| 1297 | - <link rel="stylesheet" href="./plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1298 | - <script src="./plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1297 | + <link rel="stylesheet" href="./plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1298 | + <script src="./plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1299 | 1299 | <!-- time-picker --> |
| 1300 | - <link rel="stylesheet" href="./plugins/timepicker/bootstrap-timepicker.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1301 | - <script src="./plugins/timepicker/bootstrap-timepicker.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1300 | + <link rel="stylesheet" href="./plugins/timepicker/bootstrap-timepicker.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1301 | + <script src="./plugins/timepicker/bootstrap-timepicker.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1302 | 1302 | <!-- PLUPLOAD --> |
| 1303 | - <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1303 | + <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1304 | 1304 | <!-- VALIDATE --> |
| 1305 | - <script type="text/javascript" src="plugins/jquery-validation/jquery.validate.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1305 | + <script type="text/javascript" src="plugins/jquery-validation/jquery.validate.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1306 | 1306 | <!-- PWSTRENGHT --> |
| 1307 | - <script type="text/javascript" src="plugins/zxcvbn/zxcvbn.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1308 | - <script type="text/javascript" src="plugins/jquery.pwstrength/pwstrength-bootstrap.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1307 | + <script type="text/javascript" src="plugins/zxcvbn/zxcvbn.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1308 | + <script type="text/javascript" src="plugins/jquery.pwstrength/pwstrength-bootstrap.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1309 | 1309 | <!-- TOGGLE --> |
| 1310 | - <link rel="stylesheet" href="./plugins/toggles/css/toggles.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" /> |
|
| 1311 | - <link rel="stylesheet" href="./plugins/toggles/css/toggles-modern.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" /> |
|
| 1312 | - <script src="./plugins/toggles/toggles.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/javascript"></script> |
|
| 1310 | + <link rel="stylesheet" href="./plugins/toggles/css/toggles.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" /> |
|
| 1311 | + <link rel="stylesheet" href="./plugins/toggles/css/toggles-modern.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" /> |
|
| 1312 | + <script src="./plugins/toggles/toggles.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/javascript"></script> |
|
| 1313 | 1313 | <?php |
| 1314 | 1314 | } elseif (in_array($get['page'], ['search', 'folders', 'users', 'roles', 'utilities.deletion', 'utilities.logs', 'utilities.database', 'utilities.renewal', 'tasks']) === true) { |
| 1315 | 1315 | ?> |
| 1316 | 1316 | <!-- DataTables --> |
| 1317 | - <link rel="stylesheet" src="./plugins/datatables/css/jquery.dataTables.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1318 | - <link rel="stylesheet" src="./plugins/datatables/css/dataTables.bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1319 | - <script type="text/javascript" src="./plugins/datatables/js/jquery.dataTables.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1320 | - <script type="text/javascript" src="./plugins/datatables/js/dataTables.bootstrap4.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1321 | - <link rel="stylesheet" src="./plugins/datatables/extensions/Responsive-2.2.2/css/responsive.bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1322 | - <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/dataTables.responsive.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1323 | - <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/responsive.bootstrap4.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1324 | - <script type="text/javascript" src="./plugins/datatables/plugins/select.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1325 | - <link rel="stylesheet" src="./plugins/datatables/extensions/Scroller-1.5.0/css/scroller.bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1326 | - <script type="text/javascript" src="./plugins/datatables/extensions/Scroller-1.5.0/js/dataTables.scroller.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1317 | + <link rel="stylesheet" src="./plugins/datatables/css/jquery.dataTables.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1318 | + <link rel="stylesheet" src="./plugins/datatables/css/dataTables.bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1319 | + <script type="text/javascript" src="./plugins/datatables/js/jquery.dataTables.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1320 | + <script type="text/javascript" src="./plugins/datatables/js/dataTables.bootstrap4.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1321 | + <link rel="stylesheet" src="./plugins/datatables/extensions/Responsive-2.2.2/css/responsive.bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1322 | + <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/dataTables.responsive.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1323 | + <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/responsive.bootstrap4.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1324 | + <script type="text/javascript" src="./plugins/datatables/plugins/select.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1325 | + <link rel="stylesheet" src="./plugins/datatables/extensions/Scroller-1.5.0/css/scroller.bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1326 | + <script type="text/javascript" src="./plugins/datatables/extensions/Scroller-1.5.0/js/dataTables.scroller.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1327 | 1327 | <!-- dater picker --> |
| 1328 | - <link rel="stylesheet" href="./plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1329 | - <script src="./plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1328 | + <link rel="stylesheet" href="./plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1329 | + <script src="./plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1330 | 1330 | <!-- daterange picker --> |
| 1331 | - <link rel="stylesheet" href="./plugins/daterangepicker/daterangepicker.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"> |
|
| 1332 | - <script src="./plugins/moment/moment.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1333 | - <script src="./plugins/daterangepicker/daterangepicker.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1331 | + <link rel="stylesheet" href="./plugins/daterangepicker/daterangepicker.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"> |
|
| 1332 | + <script src="./plugins/moment/moment.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1333 | + <script src="./plugins/daterangepicker/daterangepicker.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1334 | 1334 | <!-- SlimScroll --> |
| 1335 | - <script src="./plugins/slimScroll/jquery.slimscroll.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1335 | + <script src="./plugins/slimScroll/jquery.slimscroll.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1336 | 1336 | <!-- FastClick --> |
| 1337 | - <script src="./plugins/fastclick/fastclick.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1337 | + <script src="./plugins/fastclick/fastclick.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1338 | 1338 | <?php |
| 1339 | 1339 | } elseif ($get['page'] === 'profile') { |
| 1340 | 1340 | ?> |
| 1341 | 1341 | <!-- FILESAVER --> |
| 1342 | - <script type="text/javascript" src="plugins/downloadjs/download.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1342 | + <script type="text/javascript" src="plugins/downloadjs/download.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1343 | 1343 | <!-- PLUPLOAD --> |
| 1344 | - <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1344 | + <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1345 | 1345 | <?php |
| 1346 | 1346 | } elseif ($get['page'] === 'export') { |
| 1347 | 1347 | ?> |
| 1348 | 1348 | <!-- FILESAVER --> |
| 1349 | - <script type="text/javascript" src="plugins/downloadjs/download.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1349 | + <script type="text/javascript" src="plugins/downloadjs/download.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1350 | 1350 | <!-- PWSTRENGHT --> |
| 1351 | - <script type="text/javascript" src="plugins/zxcvbn/zxcvbn.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1352 | - <script type="text/javascript" src="plugins/jquery.pwstrength/pwstrength-bootstrap.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1351 | + <script type="text/javascript" src="plugins/zxcvbn/zxcvbn.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1352 | + <script type="text/javascript" src="plugins/jquery.pwstrength/pwstrength-bootstrap.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1353 | 1353 | <?php |
| 1354 | 1354 | } |
| 1355 | 1355 | } |
| 1356 | 1356 | ?> |
| 1357 | 1357 | <!-- functions --> |
| 1358 | - <script type="text/javascript" src="includes/js/functions.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1359 | - <script type="text/javascript" src="includes/js/CreateRandomString.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1358 | + <script type="text/javascript" src="includes/js/functions.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1359 | + <script type="text/javascript" src="includes/js/CreateRandomString.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1360 | 1360 | <input type="hidden" id="encryptClientServerStatus" value="<?php echo $SETTINGS['encryptClientServer'] ?? 1; ?>" /> |
| 1361 | 1361 | |
| 1362 | 1362 | </body> |
@@ -1398,7 +1398,7 @@ discard block |
||
| 1398 | 1398 | }; |
| 1399 | 1399 | </script> |
| 1400 | 1400 | |
| 1401 | -<script type="text/javascript" src="includes/js/secure-clipboard-cleaner.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script> |
|
| 1401 | +<script type="text/javascript" src="includes/js/secure-clipboard-cleaner.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script> |
|
| 1402 | 1402 | |
| 1403 | 1403 | <script> |
| 1404 | 1404 | $(document).ready(function() { |
@@ -1457,65 +1457,65 @@ discard block |
||
| 1457 | 1457 | |
| 1458 | 1458 | // Load links, css and javascripts |
| 1459 | 1459 | if (isset($SETTINGS['cpassman_dir']) === true) { |
| 1460 | - include_once $SETTINGS['cpassman_dir'] . '/includes/core/load.js.php'; |
|
| 1460 | + include_once $SETTINGS['cpassman_dir'].'/includes/core/load.js.php'; |
|
| 1461 | 1461 | if ($menuAdmin === true) { |
| 1462 | - include_once $SETTINGS['cpassman_dir'] . '/pages/admin.js.php'; |
|
| 1462 | + include_once $SETTINGS['cpassman_dir'].'/pages/admin.js.php'; |
|
| 1463 | 1463 | if ($get['page'] === '2fa') { |
| 1464 | - include_once $SETTINGS['cpassman_dir'] . '/pages/2fa.js.php'; |
|
| 1464 | + include_once $SETTINGS['cpassman_dir'].'/pages/2fa.js.php'; |
|
| 1465 | 1465 | } elseif ($get['page'] === 'api') { |
| 1466 | - include_once $SETTINGS['cpassman_dir'] . '/pages/api.js.php'; |
|
| 1466 | + include_once $SETTINGS['cpassman_dir'].'/pages/api.js.php'; |
|
| 1467 | 1467 | } elseif ($get['page'] === 'backups') { |
| 1468 | - include_once $SETTINGS['cpassman_dir'] . '/pages/backups.js.php'; |
|
| 1468 | + include_once $SETTINGS['cpassman_dir'].'/pages/backups.js.php'; |
|
| 1469 | 1469 | } elseif ($get['page'] === 'emails') { |
| 1470 | - include_once $SETTINGS['cpassman_dir'] . '/pages/emails.js.php'; |
|
| 1470 | + include_once $SETTINGS['cpassman_dir'].'/pages/emails.js.php'; |
|
| 1471 | 1471 | } elseif ($get['page'] === 'ldap') { |
| 1472 | - include_once $SETTINGS['cpassman_dir'] . '/pages/ldap.js.php'; |
|
| 1472 | + include_once $SETTINGS['cpassman_dir'].'/pages/ldap.js.php'; |
|
| 1473 | 1473 | } elseif ($get['page'] === 'uploads') { |
| 1474 | - include_once $SETTINGS['cpassman_dir'] . '/pages/uploads.js.php'; |
|
| 1474 | + include_once $SETTINGS['cpassman_dir'].'/pages/uploads.js.php'; |
|
| 1475 | 1475 | } elseif ($get['page'] === 'fields') { |
| 1476 | - include_once $SETTINGS['cpassman_dir'] . '/pages/fields.js.php'; |
|
| 1476 | + include_once $SETTINGS['cpassman_dir'].'/pages/fields.js.php'; |
|
| 1477 | 1477 | } elseif ($get['page'] === 'options') { |
| 1478 | - include_once $SETTINGS['cpassman_dir'] . '/pages/options.js.php'; |
|
| 1478 | + include_once $SETTINGS['cpassman_dir'].'/pages/options.js.php'; |
|
| 1479 | 1479 | } elseif ($get['page'] === 'statistics') { |
| 1480 | - include_once $SETTINGS['cpassman_dir'] . '/pages/statistics.js.php'; |
|
| 1480 | + include_once $SETTINGS['cpassman_dir'].'/pages/statistics.js.php'; |
|
| 1481 | 1481 | } elseif ($get['page'] === 'tasks') { |
| 1482 | - include_once $SETTINGS['cpassman_dir'] . '/pages/tasks.js.php'; |
|
| 1482 | + include_once $SETTINGS['cpassman_dir'].'/pages/tasks.js.php'; |
|
| 1483 | 1483 | } elseif ($get['page'] === 'oauth') { |
| 1484 | - include_once $SETTINGS['cpassman_dir'] . '/pages/oauth.js.php'; |
|
| 1484 | + include_once $SETTINGS['cpassman_dir'].'/pages/oauth.js.php'; |
|
| 1485 | 1485 | } elseif ($get['page'] === 'tools') { |
| 1486 | - include_once $SETTINGS['cpassman_dir'] . '/pages/tools.js.php'; |
|
| 1486 | + include_once $SETTINGS['cpassman_dir'].'/pages/tools.js.php'; |
|
| 1487 | 1487 | } |
| 1488 | 1488 | } elseif (isset($get['page']) === true && $get['page'] !== '') { |
| 1489 | 1489 | if ($get['page'] === 'items') { |
| 1490 | - include_once $SETTINGS['cpassman_dir'] . '/pages/items.js.php'; |
|
| 1490 | + include_once $SETTINGS['cpassman_dir'].'/pages/items.js.php'; |
|
| 1491 | 1491 | } elseif ($get['page'] === 'import') { |
| 1492 | - include_once $SETTINGS['cpassman_dir'] . '/pages/import.js.php'; |
|
| 1492 | + include_once $SETTINGS['cpassman_dir'].'/pages/import.js.php'; |
|
| 1493 | 1493 | } elseif ($get['page'] === 'export') { |
| 1494 | - include_once $SETTINGS['cpassman_dir'] . '/pages/export.js.php'; |
|
| 1494 | + include_once $SETTINGS['cpassman_dir'].'/pages/export.js.php'; |
|
| 1495 | 1495 | } elseif ($get['page'] === 'offline') { |
| 1496 | - include_once $SETTINGS['cpassman_dir'] . '/pages/offline.js.php'; |
|
| 1496 | + include_once $SETTINGS['cpassman_dir'].'/pages/offline.js.php'; |
|
| 1497 | 1497 | } elseif ($get['page'] === 'search') { |
| 1498 | - include_once $SETTINGS['cpassman_dir'] . '/pages/search.js.php'; |
|
| 1498 | + include_once $SETTINGS['cpassman_dir'].'/pages/search.js.php'; |
|
| 1499 | 1499 | } elseif ($get['page'] === 'profile') { |
| 1500 | - include_once $SETTINGS['cpassman_dir'] . '/pages/profile.js.php'; |
|
| 1500 | + include_once $SETTINGS['cpassman_dir'].'/pages/profile.js.php'; |
|
| 1501 | 1501 | } elseif ($get['page'] === 'favourites') { |
| 1502 | - include_once $SETTINGS['cpassman_dir'] . '/pages/favorites.js.php'; |
|
| 1502 | + include_once $SETTINGS['cpassman_dir'].'/pages/favorites.js.php'; |
|
| 1503 | 1503 | } elseif ($get['page'] === 'folders') { |
| 1504 | - include_once $SETTINGS['cpassman_dir'] . '/pages/folders.js.php'; |
|
| 1504 | + include_once $SETTINGS['cpassman_dir'].'/pages/folders.js.php'; |
|
| 1505 | 1505 | } elseif ($get['page'] === 'users') { |
| 1506 | - include_once $SETTINGS['cpassman_dir'] . '/pages/users.js.php'; |
|
| 1506 | + include_once $SETTINGS['cpassman_dir'].'/pages/users.js.php'; |
|
| 1507 | 1507 | } elseif ($get['page'] === 'roles') { |
| 1508 | - include_once $SETTINGS['cpassman_dir'] . '/pages/roles.js.php'; |
|
| 1508 | + include_once $SETTINGS['cpassman_dir'].'/pages/roles.js.php'; |
|
| 1509 | 1509 | } elseif ($get['page'] === 'utilities.deletion') { |
| 1510 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.deletion.js.php'; |
|
| 1510 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.deletion.js.php'; |
|
| 1511 | 1511 | } elseif ($get['page'] === 'utilities.logs') { |
| 1512 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.logs.js.php'; |
|
| 1512 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.logs.js.php'; |
|
| 1513 | 1513 | } elseif ($get['page'] === 'utilities.database') { |
| 1514 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.database.js.php'; |
|
| 1514 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.database.js.php'; |
|
| 1515 | 1515 | } elseif ($get['page'] === 'utilities.renewal') { |
| 1516 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.renewal.js.php'; |
|
| 1516 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.renewal.js.php'; |
|
| 1517 | 1517 | } |
| 1518 | 1518 | } else { |
| 1519 | - include_once $SETTINGS['cpassman_dir'] . '/includes/core/login.js.php'; |
|
| 1519 | + include_once $SETTINGS['cpassman_dir'].'/includes/core/login.js.php'; |
|
| 1520 | 1520 | } |
| 1521 | 1521 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | require_once __DIR__.'/traits/ItemHandlerTrait.php'; |
| 33 | 33 | require_once __DIR__.'/traits/UserHandlerTrait.php'; |
| 34 | 34 | require_once __DIR__.'/traits/EmailTrait.php'; |
| 35 | -require_once __DIR__ . '/taskLogger.php'; |
|
| 35 | +require_once __DIR__.'/taskLogger.php'; |
|
| 36 | 36 | |
| 37 | 37 | class TaskWorker { |
| 38 | 38 | use ItemHandlerTrait; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function execute() { |
| 66 | 66 | try { |
| 67 | - if (LOG_TASKS=== true) $this->logger->log('Processing task: ' . print_r($this->taskData, true), 'DEBUG'); |
|
| 67 | + if (LOG_TASKS === true) $this->logger->log('Processing task: '.print_r($this->taskData, true), 'DEBUG'); |
|
| 68 | 68 | // Dispatch selon le type de processus |
| 69 | 69 | switch ($this->processType) { |
| 70 | 70 | case 'item_copy': |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $arguments = ''; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - if (LOG_TASKS=== true) $this->logger->log('Process: '.$this->processType.' -- '.print_r($arguments, true), 'DEBUG'); |
|
| 139 | + if (LOG_TASKS === true) $this->logger->log('Process: '.$this->processType.' -- '.print_r($arguments, true), 'DEBUG'); |
|
| 140 | 140 | |
| 141 | 141 | // Add 'arguments' only if not empty |
| 142 | 142 | if (!empty($arguments)) { |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | 'increment_id = %i', |
| 151 | 151 | $this->taskId |
| 152 | 152 | ); |
| 153 | - if (LOG_TASKS=== true) $this->logger->log('Finishing task: ' . $this->taskId, 'DEBUG'); |
|
| 153 | + if (LOG_TASKS === true) $this->logger->log('Finishing task: '.$this->taskId, 'DEBUG'); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | 'increment_id = %i', |
| 174 | 174 | $this->taskId |
| 175 | 175 | ); |
| 176 | - $this->logger->log('Task failure: ' . $e->getMessage(), 'ERROR'); |
|
| 176 | + $this->logger->log('Task failure: '.$e->getMessage(), 'ERROR'); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
@@ -185,16 +185,16 @@ discard block |
||
| 185 | 185 | * @return void |
| 186 | 186 | */ |
| 187 | 187 | private function processSubTasks($arguments) { |
| 188 | - if (LOG_TASKS=== true) $this->logger->log('processSubTasks: '.print_r($arguments, true), 'DEBUG'); |
|
| 188 | + if (LOG_TASKS === true) $this->logger->log('processSubTasks: '.print_r($arguments, true), 'DEBUG'); |
|
| 189 | 189 | // Get all subtasks related to this task |
| 190 | 190 | $subtasks = DB::query( |
| 191 | - 'SELECT * FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC', |
|
| 191 | + 'SELECT * FROM '.prefixTable('background_subtasks').' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC', |
|
| 192 | 192 | $this->taskId |
| 193 | 193 | ); |
| 194 | 194 | |
| 195 | 195 | // Check if there are any subtasks to process |
| 196 | 196 | if (empty($subtasks)) { |
| 197 | - if (LOG_TASKS=== true) $this->logger->log('No subtask was found for task: ' . $this->taskId, 'DEBUG'); |
|
| 197 | + if (LOG_TASKS === true) $this->logger->log('No subtask was found for task: '.$this->taskId, 'DEBUG'); |
|
| 198 | 198 | return; |
| 199 | 199 | } |
| 200 | 200 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | // Get the subtask data |
| 205 | 205 | $subtaskData = json_decode($subtask['task'], true); |
| 206 | 206 | |
| 207 | - if (LOG_TASKS=== true) $this->logger->log('Processing subtask: ' . $subtaskData['step'], 'DEBUG'); |
|
| 207 | + if (LOG_TASKS === true) $this->logger->log('Processing subtask: '.$subtaskData['step'], 'DEBUG'); |
|
| 208 | 208 | |
| 209 | 209 | // Mark subtask as in progress |
| 210 | 210 | DB::update( |
@@ -256,13 +256,13 @@ discard block |
||
| 256 | 256 | $subtask['increment_id'] |
| 257 | 257 | ); |
| 258 | 258 | |
| 259 | - $this->logger->log('processSubTasks : ' . $e->getMessage(), 'ERROR'); |
|
| 259 | + $this->logger->log('processSubTasks : '.$e->getMessage(), 'ERROR'); |
|
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | // Are all subtasks completed? |
| 264 | 264 | $remainingSubtasks = DB::queryFirstField( |
| 265 | - 'SELECT COUNT(*) FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0', |
|
| 265 | + 'SELECT COUNT(*) FROM '.prefixTable('background_subtasks').' WHERE task_id = %i AND is_in_progress = 0', |
|
| 266 | 266 | $this->taskId |
| 267 | 267 | ); |
| 268 | 268 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | error_log("Usage: php background_tasks___worker.php <task_id> <process_type> [<task_data>]"); |
| 279 | 279 | exit(1); |
| 280 | 280 | } |
| 281 | -$taskId = (int)$argv[1]; |
|
| 281 | +$taskId = (int) $argv[1]; |
|
| 282 | 282 | $processType = $argv[2]; |
| 283 | 283 | $taskData = $argv[3] ?? null; |
| 284 | 284 | if ($taskData) { |
@@ -64,7 +64,9 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function execute() { |
| 66 | 66 | try { |
| 67 | - if (LOG_TASKS=== true) $this->logger->log('Processing task: ' . print_r($this->taskData, true), 'DEBUG'); |
|
| 67 | + if (LOG_TASKS=== true) { |
|
| 68 | + $this->logger->log('Processing task: ' . print_r($this->taskData, true), 'DEBUG'); |
|
| 69 | + } |
|
| 68 | 70 | // Dispatch selon le type de processus |
| 69 | 71 | switch ($this->processType) { |
| 70 | 72 | case 'item_copy': |
@@ -136,7 +138,9 @@ discard block |
||
| 136 | 138 | $arguments = ''; |
| 137 | 139 | } |
| 138 | 140 | |
| 139 | - if (LOG_TASKS=== true) $this->logger->log('Process: '.$this->processType.' -- '.print_r($arguments, true), 'DEBUG'); |
|
| 141 | + if (LOG_TASKS=== true) { |
|
| 142 | + $this->logger->log('Process: '.$this->processType.' -- '.print_r($arguments, true), 'DEBUG'); |
|
| 143 | + } |
|
| 140 | 144 | |
| 141 | 145 | // Add 'arguments' only if not empty |
| 142 | 146 | if (!empty($arguments)) { |
@@ -150,7 +154,9 @@ discard block |
||
| 150 | 154 | 'increment_id = %i', |
| 151 | 155 | $this->taskId |
| 152 | 156 | ); |
| 153 | - if (LOG_TASKS=== true) $this->logger->log('Finishing task: ' . $this->taskId, 'DEBUG'); |
|
| 157 | + if (LOG_TASKS=== true) { |
|
| 158 | + $this->logger->log('Finishing task: ' . $this->taskId, 'DEBUG'); |
|
| 159 | + } |
|
| 154 | 160 | } |
| 155 | 161 | |
| 156 | 162 | /** |
@@ -185,7 +191,9 @@ discard block |
||
| 185 | 191 | * @return void |
| 186 | 192 | */ |
| 187 | 193 | private function processSubTasks($arguments) { |
| 188 | - if (LOG_TASKS=== true) $this->logger->log('processSubTasks: '.print_r($arguments, true), 'DEBUG'); |
|
| 194 | + if (LOG_TASKS=== true) { |
|
| 195 | + $this->logger->log('processSubTasks: '.print_r($arguments, true), 'DEBUG'); |
|
| 196 | + } |
|
| 189 | 197 | // Get all subtasks related to this task |
| 190 | 198 | $subtasks = DB::query( |
| 191 | 199 | 'SELECT * FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC', |
@@ -194,7 +202,9 @@ discard block |
||
| 194 | 202 | |
| 195 | 203 | // Check if there are any subtasks to process |
| 196 | 204 | if (empty($subtasks)) { |
| 197 | - if (LOG_TASKS=== true) $this->logger->log('No subtask was found for task: ' . $this->taskId, 'DEBUG'); |
|
| 205 | + if (LOG_TASKS=== true) { |
|
| 206 | + $this->logger->log('No subtask was found for task: ' . $this->taskId, 'DEBUG'); |
|
| 207 | + } |
|
| 198 | 208 | return; |
| 199 | 209 | } |
| 200 | 210 | |
@@ -204,7 +214,9 @@ discard block |
||
| 204 | 214 | // Get the subtask data |
| 205 | 215 | $subtaskData = json_decode($subtask['task'], true); |
| 206 | 216 | |
| 207 | - if (LOG_TASKS=== true) $this->logger->log('Processing subtask: ' . $subtaskData['step'], 'DEBUG'); |
|
| 217 | + if (LOG_TASKS=== true) { |
|
| 218 | + $this->logger->log('Processing subtask: ' . $subtaskData['step'], 'DEBUG'); |
|
| 219 | + } |
|
| 208 | 220 | |
| 209 | 221 | // Mark subtask as in progress |
| 210 | 222 | DB::update( |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | ) { |
| 79 | 79 | // Not allowed page |
| 80 | 80 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 81 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 81 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 82 | 82 | exit; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $antiXss = new AntiXSS(); |
| 101 | 101 | |
| 102 | 102 | // User's language loading |
| 103 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $session->get('user-language') . '.php'; |
|
| 103 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$session->get('user-language').'.php'; |
|
| 104 | 104 | |
| 105 | 105 | // Prepare POST variables |
| 106 | 106 | $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT); |
@@ -151,9 +151,9 @@ discard block |
||
| 151 | 151 | 'SELECT i.id as id, i.id_tree as id_tree, i.restricted_to as restricted_to, i.perso as perso, |
| 152 | 152 | i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url, |
| 153 | 153 | i.email as email,l.date as date, i.pw_iv as pw_iv,n.renewal_period as renewal_period |
| 154 | - FROM ' . prefixTable('items') . ' as i |
|
| 155 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 156 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 154 | + FROM ' . prefixTable('items').' as i |
|
| 155 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 156 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 157 | 157 | WHERE i.inactif = %i |
| 158 | 158 | AND i.id_tree= %i |
| 159 | 159 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -176,8 +176,8 @@ discard block |
||
| 176 | 176 | // Run query |
| 177 | 177 | $dataItem = DB::queryFirstRow( |
| 178 | 178 | 'SELECT i.pw AS pw, s.share_key AS share_key |
| 179 | - FROM ' . prefixTable('items') . ' AS i |
|
| 180 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id) |
|
| 179 | + FROM ' . prefixTable('items').' AS i |
|
| 180 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id) |
|
| 181 | 181 | WHERE user_id = %i AND i.id = %i', |
| 182 | 182 | $session->get('user-id'), |
| 183 | 183 | $record['id'] |
@@ -201,8 +201,8 @@ discard block |
||
| 201 | 201 | $arr_kbs = []; |
| 202 | 202 | $rows_kb = DB::query( |
| 203 | 203 | 'SELECT b.label, b.id |
| 204 | - FROM ' . prefixTable('kb_items') . ' AS a |
|
| 205 | - INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id) |
|
| 204 | + FROM ' . prefixTable('kb_items').' AS a |
|
| 205 | + INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id) |
|
| 206 | 206 | WHERE a.item_id = %i', |
| 207 | 207 | $record['id'] |
| 208 | 208 | ); |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $arr_tags = []; |
| 215 | 215 | $rows_tag = DB::query( |
| 216 | 216 | 'SELECT tag |
| 217 | - FROM ' . prefixTable('tags') . ' |
|
| 217 | + FROM ' . prefixTable('tags').' |
|
| 218 | 218 | WHERE item_id = %i', |
| 219 | 219 | $record['id'] |
| 220 | 220 | ); |
@@ -226,18 +226,18 @@ discard block |
||
| 226 | 226 | $arr_trees = []; |
| 227 | 227 | $rows_child_tree = DB::query( |
| 228 | 228 | 'SELECT t.id, t.title |
| 229 | - FROM ' . prefixTable('nested_tree') . ' AS t |
|
| 230 | - INNER JOIN ' . prefixTable('items') . ' AS i ON (t.id = i.id_tree) |
|
| 229 | + FROM ' . prefixTable('nested_tree').' AS t |
|
| 230 | + INNER JOIN ' . prefixTable('items').' AS i ON (t.id = i.id_tree) |
|
| 231 | 231 | WHERE i.id = %i', |
| 232 | 232 | $record['id'] |
| 233 | 233 | ); |
| 234 | 234 | foreach ($rows_child_tree as $rec_child_tree) { |
| 235 | 235 | $stack = array(); |
| 236 | 236 | $parent = $rec_child_tree['id']; |
| 237 | - while($parent != 0){ |
|
| 237 | + while ($parent != 0) { |
|
| 238 | 238 | $rows_parent_tree = DB::query( |
| 239 | 239 | 'SELECT parent_id, title |
| 240 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 240 | + FROM ' . prefixTable('nested_tree').' |
|
| 241 | 241 | WHERE id = %i', |
| 242 | 242 | $parent |
| 243 | 243 | ); |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | // Prepare variables |
| 325 | 325 | $post_export_tag = filter_var($dataReceived['export_tag'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
| 326 | 326 | if (empty($post_export_tag) === false) { |
| 327 | - DB::query('DELETE FROM ' . prefixTable('export') . ' WHERE export_tag = %s', $post_export_tag); |
|
| 327 | + DB::query('DELETE FROM '.prefixTable('export').' WHERE export_tag = %s', $post_export_tag); |
|
| 328 | 328 | } |
| 329 | 329 | break; |
| 330 | 330 | |
@@ -374,9 +374,9 @@ discard block |
||
| 374 | 374 | l.date as date, i.pw_iv as pw_iv, |
| 375 | 375 | n.renewal_period as renewal_period, |
| 376 | 376 | i.id_tree as tree_id |
| 377 | - FROM ' . prefixTable('items') . ' as i |
|
| 378 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 379 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 377 | + FROM ' . prefixTable('items').' as i |
|
| 378 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 379 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 380 | 380 | WHERE i.inactif = %i |
| 381 | 381 | AND i.id_tree= %i |
| 382 | 382 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -402,8 +402,8 @@ discard block |
||
| 402 | 402 | // Run query |
| 403 | 403 | $dataItem = DB::queryFirstRow( |
| 404 | 404 | 'SELECT i.pw AS pw, s.share_key AS share_key |
| 405 | - FROM ' . prefixTable('items') . ' AS i |
|
| 406 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id) |
|
| 405 | + FROM ' . prefixTable('items').' AS i |
|
| 406 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id) |
|
| 407 | 407 | WHERE user_id = %i AND i.id = %i', |
| 408 | 408 | $session->get('user-id'), |
| 409 | 409 | $record['id'] |
@@ -427,8 +427,8 @@ discard block |
||
| 427 | 427 | $arr_kbs = ''; |
| 428 | 428 | $rows_kb = DB::query( |
| 429 | 429 | 'SELECT b.label, b.id |
| 430 | - FROM ' . prefixTable('kb_items') . ' AS a |
|
| 431 | - INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id) |
|
| 430 | + FROM ' . prefixTable('kb_items').' AS a |
|
| 431 | + INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id) |
|
| 432 | 432 | WHERE a.item_id = %i', |
| 433 | 433 | $record['id'] |
| 434 | 434 | ); |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | if (empty($arr_kbs)) { |
| 437 | 437 | $arr_kbs = $rec_kb['label']; |
| 438 | 438 | } else { |
| 439 | - $arr_kbs .= ' | ' . $rec_kb['label']; |
|
| 439 | + $arr_kbs .= ' | '.$rec_kb['label']; |
|
| 440 | 440 | } |
| 441 | 441 | } |
| 442 | 442 | |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | $arr_tags = ''; |
| 445 | 445 | $rows_tag = DB::query( |
| 446 | 446 | 'SELECT tag |
| 447 | - FROM ' . prefixTable('tags') . ' |
|
| 447 | + FROM ' . prefixTable('tags').' |
|
| 448 | 448 | WHERE item_id = %i', |
| 449 | 449 | $record['id'] |
| 450 | 450 | ); |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | if (empty($arr_tags)) { |
| 453 | 453 | $arr_tags = $rec_tag['tag']; |
| 454 | 454 | } else { |
| 455 | - $arr_tags .= ' ' . $rec_tag['tag']; |
|
| 455 | + $arr_tags .= ' '.$rec_tag['tag']; |
|
| 456 | 456 | } |
| 457 | 457 | } |
| 458 | 458 | |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | // query |
| 531 | 531 | $rows = DB::query( |
| 532 | 532 | 'SELECT * |
| 533 | - FROM ' . prefixTable('export') . ' |
|
| 533 | + FROM ' . prefixTable('export').' |
|
| 534 | 534 | WHERE export_tag = %s', |
| 535 | 535 | $dataReceived['export_tag'] |
| 536 | 536 | ); |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | $prev_path = ''; |
| 543 | 543 | |
| 544 | 544 | //Prepare the PDF file |
| 545 | - require_once $SETTINGS['cpassman_dir'] . '/vendor/tecnickcom/tcpdf/tcpdf.php'; |
|
| 545 | + require_once $SETTINGS['cpassman_dir'].'/vendor/tecnickcom/tcpdf/tcpdf.php'; |
|
| 546 | 546 | |
| 547 | 547 | $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); |
| 548 | 548 | $pdf->SetProtection(array('print'), $dataReceived['pdf_password'], null); |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | |
| 555 | 555 | // set default header data |
| 556 | 556 | $pdf->SetHeaderData( |
| 557 | - $SETTINGS['cpassman_dir'] . '/includes/images/teampass-logo2-home.png', |
|
| 557 | + $SETTINGS['cpassman_dir'].'/includes/images/teampass-logo2-home.png', |
|
| 558 | 558 | PDF_HEADER_LOGO_WIDTH, |
| 559 | 559 | 'Teampass export', |
| 560 | 560 | $session->get('user-lastname')." ".$session->get('user-name').' @ '.date($SETTINGS['date_format']." ".$SETTINGS['time_format'], (int) time()) |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | logEvents($SETTINGS, 'pdf_export', '', (string) $session->get('user-id'), $session->get('user-login')); |
| 665 | 665 | |
| 666 | 666 | //clean table |
| 667 | - DB::query('TRUNCATE TABLE ' . prefixTable('export')); |
|
| 667 | + DB::query('TRUNCATE TABLE '.prefixTable('export')); |
|
| 668 | 668 | |
| 669 | 669 | // Clean any content of the output buffer |
| 670 | 670 | ob_end_clean(); |
@@ -702,13 +702,13 @@ discard block |
||
| 702 | 702 | // step 1: |
| 703 | 703 | // - prepare export file |
| 704 | 704 | // - get full list of objects id to export |
| 705 | - include $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 705 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 706 | 706 | $idsList = array(); |
| 707 | 707 | |
| 708 | 708 | // query |
| 709 | 709 | $rows = DB::query( |
| 710 | 710 | 'SELECT * |
| 711 | - FROM ' . prefixTable('export') . ' |
|
| 711 | + FROM ' . prefixTable('export').' |
|
| 712 | 712 | WHERE export_tag = %s', |
| 713 | 713 | $inputData['export_tag'] |
| 714 | 714 | ); |
@@ -745,13 +745,13 @@ discard block |
||
| 745 | 745 | } |
| 746 | 746 | // prepare export file |
| 747 | 747 | //save the file |
| 748 | - $outstream = fopen($SETTINGS['path_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'], 'w'); |
|
| 748 | + $outstream = fopen($SETTINGS['path_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'], 'w'); |
|
| 749 | 749 | if ($outstream === false) { |
| 750 | 750 | echo (string) prepareExchangedData( |
| 751 | 751 | [ |
| 752 | 752 | 'error' => true, |
| 753 | 753 | 'message' => $lang->get('error_while_creating_file'), |
| 754 | - 'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'], |
|
| 754 | + 'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'], |
|
| 755 | 755 | ], |
| 756 | 756 | 'encode' |
| 757 | 757 | ); |
@@ -777,12 +777,12 @@ discard block |
||
| 777 | 777 | </style> |
| 778 | 778 | </head> |
| 779 | 779 | <body> |
| 780 | - <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $inputData['password']) . '" /> |
|
| 780 | + <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $inputData['password']).'" /> |
|
| 781 | 781 | <div id="header"> |
| 782 | - ' . TP_TOOL_NAME . ' - Off Line mode |
|
| 782 | + ' . TP_TOOL_NAME.' - Off Line mode |
|
| 783 | 783 | </div> |
| 784 | 784 | <div style="margin:10px; font-size:9px;"> |
| 785 | - <i>This page was generated by <b>' . $session->get('user-name') . ' ' . $session->get('user-lastname') . '</b>, the ' . date('Y/m/d H:i:s') . '.</i> |
|
| 785 | + <i>This page was generated by <b>' . $session->get('user-name').' '.$session->get('user-lastname').'</b>, the '.date('Y/m/d H:i:s').'.</i> |
|
| 786 | 786 | <span id="info_page" style="margin-left:20px; font-weight:bold; font-size: 14px; color:red;"></span> |
| 787 | 787 | </div> |
| 788 | 788 | <div id="information"></div> |
@@ -793,11 +793,11 @@ discard block |
||
| 793 | 793 | <div> |
| 794 | 794 | <table id="itemsTable"> |
| 795 | 795 | <thead><tr> |
| 796 | - <th style="width:15%;">' . $lang->get('label') . '</th> |
|
| 797 | - <th style="width:10%;">' . $lang->get('pw') . '</th> |
|
| 798 | - <th style="width:30%;">' . $lang->get('description') . '</th> |
|
| 799 | - <th style="width:5%;">' . $lang->get('user_login') . '</th> |
|
| 800 | - <th style="width:20%;">' . $lang->get('url') . '</th> |
|
| 796 | + <th style="width:15%;">' . $lang->get('label').'</th> |
|
| 797 | + <th style="width:10%;">' . $lang->get('pw').'</th> |
|
| 798 | + <th style="width:30%;">' . $lang->get('description').'</th> |
|
| 799 | + <th style="width:5%;">' . $lang->get('user_login').'</th> |
|
| 800 | + <th style="width:20%;">' . $lang->get('url').'</th> |
|
| 801 | 801 | </tr></thead> |
| 802 | 802 | <tbody id="itemsTable_tbody">' |
| 803 | 803 | ); |
@@ -811,8 +811,8 @@ discard block |
||
| 811 | 811 | 'loop' => true, |
| 812 | 812 | 'ids_list' => json_encode($idsList), |
| 813 | 813 | 'ids_count' => count($idsList), |
| 814 | - 'file_path' => $SETTINGS['path_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'], |
|
| 815 | - 'file_link' => $SETTINGS['url_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'], |
|
| 814 | + 'file_path' => $SETTINGS['path_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'], |
|
| 815 | + 'file_link' => $SETTINGS['url_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'], |
|
| 816 | 816 | 'export_tag' => $inputData['export_tag'], |
| 817 | 817 | ], |
| 818 | 818 | 'encode' |
@@ -851,12 +851,12 @@ discard block |
||
| 851 | 851 | $full_listing = array(); |
| 852 | 852 | $items_id_list = array(); |
| 853 | 853 | $outstream = ''; |
| 854 | - include $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 854 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 855 | 855 | |
| 856 | 856 | // query |
| 857 | 857 | $rows = DB::query( |
| 858 | 858 | 'SELECT * |
| 859 | - FROM ' . prefixTable('export') . ' |
|
| 859 | + FROM ' . prefixTable('export').' |
|
| 860 | 860 | WHERE export_tag = %s AND item_id IN %ls', |
| 861 | 861 | $inputData['export_tag'], |
| 862 | 862 | $inputData['idsList'] |
@@ -870,7 +870,7 @@ discard block |
||
| 870 | 870 | [ |
| 871 | 871 | 'error' => true, |
| 872 | 872 | 'message' => $lang->get('error_while_creating_file'), |
| 873 | - 'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'], |
|
| 873 | + 'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'], |
|
| 874 | 874 | ], |
| 875 | 875 | 'encode' |
| 876 | 876 | ); |
@@ -903,13 +903,13 @@ discard block |
||
| 903 | 903 | if (empty($arboHtml)) { |
| 904 | 904 | $arboHtml = $arboHtml_tmp; |
| 905 | 905 | } else { |
| 906 | - $arboHtml .= ' » ' . $arboHtml_tmp; |
|
| 906 | + $arboHtml .= ' » '.$arboHtml_tmp; |
|
| 907 | 907 | } |
| 908 | 908 | } |
| 909 | 909 | fputs( |
| 910 | 910 | $outstream, |
| 911 | 911 | ' |
| 912 | - <tr class="path"><td colspan="5">' . $arboHtml . '</td></tr>' |
|
| 912 | + <tr class="path"><td colspan="5">' . $arboHtml.'</td></tr>' |
|
| 913 | 913 | ); |
| 914 | 914 | $idTree = $record['folder_id']; |
| 915 | 915 | |
@@ -917,12 +917,12 @@ discard block |
||
| 917 | 917 | fputs( |
| 918 | 918 | $outstream, |
| 919 | 919 | ' |
| 920 | - <tr class="' . $lineType . '"> |
|
| 921 | - <td>' . addslashes($record['label']) . '</td> |
|
| 922 | - <td align="center"><span class="span_pw" id="span_' . $record['item_id'] . '"><a href="#" onclick="decryptme(' . $record['item_id'] . ', \'' . $encPw . '\');return false;">Decrypt </a></span><input type="hidden" id="hide_' . $record['item_id'] . '" value="' . $encPw . '" /></td> |
|
| 923 | - <td>' . (empty($record['description']) === true ? ' ' : addslashes(str_replace(array(';', '<br />'), array('|', "\n\r"), stripslashes(mb_convert_encoding($record['description'], 'ISO-8859-1', 'UTF-8'))))) . '</td> |
|
| 924 | - <td align="center">' . (empty($record['login']) === true ? ' ' : addslashes($record['login'])) . '</td> |
|
| 925 | - <td align="center">' . (empty($record['url']) === true ? ' ' : addslashes($record['url'])) . '</td> |
|
| 920 | + <tr class="' . $lineType.'"> |
|
| 921 | + <td>' . addslashes($record['label']).'</td> |
|
| 922 | + <td align="center"><span class="span_pw" id="span_' . $record['item_id'].'"><a href="#" onclick="decryptme('.$record['item_id'].', \''.$encPw.'\');return false;">Decrypt </a></span><input type="hidden" id="hide_'.$record['item_id'].'" value="'.$encPw.'" /></td> |
|
| 923 | + <td>' . (empty($record['description']) === true ? ' ' : addslashes(str_replace(array(';', '<br />'), array('|', "\n\r"), stripslashes(mb_convert_encoding($record['description'], 'ISO-8859-1', 'UTF-8'))))).'</td> |
|
| 924 | + <td align="center">' . (empty($record['login']) === true ? ' ' : addslashes($record['login'])).'</td> |
|
| 925 | + <td align="center">' . (empty($record['url']) === true ? ' ' : addslashes($record['url'])).'</td> |
|
| 926 | 926 | </tr>' |
| 927 | 927 | ); |
| 928 | 928 | } |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | $inputData['password'] = (string) filter_var($dataReceived['password'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
| 972 | 972 | |
| 973 | 973 | // Load includes |
| 974 | - include $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 974 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 975 | 975 | |
| 976 | 976 | // read the content of the temporary file |
| 977 | 977 | $handle = fopen($inputData['filename'].'.txt', 'r'); |
@@ -980,7 +980,7 @@ discard block |
||
| 980 | 980 | [ |
| 981 | 981 | 'error' => true, |
| 982 | 982 | 'message' => $lang->get('error_while_creating_file'), |
| 983 | - 'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'], |
|
| 983 | + 'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'], |
|
| 984 | 984 | ], |
| 985 | 985 | 'encode' |
| 986 | 986 | ); |
@@ -992,7 +992,7 @@ discard block |
||
| 992 | 992 | [ |
| 993 | 993 | 'error' => true, |
| 994 | 994 | 'message' => $lang->get('error_while_creating_file'), |
| 995 | - 'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'], |
|
| 995 | + 'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'], |
|
| 996 | 996 | ], |
| 997 | 997 | 'encode' |
| 998 | 998 | ); |
@@ -1008,9 +1008,9 @@ discard block |
||
| 1008 | 1008 | $chunks = explode('|#|#|', chunk_split($contents, 10000, '|#|#|')); |
| 1009 | 1009 | foreach ($chunks as $chunk) { |
| 1010 | 1010 | if (empty($encrypted_text) === true) { |
| 1011 | - $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password'] ); |
|
| 1011 | + $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password']); |
|
| 1012 | 1012 | } else { |
| 1013 | - $encrypted_text .= '|#|#|' . GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password'] ); |
|
| 1013 | + $encrypted_text .= '|#|#|'.GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password']); |
|
| 1014 | 1014 | } |
| 1015 | 1015 | } |
| 1016 | 1016 | |
@@ -1021,7 +1021,7 @@ discard block |
||
| 1021 | 1021 | [ |
| 1022 | 1022 | 'error' => true, |
| 1023 | 1023 | 'message' => $lang->get('error_while_creating_file'), |
| 1024 | - 'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'], |
|
| 1024 | + 'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'], |
|
| 1025 | 1025 | ], |
| 1026 | 1026 | 'encode' |
| 1027 | 1027 | ); |
@@ -1034,9 +1034,9 @@ discard block |
||
| 1034 | 1034 | </table></div> |
| 1035 | 1035 | <input type="button" value="Hide all" onclick="hideAll()" /> |
| 1036 | 1036 | <div id="footer" style="text-align:center;"> |
| 1037 | - <a href="https://teampass.net/about/" target="_blank">' . TP_TOOL_NAME . ' ' . TP_VERSION . ' ' . TP_COPYRIGHT . '</a> |
|
| 1037 | + <a href="https://teampass.net/about/" target="_blank">' . TP_TOOL_NAME.' '.TP_VERSION.' '.TP_COPYRIGHT.'</a> |
|
| 1038 | 1038 | </div> |
| 1039 | - <div id="enc_html" style="display:none;">' . $encrypted_text . '</div> |
|
| 1039 | + <div id="enc_html" style="display:none;">' . $encrypted_text.'</div> |
|
| 1040 | 1040 | </body> |
| 1041 | 1041 | </html> |
| 1042 | 1042 | <script type="text/javascript"> |
@@ -1139,12 +1139,12 @@ discard block |
||
| 1139 | 1139 | fclose($outstream); |
| 1140 | 1140 | |
| 1141 | 1141 | //clean table |
| 1142 | - DB::query('TRUNCATE TABLE ' . prefixTable('export')); |
|
| 1142 | + DB::query('TRUNCATE TABLE '.prefixTable('export')); |
|
| 1143 | 1143 | |
| 1144 | 1144 | echo (string) prepareExchangedData( |
| 1145 | 1145 | [ |
| 1146 | 1146 | 'error' => false, |
| 1147 | - 'filelink' => $inputData['file_link'] , |
|
| 1147 | + 'filelink' => $inputData['file_link'], |
|
| 1148 | 1148 | ], |
| 1149 | 1149 | 'encode' |
| 1150 | 1150 | ); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | ) { |
| 77 | 77 | // Not allowed page |
| 78 | 78 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 79 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 79 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 80 | 80 | exit; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -134,13 +134,13 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | header('Content-Description: File Transfer'); |
| 136 | 136 | header('Content-Type: application/octet-stream'); |
| 137 | - header('Content-Disposition: attachment; filename="' . $safeFilename . '"'); |
|
| 137 | + header('Content-Disposition: attachment; filename="'.$safeFilename.'"'); |
|
| 138 | 138 | header('Cache-Control: must-revalidate, no-cache, no-store'); |
| 139 | 139 | header('Pragma: public'); |
| 140 | 140 | header('Expires: 0'); |
| 141 | 141 | |
| 142 | 142 | if ($filesize !== null) { |
| 143 | - header('Content-Length: ' . $filesize); |
|
| 143 | + header('Content-Length: '.$filesize); |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | return false; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - $filepath = $basePath . '/' . basename($filename); |
|
| 155 | + $filepath = $basePath.'/'.basename($filename); |
|
| 156 | 156 | |
| 157 | 157 | // Security: Verify the resolved path is within the allowed directory |
| 158 | 158 | $realBasePath = realpath($basePath); |
@@ -230,8 +230,8 @@ discard block |
||
| 230 | 230 | $file_info = DB::queryFirstRow( |
| 231 | 231 | 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension, |
| 232 | 232 | s.share_key AS share_key |
| 233 | - FROM ' . prefixTable('files') . ' AS f |
|
| 234 | - INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id) |
|
| 233 | + FROM ' . prefixTable('files').' AS f |
|
| 234 | + INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id) |
|
| 235 | 235 | WHERE s.user_id = %i AND s.object_id = %i', |
| 236 | 236 | $session->get('user-id'), |
| 237 | 237 | $get_fileid |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | // Get unencrypted file info |
| 252 | 252 | $file_info = DB::queryFirstRow( |
| 253 | 253 | 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension |
| 254 | - FROM ' . prefixTable('files') . ' AS f |
|
| 254 | + FROM ' . prefixTable('files').' AS f |
|
| 255 | 255 | WHERE f.id = %i', |
| 256 | 256 | $get_fileid |
| 257 | 257 | ); |
@@ -263,13 +263,13 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | // Prepare filename for download |
| 265 | 265 | $filename = str_replace('b64:', '', $file_info['name']); |
| 266 | - $filename = basename($filename, '.' . $file_info['extension']); |
|
| 266 | + $filename = basename($filename, '.'.$file_info['extension']); |
|
| 267 | 267 | $filename = isBase64($filename) === true ? base64_decode($filename) : $filename; |
| 268 | - $filename = $filename . '.' . $file_info['extension']; |
|
| 268 | + $filename = $filename.'.'.$file_info['extension']; |
|
| 269 | 269 | |
| 270 | 270 | // Determine file path |
| 271 | - $candidatePath1 = $SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . $file_info['file']; |
|
| 272 | - $candidatePath2 = $SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($file_info['file']); |
|
| 271 | + $candidatePath1 = $SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.$file_info['file']; |
|
| 272 | + $candidatePath2 = $SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($file_info['file']); |
|
| 273 | 273 | |
| 274 | 274 | $filePath = false; |
| 275 | 275 | if (file_exists($candidatePath1)) { |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | if (WIP === true) { |
| 282 | - error_log('downloadFile.php: filePath: ' . $filePath . " - "); |
|
| 282 | + error_log('downloadFile.php: filePath: '.$filePath." - "); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | // Validate file path and security |
@@ -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 | } |
@@ -271,9 +271,9 @@ discard block |
||
| 271 | 271 | array( |
| 272 | 272 | 'error' => false, |
| 273 | 273 | 'message' => '', |
| 274 | - 'download' => 'sources/downloadFile.php?name=' . urlencode($filename) . |
|
| 275 | - '&action=backup&file=' . $filename . '&type=sql&key=' . $session->get('key') . '&key_tmp=' . |
|
| 276 | - $session->get('user-key_tmp') . '&pathIsFiles=1', |
|
| 274 | + 'download' => 'sources/downloadFile.php?name='.urlencode($filename). |
|
| 275 | + '&action=backup&file='.$filename.'&type=sql&key='.$session->get('key').'&key_tmp='. |
|
| 276 | + $session->get('user-key_tmp').'&pathIsFiles=1', |
|
| 277 | 277 | ), |
| 278 | 278 | 'encode' |
| 279 | 279 | ); |
@@ -334,13 +334,13 @@ discard block |
||
| 334 | 334 | error_log('DEBUG: Offset -> '.$post_offset.'/'.$post_totalSize.' | File -> '.$post_clearFilename.' | key -> '.$post_key); |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 337 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 338 | 338 | |
| 339 | 339 | if (empty($post_clearFilename) === true) { |
| 340 | 340 | // Get filename from database |
| 341 | 341 | $data = DB::queryFirstRow( |
| 342 | 342 | 'SELECT valeur |
| 343 | - FROM ' . prefixTable('misc') . ' |
|
| 343 | + FROM ' . prefixTable('misc').' |
|
| 344 | 344 | WHERE increment_id = %i', |
| 345 | 345 | $post_backupFile |
| 346 | 346 | ); |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | $post_backupFile = safeString($data['valeur']); |
| 368 | 368 | |
| 369 | 369 | // Verify file exists |
| 370 | - if (!file_exists($SETTINGS['path_to_files_folder'] . '/' . $post_backupFile)) { |
|
| 370 | + if (!file_exists($SETTINGS['path_to_files_folder'].'/'.$post_backupFile)) { |
|
| 371 | 371 | echo prepareExchangedData( |
| 372 | 372 | array( |
| 373 | 373 | 'error' => true, |
@@ -384,8 +384,8 @@ discard block |
||
| 384 | 384 | // Decrypt the file |
| 385 | 385 | $ret = prepareFileWithDefuse( |
| 386 | 386 | 'decrypt', |
| 387 | - $SETTINGS['path_to_files_folder'] . '/' . $post_backupFile, |
|
| 388 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $post_backupFile, |
|
| 387 | + $SETTINGS['path_to_files_folder'].'/'.$post_backupFile, |
|
| 388 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$post_backupFile, |
|
| 389 | 389 | $post_key |
| 390 | 390 | ); |
| 391 | 391 | |
@@ -402,8 +402,8 @@ discard block |
||
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | // Do clean |
| 405 | - fileDelete($SETTINGS['path_to_files_folder'] . '/' . $post_backupFile, $SETTINGS); |
|
| 406 | - $post_backupFile = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $post_backupFile; |
|
| 405 | + fileDelete($SETTINGS['path_to_files_folder'].'/'.$post_backupFile, $SETTINGS); |
|
| 406 | + $post_backupFile = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$post_backupFile; |
|
| 407 | 407 | } else { |
| 408 | 408 | echo prepareExchangedData( |
| 409 | 409 | array( |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | DB::query($query); |
| 488 | 488 | $executedQueries++; |
| 489 | 489 | } catch (Exception $e) { |
| 490 | - $errors[] = "Error executing query: " . $e->getMessage() . " - Query: " . substr($query, 0, 100) . "..."; |
|
| 490 | + $errors[] = "Error executing query: ".$e->getMessage()." - Query: ".substr($query, 0, 100)."..."; |
|
| 491 | 491 | } |
| 492 | 492 | $query = ''; |
| 493 | 493 | } |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | } |
| 514 | 514 | // Rollback transaction on any exception |
| 515 | 515 | DB::rollback(); |
| 516 | - $errors[] = "Transaction failed: " . $e->getMessage(); |
|
| 516 | + $errors[] = "Transaction failed: ".$e->getMessage(); |
|
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | // Calculate the new offset |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | echo prepareExchangedData( |
| 529 | 529 | array( |
| 530 | 530 | 'error' => true, |
| 531 | - 'message' => 'Errors occurred during import: ' . implode('; ', $errors), |
|
| 531 | + 'message' => 'Errors occurred during import: '.implode('; ', $errors), |
|
| 532 | 532 | 'newOffset' => $newOffset, |
| 533 | 533 | 'totalSize' => $post_totalSize, |
| 534 | 534 | 'clearFilename' => $post_backupFile, |
@@ -55,13 +55,17 @@ discard block |
||
| 55 | 55 | ); |
| 56 | 56 | |
| 57 | 57 | if (empty($subtasks)) { |
| 58 | - if (LOG_TASKS=== true) $this->logger->log("No subtask was found for task {$this->taskId}"); |
|
| 58 | + if (LOG_TASKS=== true) { |
|
| 59 | + $this->logger->log("No subtask was found for task {$this->taskId}"); |
|
| 60 | + } |
|
| 59 | 61 | return; |
| 60 | 62 | } |
| 61 | 63 | |
| 62 | 64 | // Process each subtask |
| 63 | 65 | foreach ($subtasks as $subtask) { |
| 64 | - if (LOG_TASKS=== true) $this->logger->log("Processing subtask {$subtask['increment_id']} for task {$this->taskId}"); |
|
| 66 | + if (LOG_TASKS=== true) { |
|
| 67 | + $this->logger->log("Processing subtask {$subtask['increment_id']} for task {$this->taskId}"); |
|
| 68 | + } |
|
| 65 | 69 | $this->processGenerateUserKeysSubtask($subtask, $arguments); |
| 66 | 70 | } |
| 67 | 71 | |
@@ -98,7 +102,9 @@ discard block |
||
| 98 | 102 | $subtask['increment_id'] |
| 99 | 103 | ); |
| 100 | 104 | |
| 101 | - if (LOG_TASKS=== true) $this->logger->log("Subtask is in progress: ".$taskData['step'], 'INFO'); |
|
| 105 | + if (LOG_TASKS=== true) { |
|
| 106 | + $this->logger->log("Subtask is in progress: ".$taskData['step'], 'INFO'); |
|
| 107 | + } |
|
| 102 | 108 | switch ($taskData['step'] ?? '') { |
| 103 | 109 | case 'step0': |
| 104 | 110 | $this->generateNewUserStep0($arguments); |
@@ -752,7 +758,7 @@ discard block |
||
| 752 | 758 | 'login' => $userInfo['login'], |
| 753 | 759 | 'name' => $userInfo['name'], |
| 754 | 760 | ]; |
| 755 | - }else { |
|
| 761 | + } else { |
|
| 756 | 762 | // Normal case |
| 757 | 763 | return [ |
| 758 | 764 | 'private_key' => decryptPrivateKey($pwd, $userInfo['private_key']), |
@@ -50,24 +50,24 @@ discard block |
||
| 50 | 50 | private function generateUserKeys($arguments) { |
| 51 | 51 | // Get all subtasks related to this task |
| 52 | 52 | $subtasks = DB::query( |
| 53 | - 'SELECT * FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC', |
|
| 53 | + 'SELECT * FROM '.prefixTable('background_subtasks').' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC', |
|
| 54 | 54 | $this->taskId |
| 55 | 55 | ); |
| 56 | 56 | |
| 57 | 57 | if (empty($subtasks)) { |
| 58 | - if (LOG_TASKS=== true) $this->logger->log("No subtask was found for task {$this->taskId}"); |
|
| 58 | + if (LOG_TASKS === true) $this->logger->log("No subtask was found for task {$this->taskId}"); |
|
| 59 | 59 | return; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // Process each subtask |
| 63 | 63 | foreach ($subtasks as $subtask) { |
| 64 | - if (LOG_TASKS=== true) $this->logger->log("Processing subtask {$subtask['increment_id']} for task {$this->taskId}"); |
|
| 64 | + if (LOG_TASKS === true) $this->logger->log("Processing subtask {$subtask['increment_id']} for task {$this->taskId}"); |
|
| 65 | 65 | $this->processGenerateUserKeysSubtask($subtask, $arguments); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // Are all subtasks completed? |
| 69 | 69 | $remainingSubtasks = DB::queryFirstField( |
| 70 | - 'SELECT COUNT(*) FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0', |
|
| 70 | + 'SELECT COUNT(*) FROM '.prefixTable('background_subtasks').' WHERE task_id = %i AND is_in_progress = 0', |
|
| 71 | 71 | $this->taskId |
| 72 | 72 | ); |
| 73 | 73 | if ($remainingSubtasks == 0) { |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $subtask['increment_id'] |
| 99 | 99 | ); |
| 100 | 100 | |
| 101 | - if (LOG_TASKS=== true) $this->logger->log("Subtask is in progress: ".$taskData['step'], 'INFO'); |
|
| 101 | + if (LOG_TASKS === true) $this->logger->log("Subtask is in progress: ".$taskData['step'], 'INFO'); |
|
| 102 | 102 | switch ($taskData['step'] ?? '') { |
| 103 | 103 | case 'step0': |
| 104 | 104 | $this->generateNewUserStep0($arguments); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $subtask['increment_id'] |
| 153 | 153 | ); |
| 154 | 154 | |
| 155 | - $this->logger->log("Subtask {$subtask['increment_id']} failure: " . $e->getMessage(), 'ERROR'); |
|
| 155 | + $this->logger->log("Subtask {$subtask['increment_id']} failure: ".$e->getMessage(), 'ERROR'); |
|
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | // Loop on items |
| 195 | 195 | $rows = DB::query( |
| 196 | 196 | 'SELECT id, pw, perso |
| 197 | - FROM ' . prefixTable('items') . ' |
|
| 197 | + FROM ' . prefixTable('items').' |
|
| 198 | 198 | WHERE perso = %i |
| 199 | 199 | ORDER BY id ASC |
| 200 | 200 | LIMIT %i, %i', |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | // Get itemKey from current user |
| 208 | 208 | $currentUserKey = DB::queryFirstRow( |
| 209 | 209 | 'SELECT share_key, increment_id |
| 210 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 210 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 211 | 211 | WHERE object_id = %i AND user_id = %i', |
| 212 | 212 | $record['id'], |
| 213 | 213 | (int) $record['perso'] === 0 ? $arguments['owner_id'] : $arguments['new_user_id'] |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | // If user is changing his own keys |
| 236 | - if (isset($arguments['user_self_change']) &&(int) $arguments['user_self_change'] === 1) { |
|
| 236 | + if (isset($arguments['user_self_change']) && (int) $arguments['user_self_change'] === 1) { |
|
| 237 | 237 | // Save the new sharekey correctly encrypted in DB |
| 238 | 238 | $affected = DB::update( |
| 239 | 239 | prefixTable('sharekeys_items'), |
@@ -299,16 +299,16 @@ discard block |
||
| 299 | 299 | // Loop on logs |
| 300 | 300 | $rows = DB::query( |
| 301 | 301 | 'SELECT increment_id |
| 302 | - FROM ' . prefixTable('log_items') . ' |
|
| 302 | + FROM ' . prefixTable('log_items').' |
|
| 303 | 303 | WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes" |
| 304 | 304 | ORDER BY increment_id ASC |
| 305 | - LIMIT ' . $taskData['index'] . ', ' . $taskData['nb'] |
|
| 305 | + LIMIT ' . $taskData['index'].', '.$taskData['nb'] |
|
| 306 | 306 | ); |
| 307 | 307 | foreach ($rows as $record) { |
| 308 | 308 | // Get itemKey from current user |
| 309 | 309 | $currentUserKey = DB::queryFirstRow( |
| 310 | 310 | 'SELECT share_key |
| 311 | - FROM ' . prefixTable('sharekeys_logs') . ' |
|
| 311 | + FROM ' . prefixTable('sharekeys_logs').' |
|
| 312 | 312 | WHERE object_id = %i AND user_id = %i', |
| 313 | 313 | $record['increment_id'], |
| 314 | 314 | $arguments['owner_id'] |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | if ((int) $arguments['new_user_id'] !== (int) $arguments['owner_id']) { |
| 341 | 341 | $currentUserKey = DB::queryFirstRow( |
| 342 | 342 | 'SELECT increment_id |
| 343 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 343 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 344 | 344 | WHERE object_id = %i AND user_id = %i', |
| 345 | 345 | $record['id'], |
| 346 | 346 | $arguments['new_user_id'] |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | // Loop on fields |
| 389 | 389 | $rows = DB::query( |
| 390 | 390 | 'SELECT id |
| 391 | - FROM ' . prefixTable('categories_items') . ' |
|
| 391 | + FROM ' . prefixTable('categories_items').' |
|
| 392 | 392 | WHERE encryption_type = "teampass_aes" |
| 393 | 393 | ORDER BY id ASC |
| 394 | 394 | LIMIT %i, %i', |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | // Get itemKey from current user |
| 400 | 400 | $currentUserKey = DB::queryFirstRow( |
| 401 | 401 | 'SELECT share_key |
| 402 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 402 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 403 | 403 | WHERE object_id = %i AND user_id = %i', |
| 404 | 404 | $record['id'], |
| 405 | 405 | $arguments['owner_id'] |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | if ((int) $arguments['new_user_id'] !== (int) $arguments['owner_id']) { |
| 428 | 428 | $currentUserKey = DB::queryFirstRow( |
| 429 | 429 | 'SELECT increment_id |
| 430 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 430 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 431 | 431 | WHERE object_id = %i AND user_id = %i', |
| 432 | 432 | $record['id'], |
| 433 | 433 | $arguments['new_user_id'] |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | // Loop on suggestions |
| 477 | 477 | $rows = DB::query( |
| 478 | 478 | 'SELECT id |
| 479 | - FROM ' . prefixTable('suggestion') . ' |
|
| 479 | + FROM ' . prefixTable('suggestion').' |
|
| 480 | 480 | ORDER BY id ASC |
| 481 | 481 | LIMIT %i, %i', |
| 482 | 482 | $taskData['index'], |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | // Get itemKey from current user |
| 487 | 487 | $currentUserKey = DB::queryFirstRow( |
| 488 | 488 | 'SELECT share_key |
| 489 | - FROM ' . prefixTable('sharekeys_suggestions') . ' |
|
| 489 | + FROM ' . prefixTable('sharekeys_suggestions').' |
|
| 490 | 490 | WHERE object_id = %i AND user_id = %i', |
| 491 | 491 | $record['id'], |
| 492 | 492 | $arguments['owner_id'] |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | if ((int) $arguments['new_user_id'] !== (int) $arguments['owner_id']) { |
| 519 | 519 | $currentUserKey = DB::queryFirstRow( |
| 520 | 520 | 'SELECT increment_id |
| 521 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 521 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 522 | 522 | WHERE object_id = %i AND user_id = %i', |
| 523 | 523 | $record['id'], |
| 524 | 524 | $arguments['new_user_id'] |
@@ -566,9 +566,9 @@ discard block |
||
| 566 | 566 | // Loop on files |
| 567 | 567 | $rows = DB::query( |
| 568 | 568 | 'SELECT f.id AS id, i.perso AS perso |
| 569 | - FROM ' . prefixTable('files') . ' AS f |
|
| 570 | - INNER JOIN ' . prefixTable('items') . ' AS i ON i.id = f.id_item |
|
| 571 | - WHERE f.status = "' . TP_ENCRYPTION_NAME . '" |
|
| 569 | + FROM ' . prefixTable('files').' AS f |
|
| 570 | + INNER JOIN ' . prefixTable('items').' AS i ON i.id = f.id_item |
|
| 571 | + WHERE f.status = "' . TP_ENCRYPTION_NAME.'" |
|
| 572 | 572 | LIMIT %i, %i', |
| 573 | 573 | $taskData['index'], |
| 574 | 574 | $taskData['nb'] |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | // Get itemKey from current user |
| 578 | 578 | $currentUserKey = DB::queryFirstRow( |
| 579 | 579 | 'SELECT share_key, increment_id |
| 580 | - FROM ' . prefixTable('sharekeys_files') . ' |
|
| 580 | + FROM ' . prefixTable('sharekeys_files').' |
|
| 581 | 581 | WHERE object_id = %i AND user_id = %i', |
| 582 | 582 | $record['id'], |
| 583 | 583 | (int) $record['perso'] === 0 ? $arguments['owner_id'] : $arguments['new_user_id'] |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | |
| 606 | 606 | $currentUserKey = DB::queryFirstRow( |
| 607 | 607 | 'SELECT increment_id |
| 608 | - FROM ' . prefixTable('sharekeys_files') . ' |
|
| 608 | + FROM ' . prefixTable('sharekeys_files').' |
|
| 609 | 609 | WHERE object_id = %i AND user_id = %i', |
| 610 | 610 | $record['id'], |
| 611 | 611 | $arguments['new_user_id'] |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | // get user info |
| 684 | 684 | $userInfo = DB::queryFirstRow( |
| 685 | 685 | 'SELECT u.email, u.login, u.auth_type, u.special, u.lastname, u.name |
| 686 | - FROM ' . prefixTable('users') . ' AS u |
|
| 686 | + FROM ' . prefixTable('users').' AS u |
|
| 687 | 687 | WHERE u.id = %i', |
| 688 | 688 | $arguments['new_user_id'] |
| 689 | 689 | ); |
@@ -698,10 +698,10 @@ discard block |
||
| 698 | 698 | filter_var($userInfo['email'], FILTER_SANITIZE_EMAIL), |
| 699 | 699 | // @scrutinizer ignore-type |
| 700 | 700 | empty($arguments['email_body']) === false ? $arguments['email_body'] : $lang->get('email_body_user_config_1'), |
| 701 | - 'TEAMPASS - ' . $lang->get('login_credentials'), |
|
| 701 | + 'TEAMPASS - '.$lang->get('login_credentials'), |
|
| 702 | 702 | (array) filter_var_array( |
| 703 | 703 | [ |
| 704 | - '#code#' => cryption($arguments['new_user_code'], '','decrypt', $this->settings)['string'], |
|
| 704 | + '#code#' => cryption($arguments['new_user_code'], '', 'decrypt', $this->settings)['string'], |
|
| 705 | 705 | '#lastname#' => isset($userInfo['name']) === true ? $userInfo['name'] : '', |
| 706 | 706 | '#login#' => isset($userInfo['login']) === true ? $userInfo['login'] : '', |
| 707 | 707 | ], |
@@ -765,24 +765,24 @@ discard block |
||
| 765 | 765 | private function getOwnerInfos(int $owner_id, string $owner_pwd, int $only_personal_items = 0, string $owner_private_key = ''): array { |
| 766 | 766 | $userInfo = DB::queryFirstRow( |
| 767 | 767 | 'SELECT pw, public_key, private_key, login, name |
| 768 | - FROM ' . prefixTable('users') . ' |
|
| 768 | + FROM ' . prefixTable('users').' |
|
| 769 | 769 | WHERE id = %i', |
| 770 | 770 | $owner_id |
| 771 | 771 | ); |
| 772 | 772 | |
| 773 | 773 | // decrypt owner password |
| 774 | - $pwd = cryption($owner_pwd, '','decrypt', $this->settings)['string']; |
|
| 774 | + $pwd = cryption($owner_pwd, '', 'decrypt', $this->settings)['string']; |
|
| 775 | 775 | |
| 776 | 776 | // decrypt private key and send back |
| 777 | 777 | if ((int) $only_personal_items === 1 && empty($owner_private_key) === false) { |
| 778 | 778 | // Explicitely case where we only want personal items and where user has provided his private key |
| 779 | 779 | return [ |
| 780 | - 'private_key' => cryption($owner_private_key, '','decrypt')['string'], |
|
| 780 | + 'private_key' => cryption($owner_private_key, '', 'decrypt')['string'], |
|
| 781 | 781 | 'public_key' => $userInfo['public_key'], |
| 782 | 782 | 'login' => $userInfo['login'], |
| 783 | 783 | 'name' => $userInfo['name'], |
| 784 | 784 | ]; |
| 785 | - }else { |
|
| 785 | + } else { |
|
| 786 | 786 | // Normal case |
| 787 | 787 | return [ |
| 788 | 788 | 'private_key' => decryptPrivateKey($pwd, $userInfo['private_key']), |