@@ -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'], 'emails', $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 | <!-- Content Header (Page header) --> |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | <div class="card-body"> |
| 200 | 200 | <div id="unsent-emails"> |
| 201 | 201 | <?php |
| 202 | - DB::query('SELECT * FROM ' . prefixTable('emails') . ' WHERE status = %s OR status = %s', 'not_sent', ''); |
|
| 202 | + DB::query('SELECT * FROM '.prefixTable('emails').' WHERE status = %s OR status = %s', 'not_sent', ''); |
|
| 203 | 203 | echo str_replace('#nb_emails#', DB::count(), langHdl('email_send_backlog')); |
| 204 | 204 | ?> |
| 205 | 205 | </div> |
@@ -43,15 +43,15 @@ |
||
| 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'], 'utilities', $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 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | 28 | if ( |
| 29 | - isset($_SESSION['CPM']) === false || $_SESSION['CPM'] !== 1 |
|
| 29 | + isset($_SESSION['CPM']) === false || $_SESSION['CPM'] !== 1 |
|
| 30 | 30 | || isset($_SESSION['user_id']) === false || empty($_SESSION['user_id']) === true |
| 31 | 31 | || isset($_SESSION['key']) === false || empty($_SESSION['key']) === true |
| 32 | 32 | ) { |
@@ -28,7 +28,7 @@ |
||
| 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 | |
@@ -499,8 +499,7 @@ discard block |
||
| 499 | 499 | $post_masked = filter_var($dataReceived['masked'], FILTER_SANITIZE_STRING); |
| 500 | 500 | $post_encrypted = filter_var($dataReceived['encrypted'], FILTER_SANITIZE_STRING); |
| 501 | 501 | $post_roles = filter_var_array($dataReceived['roles'], FILTER_SANITIZE_STRING); |
| 502 | - $post_fieldId = isset($dataReceived['fieldId']) === false ? '' : |
|
| 503 | - filter_var($dataReceived['fieldId'], FILTER_SANITIZE_NUMBER_INT); |
|
| 502 | + $post_fieldId = isset($dataReceived['fieldId']) === false ? '' : filter_var($dataReceived['fieldId'], FILTER_SANITIZE_NUMBER_INT); |
|
| 504 | 503 | |
| 505 | 504 | if (empty($post_fieldId) === false) { |
| 506 | 505 | // UPDATE FIELD |
@@ -515,7 +514,7 @@ discard block |
||
| 515 | 514 | 'encrypted_data' => $post_encrypted, |
| 516 | 515 | 'is_mandatory' => $post_mandatory, |
| 517 | 516 | 'masked' => $post_masked, |
| 518 | - 'role_visibility' => is_null($post_roles) === true || count($post_roles) ===0 ? '' : implode(',', $post_roles), |
|
| 517 | + 'role_visibility' => is_null($post_roles) === true || count($post_roles) === 0 ? '' : implode(',', $post_roles), |
|
| 519 | 518 | 'order' => calculateOrder($post_fieldId, $post_order), |
| 520 | 519 | ), |
| 521 | 520 | 'id = %i', |
@@ -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,17 +42,17 @@ 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'], 'items', $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'; |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | if (isset($_SESSION['groupes_visibles']) === false |
| 61 | 61 | || empty($_SESSION['groupes_visibles']) === true |
| 62 | 62 | ) { |
| 63 | - echo '{"sEcho": ' . intval($_GET['sEcho']) . ' ,"iTotalRecords": "0", "iTotalDisplayRecords": "0", "aaData": [] }'; |
|
| 63 | + echo '{"sEcho": '.intval($_GET['sEcho']).' ,"iTotalRecords": "0", "iTotalDisplayRecords": "0", "aaData": [] }'; |
|
| 64 | 64 | exit; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | //Connect to DB |
| 68 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 68 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 69 | 69 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 70 | 70 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 71 | 71 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $folders = $_SESSION['groupes_visibles']; |
| 90 | 90 | } else { |
| 91 | 91 | // Build tree |
| 92 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 92 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 93 | 93 | $tree->register(); |
| 94 | 94 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 95 | 95 | $folders = $tree->getDescendants(filter_var($_GET['limited'], FILTER_SANITIZE_NUMBER_INT), true); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | //Get current user "personal folder" ID |
| 100 | 100 | $row = DB::query( |
| 101 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %i', |
|
| 101 | + 'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %i', |
|
| 102 | 102 | intval($_SESSION['user_id']) |
| 103 | 103 | ); |
| 104 | 104 | //get list of personal folders |
@@ -107,21 +107,21 @@ discard block |
||
| 107 | 107 | $listPf = ''; |
| 108 | 108 | if (empty($row['id']) === false) { |
| 109 | 109 | $rows = DB::query( |
| 110 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' |
|
| 110 | + 'SELECT id FROM '.prefixTable('nested_tree').' |
|
| 111 | 111 | WHERE personal_folder = 1 AND NOT parent_id = %i AND NOT title = %i', |
| 112 | 112 | '1', |
| 113 | 113 | filter_var($row['id'], FILTER_SANITIZE_NUMBER_INT), |
| 114 | 114 | filter_var($_SESSION['user_id'], FILTER_SANITIZE_NUMBER_INT) |
| 115 | 115 | ); |
| 116 | 116 | foreach ($rows as $record) { |
| 117 | - if (! in_array($record['id'], $arrayPf)) { |
|
| 117 | + if (!in_array($record['id'], $arrayPf)) { |
|
| 118 | 118 | //build an array of personal folders ids |
| 119 | 119 | array_push($arrayPf, $record['id']); |
| 120 | 120 | //build also a string with those ids |
| 121 | 121 | if (empty($listPf)) { |
| 122 | 122 | $listPf = $record['id']; |
| 123 | 123 | } else { |
| 124 | - $listPf .= ', ' . $record['id']; |
|
| 124 | + $listPf .= ', '.$record['id']; |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | //Paging |
| 132 | 132 | $sLimit = ''; |
| 133 | 133 | if (isset($_GET['start']) === true && $_GET['length'] !== '-1') { |
| 134 | - $sLimit = 'LIMIT ' . filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT) . ', ' . filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT) . ''; |
|
| 134 | + $sLimit = 'LIMIT '.filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT).', '.filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT).''; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | //Ordering |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | $sOrder = 'ORDER BY '; |
| 146 | 146 | if ($_GET['order'][0]['column'] >= 0) { |
| 147 | - $sOrder .= '' . $aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)] . ' ' |
|
| 148 | - . filter_var($_GET['order'][0]['dir'], FILTER_SANITIZE_STRING) . ', '; |
|
| 147 | + $sOrder .= ''.$aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)].' ' |
|
| 148 | + . filter_var($_GET['order'][0]['dir'], FILTER_SANITIZE_STRING).', '; |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | $sOrder = substr_replace($sOrder, '', -2); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $sOrder = ''; |
| 154 | 154 | } |
| 155 | 155 | } else { |
| 156 | - $sOrder = 'ORDER BY ' . $aColumns[1] . ' ASC'; |
|
| 156 | + $sOrder = 'ORDER BY '.$aColumns[1].' ASC'; |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | // Define criteria |
@@ -175,9 +175,9 @@ discard block |
||
| 175 | 175 | if (empty($search_criteria) === false) { |
| 176 | 176 | $sWhere .= ' AND ('; |
| 177 | 177 | for ($i = 0; $i < count($aColumns); ++$i) { |
| 178 | - $sWhere .= $aColumns[$i] . ' LIKE %ss_' . $i . ' OR '; |
|
| 178 | + $sWhere .= $aColumns[$i].' LIKE %ss_'.$i.' OR '; |
|
| 179 | 179 | } |
| 180 | - $sWhere = substr_replace((string) $sWhere, '', -3) . ') '; |
|
| 180 | + $sWhere = substr_replace((string) $sWhere, '', -3).') '; |
|
| 181 | 181 | $crit = [ |
| 182 | 182 | 'idtree' => array_unique($folders), |
| 183 | 183 | '0' => $search_criteria, |
@@ -215,13 +215,13 @@ discard block |
||
| 215 | 215 | if (empty($sWhere) === false) { |
| 216 | 216 | $sWhere .= ' AND '; |
| 217 | 217 | } |
| 218 | - $sWhere = 'WHERE ' . $sWhere . 'id_tree NOT IN %ls_pf '; |
|
| 218 | + $sWhere = 'WHERE '.$sWhere.'id_tree NOT IN %ls_pf '; |
|
| 219 | 219 | } else { |
| 220 | - $sWhere = 'WHERE ' . $sWhere; |
|
| 220 | + $sWhere = 'WHERE '.$sWhere; |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | DB::query( |
| 224 | - 'SELECT id FROM ' . prefixTable('cache') . " |
|
| 224 | + 'SELECT id FROM '.prefixTable('cache')." |
|
| 225 | 225 | ${sWhere} |
| 226 | 226 | ${sOrder}", |
| 227 | 227 | $crit |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | $iTotal = DB::count(); |
| 230 | 230 | $rows = DB::query( |
| 231 | 231 | 'SELECT id, label, description, tags, id_tree, perso, restricted_to, login, folder, author, renewal_period, url, timestamp |
| 232 | - FROM ' . prefixTable('cache') . " |
|
| 232 | + FROM ' . prefixTable('cache')." |
|
| 233 | 233 | ${sWhere} |
| 234 | 234 | ${sOrder} |
| 235 | 235 | ${sLimit}", |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | if (isset($_GET['type']) === false) { |
| 242 | 242 | $sOutput = '{'; |
| 243 | 243 | if (isset($_GET['draw']) === true) { |
| 244 | - $sOutput .= '"draw": ' . intval($_GET['draw']) . ', '; |
|
| 244 | + $sOutput .= '"draw": '.intval($_GET['draw']).', '; |
|
| 245 | 245 | } |
| 246 | 246 | $sOutput .= '"data": ['; |
| 247 | 247 | $sOutputConst = ''; |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | $arrTmp = []; |
| 258 | 258 | foreach (explode(';', $_SESSION['fonction_id']) as $role) { |
| 259 | 259 | $access = DB::queryFirstRow( |
| 260 | - 'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i', |
|
| 260 | + 'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i', |
|
| 261 | 261 | $role, |
| 262 | 262 | $record['id_tree'] |
| 263 | 263 | ); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | $accessLevel = count($arrTmp) > 0 ? min($arrTmp) : $accessLevel; |
| 277 | 277 | if ($accessLevel === 0) { |
| 278 | - $checkbox = '<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" data-id=\"' . $record['id'] . '\">'; |
|
| 278 | + $checkbox = '<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" data-id=\"'.$record['id'].'\">'; |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | if ((int) $accessLevel === 0) { |
@@ -315,22 +315,22 @@ discard block |
||
| 315 | 315 | if (empty($restrictedTo)) { |
| 316 | 316 | $restrictedTo = $_SESSION['user_id']; |
| 317 | 317 | } else { |
| 318 | - $restrictedTo .= ',' . $_SESSION['user_id']; |
|
| 318 | + $restrictedTo .= ','.$_SESSION['user_id']; |
|
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | //col1 |
| 323 | - $sOutputItem .= '"<i class=\"fa fa-external-link-alt infotip mr-2\" title=\"' . langHdl('open_url_link') . '\" onClick=\"window.location.href='index.php?page=items&group=' . $record['id_tree'] . '&id=' . $record['id'] . ''\" style=\"cursor:pointer;\"></i>' . |
|
| 324 | - '<i class=\"fa fa-eye infotip mr-2 item-detail\" title=\"' . langHdl('see_item_title') . '\" data-id=\"' . $record['id'] . '\" data-perso=\"' . $record['perso'] . '\" data-tree-id=\"' . $record['id_tree'] . '\" data-expired=\"' . $expired . '\" data-restricted-to=\"' . $restrictedTo . '\" data-rights=\"' . $right . '\" style=\"cursor:pointer;\"></i>' . $checkbox . '", '; |
|
| 323 | + $sOutputItem .= '"<i class=\"fa fa-external-link-alt infotip mr-2\" title=\"'.langHdl('open_url_link').'\" onClick=\"window.location.href='index.php?page=items&group='.$record['id_tree'].'&id='.$record['id'].''\" style=\"cursor:pointer;\"></i>'. |
|
| 324 | + '<i class=\"fa fa-eye infotip mr-2 item-detail\" title=\"'.langHdl('see_item_title').'\" data-id=\"'.$record['id'].'\" data-perso=\"'.$record['perso'].'\" data-tree-id=\"'.$record['id_tree'].'\" data-expired=\"'.$expired.'\" data-restricted-to=\"'.$restrictedTo.'\" data-rights=\"'.$right.'\" style=\"cursor:pointer;\"></i>'.$checkbox.'", '; |
|
| 325 | 325 | //col2 |
| 326 | - $sOutputItem .= '"<span id=\"item_label-' . $record['id'] . '\">' . stripslashes($record['label']) . '</span>", '; |
|
| 326 | + $sOutputItem .= '"<span id=\"item_label-'.$record['id'].'\">'.stripslashes($record['label']).'</span>", '; |
|
| 327 | 327 | //col3 |
| 328 | - $sOutputItem .= '"' . str_replace('&', '&', htmlspecialchars(stripslashes($record['login']), ENT_QUOTES)) . '", '; |
|
| 328 | + $sOutputItem .= '"'.str_replace('&', '&', htmlspecialchars(stripslashes($record['login']), ENT_QUOTES)).'", '; |
|
| 329 | 329 | //col4 |
| 330 | 330 | //get restriction from ROles |
| 331 | 331 | $restrictedToRole = false; |
| 332 | 332 | $rTmp = DB::queryFirstColumn( |
| 333 | - 'SELECT role_id FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id = %i', |
|
| 333 | + 'SELECT role_id FROM '.prefixTable('restriction_to_roles').' WHERE item_id = %i', |
|
| 334 | 334 | $record['id'] |
| 335 | 335 | ); |
| 336 | 336 | // We considere here that if user has at least one group similar to the object ones |
@@ -348,14 +348,14 @@ discard block |
||
| 348 | 348 | } else { |
| 349 | 349 | $txt = str_replace(['\n', '<br />', '\\'], [' ', ' ', '', ' '], strip_tags($record['description'])); |
| 350 | 350 | if (strlen($txt) > 50) { |
| 351 | - $sOutputItem .= '"' . substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50) . '", '; |
|
| 351 | + $sOutputItem .= '"'.substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50).'", '; |
|
| 352 | 352 | } else { |
| 353 | - $sOutputItem .= '"' . stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt)) . '", '; |
|
| 353 | + $sOutputItem .= '"'.stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt)).'", '; |
|
| 354 | 354 | } |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | //col5 - TAGS |
| 358 | - $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['tags']), ENT_QUOTES) . '", '; |
|
| 358 | + $sOutputItem .= '"'.htmlspecialchars(stripslashes($record['tags']), ENT_QUOTES).'", '; |
|
| 359 | 359 | // col6 - URL |
| 360 | 360 | if ($record['url'] !== '0') { |
| 361 | 361 | $sOutputItem .= '"'.filter_var($record['url'], FILTER_SANITIZE_URL).'", '; |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | //col7 - Prepare the Treegrid |
| 367 | - $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['folder']), ENT_QUOTES) . '"'; |
|
| 367 | + $sOutputItem .= '"'.htmlspecialchars(stripslashes($record['folder']), ENT_QUOTES).'"'; |
|
| 368 | 368 | //Finish the line |
| 369 | 369 | $sOutputItem .= '], '; |
| 370 | 370 | if ($getItemInList === true) { |
@@ -373,16 +373,16 @@ discard block |
||
| 373 | 373 | --$iTotal; |
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | - if (! empty($sOutputConst)) { |
|
| 376 | + if (!empty($sOutputConst)) { |
|
| 377 | 377 | $sOutput .= substr_replace($sOutputConst, '', -2); |
| 378 | 378 | } |
| 379 | 379 | $sOutput .= '], '; |
| 380 | - $sOutput .= '"recordsTotal": ' . $iTotal . ', '; |
|
| 381 | - $sOutput .= '"recordsFiltered": ' . $iTotal . ' }'; |
|
| 380 | + $sOutput .= '"recordsTotal": '.$iTotal.', '; |
|
| 381 | + $sOutput .= '"recordsFiltered": '.$iTotal.' }'; |
|
| 382 | 382 | echo $sOutput; |
| 383 | 383 | } elseif (isset($_GET['type']) && ($_GET['type'] === 'search_for_items' || $_GET['type'] === 'search_for_items_with_tags')) { |
| 384 | 384 | include_once 'main.functions.php'; |
| 385 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 385 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 386 | 386 | |
| 387 | 387 | $arr_data = []; |
| 388 | 388 | foreach ($rows as $record) { |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | |
| 403 | 403 | // Anyone can modify? |
| 404 | 404 | $tmp = DB::queryfirstrow( |
| 405 | - 'SELECT anyone_can_modify FROM ' . prefixTable('items') . ' WHERE id = %i', |
|
| 405 | + 'SELECT anyone_can_modify FROM '.prefixTable('items').' WHERE id = %i', |
|
| 406 | 406 | $record['id'] |
| 407 | 407 | ); |
| 408 | 408 | if (count($tmp) > 0) { |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | // => récupérer un tableau contenant les roles associés à cet ID (a partir table restriction_to_roles) |
| 434 | 434 | $user_is_included_in_role = 0; |
| 435 | 435 | $roles = DB::query( |
| 436 | - 'SELECT role_id FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id=%i', |
|
| 436 | + 'SELECT role_id FROM '.prefixTable('restriction_to_roles').' WHERE item_id=%i', |
|
| 437 | 437 | $record['id'] |
| 438 | 438 | ); |
| 439 | 439 | if (count($roles) > 0) { |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | if (empty($restrictedTo)) { |
| 457 | 457 | $restrictedTo = $_SESSION['user_id']; |
| 458 | 458 | } else { |
| 459 | - $restrictedTo .= ',' . $_SESSION['user_id']; |
|
| 459 | + $restrictedTo .= ','.$_SESSION['user_id']; |
|
| 460 | 460 | } |
| 461 | 461 | } |
| 462 | 462 | |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | $arrTmp = []; |
| 555 | 555 | foreach (explode(';', $_SESSION['fonction_id']) as $role) { |
| 556 | 556 | $access = DB::queryFirstRow( |
| 557 | - 'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i', |
|
| 557 | + 'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i', |
|
| 558 | 558 | $role, |
| 559 | 559 | $record['id_tree'] |
| 560 | 560 | ); |
@@ -603,8 +603,8 @@ discard block |
||
| 603 | 603 | ) { |
| 604 | 604 | $data_item = DB::queryFirstRow( |
| 605 | 605 | 'SELECT i.pw AS pw, s.share_key AS share_key |
| 606 | - FROM ' . prefixTable('items') . ' AS i |
|
| 607 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id) |
|
| 606 | + FROM ' . prefixTable('items').' AS i |
|
| 607 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id) |
|
| 608 | 608 | WHERE i.id = %i AND s.user_id = %i', |
| 609 | 609 | $record['id'], |
| 610 | 610 | $_SESSION['user_id'] |
@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // Do checks |
| 40 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 41 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 40 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 41 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 42 | 42 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) { |
| 43 | 43 | // Not allowed page |
| 44 | 44 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 45 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 45 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 46 | 46 | exit; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -55,14 +55,14 @@ discard block |
||
| 55 | 55 | date_default_timezone_set('UTC'); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 59 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 58 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 59 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 60 | 60 | header('Content-type: text/html; charset=utf-8'); |
| 61 | 61 | header('Cache-Control: no-cache, must-revalidate'); |
| 62 | 62 | require_once 'main.functions.php'; |
| 63 | 63 | |
| 64 | 64 | // Connect to mysql server |
| 65 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 65 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 66 | 66 | mysqli_connect(DB_HOST, DB_USER, defuseReturnDecrypted(DB_PASSWD, $SETTINGS), DB_NAME, (int) DB_PORT, null); |
| 67 | 67 | |
| 68 | 68 | // Protect POST |
@@ -28,7 +28,7 @@ |
||
| 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 | |
@@ -28,7 +28,7 @@ |
||
| 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 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Include files |
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 55 | 55 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 56 | 56 | // Prepare GET variables |
| 57 | 57 | $get_filename = $superGlobal->get('name', 'GET'); |
@@ -59,17 +59,17 @@ discard block |
||
| 59 | 59 | $get_pathIsFiles = $superGlobal->get('pathIsFiles', 'GET'); |
| 60 | 60 | |
| 61 | 61 | // prepare Encryption class calls |
| 62 | -header('Content-disposition: attachment; filename=' . rawurldecode(basename($get_filename))); |
|
| 62 | +header('Content-disposition: attachment; filename='.rawurldecode(basename($get_filename))); |
|
| 63 | 63 | header('Content-Type: application/octet-stream'); |
| 64 | 64 | header('Cache-Control: must-revalidate, no-cache, no-store'); |
| 65 | 65 | header('Expires: 0'); |
| 66 | 66 | if (isset($_GET['pathIsFiles']) && (int) $get_pathIsFiles === 1) { |
| 67 | - readfile($SETTINGS['path_to_files_folder'] . '/' . basename($get_filename)); |
|
| 67 | + readfile($SETTINGS['path_to_files_folder'].'/'.basename($get_filename)); |
|
| 68 | 68 | } else { |
| 69 | 69 | include_once 'main.functions.php'; |
| 70 | - require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 70 | + require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 71 | 71 | // connect to the server |
| 72 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 72 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 73 | 73 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 74 | 74 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 75 | 75 | } |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | $file_info = DB::queryfirstrow( |
| 84 | 84 | 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension, |
| 85 | 85 | s.share_key AS share_key |
| 86 | - FROM ' . prefixTable('files') . ' AS f |
|
| 87 | - INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id) |
|
| 86 | + FROM ' . prefixTable('files').' AS f |
|
| 87 | + INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id) |
|
| 88 | 88 | WHERE s.user_id = %i AND s.object_id = %i', |
| 89 | 89 | $_SESSION['user_id'], |
| 90 | 90 | $get_fileid |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
| 104 | 104 | header('Cache-Control: private', false); |
| 105 | 105 | header('Content-Type: application/octet-stream'); |
| 106 | - header('Content-Disposition: attachment; filename="' . $filename . '.' . $file_info['extension'] . '";'); |
|
| 106 | + header('Content-Disposition: attachment; filename="'.$filename.'.'.$file_info['extension'].'";'); |
|
| 107 | 107 | header('Content-Transfer-Encoding: binary'); |
| 108 | 108 | // Stream the CSV data |
| 109 | 109 | exit(base64_decode($fileContent)); |