@@ -43,11 +43,11 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | ?> |
@@ -43,11 +43,11 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | ?> |
@@ -43,11 +43,11 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | ?> |
@@ -43,16 +43,16 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], curPage($SETTINGS), $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // Load |
| 55 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 55 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 56 | 56 | |
| 57 | 57 | ?> |
| 58 | 58 | |
@@ -43,15 +43,15 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'roles', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 49 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 50 | 50 | exit; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Load template |
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 55 | 55 | |
| 56 | 56 | ?> |
| 57 | 57 | |
@@ -94,17 +94,17 @@ discard block |
||
| 94 | 94 | $arrUserRoles = array_filter($_SESSION['user_roles']); |
| 95 | 95 | $where = ''; |
| 96 | 96 | if (count($arrUserRoles) > 0 && (int) $_SESSION['is_admin'] !== 1) { |
| 97 | - $where = ' WHERE id IN (' . implode(',', $arrUserRoles) . ')'; |
|
| 97 | + $where = ' WHERE id IN ('.implode(',', $arrUserRoles).')'; |
|
| 98 | 98 | } |
| 99 | - $rows = DB::query('SELECT * FROM ' . prefixTable('roles_title') . $where); |
|
| 99 | + $rows = DB::query('SELECT * FROM '.prefixTable('roles_title').$where); |
|
| 100 | 100 | foreach ($rows as $reccord) { |
| 101 | 101 | echo ' |
| 102 | - <option value="' . $reccord['id'] . '" |
|
| 103 | - data-complexity-text="' . addslashes(TP_PW_COMPLEXITY[$reccord['complexity']][1]) . '" |
|
| 104 | - data-complexity-icon="' . TP_PW_COMPLEXITY[$reccord['complexity']][2] . '" |
|
| 105 | - data-complexity="' . TP_PW_COMPLEXITY[$reccord['complexity']][0] . '" |
|
| 106 | - data-allow-edit-all="' . $reccord['allow_pw_change'] . '">'. |
|
| 107 | - $reccord['title'] . '</option>'; |
|
| 102 | + <option value="' . $reccord['id'].'" |
|
| 103 | + data-complexity-text="' . addslashes(TP_PW_COMPLEXITY[$reccord['complexity']][1]).'" |
|
| 104 | + data-complexity-icon="' . TP_PW_COMPLEXITY[$reccord['complexity']][2].'" |
|
| 105 | + data-complexity="' . TP_PW_COMPLEXITY[$reccord['complexity']][0].'" |
|
| 106 | + data-allow-edit-all="' . $reccord['allow_pw_change'].'">'. |
|
| 107 | + $reccord['title'].'</option>'; |
|
| 108 | 108 | } |
| 109 | 109 | ?> |
| 110 | 110 | </select> |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | <?php |
| 126 | 126 | foreach (TP_PW_COMPLEXITY as $entry) { |
| 127 | 127 | echo ' |
| 128 | - <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>'; |
|
| 128 | + <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>'; |
|
| 129 | 129 | } |
| 130 | 130 | ?> |
| 131 | 131 | </select> |
@@ -43,11 +43,11 @@ |
||
| 43 | 43 | } |
| 44 | 44 | echo "ici"; |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], '2fa', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | ?> |
@@ -43,15 +43,15 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], '2fa', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 49 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 50 | 50 | exit; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Load template |
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 55 | 55 | |
| 56 | 56 | ?> |
| 57 | 57 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | ); |
| 116 | 116 | foreach ($roles as $role) { |
| 117 | 117 | echo ' |
| 118 | - <option value="' . $role['id'] . '"', in_array($role['id'], $arrRolesMFA) === true ? ' selected' : '', '>' . addslashes($role['title']) . '</option>'; |
|
| 118 | + <option value="' . $role['id'].'"', in_array($role['id'], $arrRolesMFA) === true ? ' selected' : '', '>'.addslashes($role['title']).'</option>'; |
|
| 119 | 119 | } |
| 120 | 120 | ?> |
| 121 | 121 | </select> |
@@ -43,15 +43,15 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'ldap', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 49 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 50 | 50 | exit; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Load template |
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 55 | 55 | |
| 56 | 56 | ?> |
| 57 | 57 | |
@@ -90,14 +90,14 @@ discard block |
||
| 90 | 90 | <?php |
| 91 | 91 | echo langHdl('rebuild_config_file'); |
| 92 | 92 | $data = DB::queryfirstrow( |
| 93 | - 'SELECT field_1, date FROM ' . prefixTable('log_system') . ' |
|
| 93 | + 'SELECT field_1, date FROM '.prefixTable('log_system').' |
|
| 94 | 94 | WHERE label = %s |
| 95 | 95 | ORDER BY id DESC', |
| 96 | 96 | 'admin_action_rebuild_config_file' |
| 97 | 97 | ); |
| 98 | 98 | if (DB::count() > 0) { |
| 99 | - $tmp = langHdl('last_execution') . ' ' . |
|
| 100 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']); |
|
| 99 | + $tmp = langHdl('last_execution').' '. |
|
| 100 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']); |
|
| 101 | 101 | $tmp .= $data['field_1'] === 'success' ? |
| 102 | 102 | '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>'; |
| 103 | 103 | } else { |
@@ -119,14 +119,14 @@ discard block |
||
| 119 | 119 | </span> |
| 120 | 120 | <?php echo langHdl('admin_action_check_pf'); |
| 121 | 121 | $data = DB::queryfirstrow( |
| 122 | - 'SELECT field_1, date FROM ' . prefixTable('log_system') . ' |
|
| 122 | + 'SELECT field_1, date FROM '.prefixTable('log_system').' |
|
| 123 | 123 | WHERE label = %s |
| 124 | 124 | ORDER BY id DESC', |
| 125 | 125 | 'admin_action_check_pf' |
| 126 | 126 | ); |
| 127 | 127 | if (DB::count() > 0) { |
| 128 | - $tmp = langHdl('last_execution') . ' ' . |
|
| 129 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']); |
|
| 128 | + $tmp = langHdl('last_execution').' '. |
|
| 129 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']); |
|
| 130 | 130 | $tmp .= $data['field_1'] === 'success' ? |
| 131 | 131 | '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>'; |
| 132 | 132 | } else { |
@@ -146,14 +146,14 @@ discard block |
||
| 146 | 146 | </span> |
| 147 | 147 | <?php echo langHdl('admin_action_db_clean_items'); |
| 148 | 148 | $data = DB::queryfirstrow( |
| 149 | - 'SELECT field_1, date FROM ' . prefixTable('log_system') . ' |
|
| 149 | + 'SELECT field_1, date FROM '.prefixTable('log_system').' |
|
| 150 | 150 | WHERE label = %s |
| 151 | 151 | ORDER BY id DESC', |
| 152 | 152 | 'admin_action_db_clean_items' |
| 153 | 153 | ); |
| 154 | 154 | if (DB::count() > 0) { |
| 155 | - $tmp = langHdl('last_execution') . ' ' . |
|
| 156 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']); |
|
| 155 | + $tmp = langHdl('last_execution').' '. |
|
| 156 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']); |
|
| 157 | 157 | $tmp .= $data['field_1'] === 'success' ? |
| 158 | 158 | '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>'; |
| 159 | 159 | } else { |
@@ -175,14 +175,14 @@ discard block |
||
| 175 | 175 | </span> |
| 176 | 176 | <?php echo langHdl('admin_action_db_optimize'); |
| 177 | 177 | $data = DB::queryfirstrow( |
| 178 | - 'SELECT field_1, date FROM ' . prefixTable('log_system') . ' |
|
| 178 | + 'SELECT field_1, date FROM '.prefixTable('log_system').' |
|
| 179 | 179 | WHERE label = %s |
| 180 | 180 | ORDER BY id DESC', |
| 181 | 181 | 'admin_action_db_optimize' |
| 182 | 182 | ); |
| 183 | 183 | if (DB::count() > 0) { |
| 184 | - $tmp = langHdl('last_execution') . ' ' . |
|
| 185 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']); |
|
| 184 | + $tmp = langHdl('last_execution').' '. |
|
| 185 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']); |
|
| 186 | 186 | $tmp .= $data['field_1'] === 'success' ? |
| 187 | 187 | '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>'; |
| 188 | 188 | } else { |
@@ -201,14 +201,14 @@ discard block |
||
| 201 | 201 | </span> |
| 202 | 202 | <?php echo langHdl('admin_action_purge_old_files'); |
| 203 | 203 | $data = DB::queryfirstrow( |
| 204 | - 'SELECT field_1, date FROM ' . prefixTable('log_system') . ' |
|
| 204 | + 'SELECT field_1, date FROM '.prefixTable('log_system').' |
|
| 205 | 205 | WHERE label = %s |
| 206 | 206 | ORDER BY id DESC', |
| 207 | 207 | 'admin_action_purge_old_files' |
| 208 | 208 | ); |
| 209 | 209 | if (DB::count() > 0) { |
| 210 | - $tmp = langHdl('last_execution') . ' ' . |
|
| 211 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']); |
|
| 210 | + $tmp = langHdl('last_execution').' '. |
|
| 211 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']); |
|
| 212 | 212 | $tmp .= $data['field_1'] === 'success' ? |
| 213 | 213 | '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>'; |
| 214 | 214 | } else { |
@@ -230,14 +230,14 @@ discard block |
||
| 230 | 230 | </span> |
| 231 | 231 | <?php echo langHdl('admin_action_reload_cache_table'); |
| 232 | 232 | $data = DB::queryfirstrow( |
| 233 | - 'SELECT field_1, date FROM ' . prefixTable('log_system') . ' |
|
| 233 | + 'SELECT field_1, date FROM '.prefixTable('log_system').' |
|
| 234 | 234 | WHERE label = %s |
| 235 | 235 | ORDER BY id DESC', |
| 236 | 236 | 'admin_action_reload_cache_table' |
| 237 | 237 | ); |
| 238 | 238 | if (DB::count() > 0) { |
| 239 | - $tmp = langHdl('last_execution') . ' ' . |
|
| 240 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']); |
|
| 239 | + $tmp = langHdl('last_execution').' '. |
|
| 240 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']); |
|
| 241 | 241 | $tmp .= $data['field_1'] === 'success' ? |
| 242 | 242 | '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>'; |
| 243 | 243 | } else { |
@@ -260,14 +260,14 @@ discard block |
||
| 260 | 260 | </span> |
| 261 | 261 | <?php echo langHdl('admin_action_change_salt_key'); |
| 262 | 262 | $data = DB::queryfirstrow( |
| 263 | - 'SELECT field_1, date FROM ' . prefixTable('log_system') . ' |
|
| 263 | + 'SELECT field_1, date FROM '.prefixTable('log_system').' |
|
| 264 | 264 | WHERE label = %s |
| 265 | 265 | ORDER BY id DESC', |
| 266 | 266 | 'admin_action_change_sk' |
| 267 | 267 | ); |
| 268 | 268 | if (DB::count() > 0) { |
| 269 | - $tmp = langHdl('last_execution') . ' ' . |
|
| 270 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']); |
|
| 269 | + $tmp = langHdl('last_execution').' '. |
|
| 270 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']); |
|
| 271 | 271 | $tmp .= $data['field_1'] === 'success' ? |
| 272 | 272 | '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>'; |
| 273 | 273 | } else { |
@@ -290,14 +290,14 @@ discard block |
||
| 290 | 290 | </span> |
| 291 | 291 | <?php echo langHdl('admin_action_attachments_cryption'); |
| 292 | 292 | $data = DB::queryfirstrow( |
| 293 | - 'SELECT field_1, date FROM ' . prefixTable('log_system') . ' |
|
| 293 | + 'SELECT field_1, date FROM '.prefixTable('log_system').' |
|
| 294 | 294 | WHERE label = %s |
| 295 | 295 | ORDER BY id DESC', |
| 296 | 296 | 'admin_action_change_file_encryption' |
| 297 | 297 | ); |
| 298 | 298 | if (DB::count() > 0) { |
| 299 | - $tmp = langHdl('last_execution') . ' ' . |
|
| 300 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']); |
|
| 299 | + $tmp = langHdl('last_execution').' '. |
|
| 300 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']); |
|
| 301 | 301 | $tmp .= $data['field_1'] === 'success' ? |
| 302 | 302 | '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>'; |
| 303 | 303 | } else { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | require_once 'SecureHandler.php'; |
| 29 | 29 | session_name('teampass_session'); |
| 30 | 30 | session_start(); |
| 31 | -if (! isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || ! isset($_SESSION['key']) || empty($_SESSION['key'])) { |
|
| 31 | +if (!isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || !isset($_SESSION['key']) || empty($_SESSION['key'])) { |
|
| 32 | 32 | die('Hacking attempt...'); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -42,22 +42,22 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // Do checks |
| 45 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 45 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'folders', $SETTINGS) === false) { |
| 48 | 48 | // Not allowed page |
| 49 | 49 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 55 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 55 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 56 | 56 | header('Content-type: text/html; charset=utf-8'); |
| 57 | 57 | header('Cache-Control: no-cache, must-revalidate'); |
| 58 | 58 | require_once 'main.functions.php'; |
| 59 | 59 | // Connect to mysql server |
| 60 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 60 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 61 | 61 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 62 | 62 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 63 | 63 | } |
@@ -68,9 +68,9 @@ discard block |
||
| 68 | 68 | DB::$port = DB_PORT; |
| 69 | 69 | DB::$encoding = DB_ENCODING; |
| 70 | 70 | // Class loader |
| 71 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 71 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 72 | 72 | //Build tree |
| 73 | -$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 73 | +$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 74 | 74 | $tree->register(); |
| 75 | 75 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 76 | 76 | //Columns name |
@@ -81,22 +81,22 @@ discard block |
||
| 81 | 81 | $sOrder = $sLimit = ''; |
| 82 | 82 | // Is a date sent? |
| 83 | 83 | if (isset($_GET['dateCriteria']) === true && empty($_GET['dateCriteria']) === false) { |
| 84 | - $sWhere .= ' AND a.del_value < ' . round(filter_var($_GET['dateCriteria'], FILTER_SANITIZE_NUMBER_INT) / 1000, 0); |
|
| 84 | + $sWhere .= ' AND a.del_value < '.round(filter_var($_GET['dateCriteria'], FILTER_SANITIZE_NUMBER_INT) / 1000, 0); |
|
| 85 | 85 | } |
| 86 | 86 | //echo $sWhere; |
| 87 | 87 | /* BUILD QUERY */ |
| 88 | 88 | //Paging |
| 89 | 89 | $sLimit = ''; |
| 90 | 90 | if (isset($_GET['length']) === true && (int) $_GET['length'] !== -1) { |
| 91 | - $sLimit = ' LIMIT ' . filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT) . ', ' . filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT) . ''; |
|
| 91 | + $sLimit = ' LIMIT '.filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT).', '.filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT).''; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | //Ordering |
| 95 | 95 | if (isset($_GET['order'][0]['dir']) && in_array($_GET['order'][0]['dir'], $aSortTypes)) { |
| 96 | 96 | $sOrder = 'ORDER BY '; |
| 97 | 97 | if (preg_match('#^(asc|desc)$#i', $_GET['order'][0]['column'])) { |
| 98 | - $sOrder .= '' . $aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)] . ' ' |
|
| 99 | - . filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_STRING) . ', '; |
|
| 98 | + $sOrder .= ''.$aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)].' ' |
|
| 99 | + . filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_STRING).', '; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | $sOrder = substr_replace($sOrder, '', -2); |
@@ -117,29 +117,29 @@ discard block |
||
| 117 | 117 | && $_GET['letter'] !== 'None' |
| 118 | 118 | ) { |
| 119 | 119 | $sWhere .= ' AND '; |
| 120 | - $sWhere .= $aColumns[1] . " LIKE '" . filter_var($_GET['letter'], FILTER_SANITIZE_STRING) . "%' OR "; |
|
| 121 | - $sWhere .= $aColumns[2] . " LIKE '" . filter_var($_GET['letter'], FILTER_SANITIZE_STRING) . "%' OR "; |
|
| 122 | - $sWhere .= $aColumns[3] . " LIKE '" . filter_var($_GET['letter'], FILTER_SANITIZE_STRING) . "%' "; |
|
| 120 | + $sWhere .= $aColumns[1]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_STRING)."%' OR "; |
|
| 121 | + $sWhere .= $aColumns[2]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_STRING)."%' OR "; |
|
| 122 | + $sWhere .= $aColumns[3]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_STRING)."%' "; |
|
| 123 | 123 | } elseif (isset($_GET['search']['value']) === true && $_GET['search']['value'] !== '') { |
| 124 | 124 | $sWhere = ' AND '; |
| 125 | - $sWhere .= $aColumns[1] . " LIKE '" . filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING) . "%' OR "; |
|
| 126 | - $sWhere .= $aColumns[2] . " LIKE '" . filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING) . "%' OR "; |
|
| 127 | - $sWhere .= $aColumns[3] . " LIKE '" . filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING) . "%' "; |
|
| 125 | + $sWhere .= $aColumns[1]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING)."%' OR "; |
|
| 126 | + $sWhere .= $aColumns[2]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING)."%' OR "; |
|
| 127 | + $sWhere .= $aColumns[3]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING)."%' "; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | $rows = DB::query( |
| 131 | 131 | 'SELECT a.item_id, i.label, a.del_value, i.id_tree |
| 132 | - FROM ' . prefixTable('automatic_del') . ' AS a |
|
| 133 | - INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' . |
|
| 132 | + FROM ' . prefixTable('automatic_del').' AS a |
|
| 133 | + INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'. |
|
| 134 | 134 | $sWhere. |
| 135 | 135 | (string) $sOrder |
| 136 | 136 | ); |
| 137 | 137 | $iTotal = DB::count(); |
| 138 | 138 | $rows = DB::query( |
| 139 | 139 | 'SELECT a.item_id, i.label, a.del_value, i.id_tree |
| 140 | - FROM ' . prefixTable('automatic_del') . ' AS a |
|
| 141 | - INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' . |
|
| 142 | - $sWhere . |
|
| 140 | + FROM ' . prefixTable('automatic_del').' AS a |
|
| 141 | + INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'. |
|
| 142 | + $sWhere. |
|
| 143 | 143 | $sLimit |
| 144 | 144 | ); |
| 145 | 145 | $iFilteredTotal = DB::count(); |
@@ -157,18 +157,18 @@ discard block |
||
| 157 | 157 | // start the line |
| 158 | 158 | $sOutput .= '['; |
| 159 | 159 | // Column 1 |
| 160 | - $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>", '; |
|
| 160 | + $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>", '; |
|
| 161 | 161 | // Column 2 |
| 162 | - $sOutput .= '"' . $record['label'] . '", '; |
|
| 162 | + $sOutput .= '"'.$record['label'].'", '; |
|
| 163 | 163 | // Column 3 |
| 164 | - $sOutput .= '"' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['del_value']) . '", '; |
|
| 164 | + $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['del_value']).'", '; |
|
| 165 | 165 | // Column 4 |
| 166 | 166 | $path = []; |
| 167 | 167 | $treeDesc = $tree->getPath($record['id_tree'], true); |
| 168 | 168 | foreach ($treeDesc as $t) { |
| 169 | 169 | array_push($path, $t->title); |
| 170 | 170 | } |
| 171 | - $sOutput .= '"' . implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path) . '"],'; |
|
| 171 | + $sOutput .= '"'.implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path).'"],'; |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | if ($iTotal > 0) { |
@@ -181,4 +181,4 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | // finalize output |
| 184 | -echo '{"recordsTotal": ' . $iTotal . ', "recordsFiltered": ' . $iFilteredTotal . ', "data": ' . $sOutput; |
|
| 184 | +echo '{"recordsTotal": '.$iTotal.', "recordsFiltered": '.$iFilteredTotal.', "data": '.$sOutput; |
|