@@ -36,15 +36,15 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /* do checks */ |
| 39 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 39 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 40 | 40 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], curPage($SETTINGS), $SETTINGS) === false) { |
| 41 | 41 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 42 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 42 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 43 | 43 | exit(); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // Load template |
| 47 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 47 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 48 | 48 | |
| 49 | 49 | // user type |
| 50 | 50 | if ($_SESSION['user_admin'] === '1') { |
@@ -64,31 +64,31 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | // prepare list of languages |
| 67 | -$languages = DB::query('SELECT label FROM ' . prefixTable('languages') . ' ORDER BY label ASC'); |
|
| 67 | +$languages = DB::query('SELECT label FROM '.prefixTable('languages').' ORDER BY label ASC'); |
|
| 68 | 68 | |
| 69 | 69 | |
| 70 | 70 | // Do some stats |
| 71 | -DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_creation" AND id_user = "' . $_SESSION['user_id'] . '"'); |
|
| 71 | +DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_creation" AND id_user = "'.$_SESSION['user_id'].'"'); |
|
| 72 | 72 | $userItemsNumber = DB::count(); |
| 73 | 73 | |
| 74 | -DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_modification" AND id_user = "' . $_SESSION['user_id'] . '"'); |
|
| 74 | +DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_modification" AND id_user = "'.$_SESSION['user_id'].'"'); |
|
| 75 | 75 | $userModificationNumber = DB::count(); |
| 76 | 76 | |
| 77 | -DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_shown" AND id_user = "' . $_SESSION['user_id'] . '"'); |
|
| 77 | +DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_shown" AND id_user = "'.$_SESSION['user_id'].'"'); |
|
| 78 | 78 | $userSeenItemsNumber = DB::count(); |
| 79 | 79 | |
| 80 | -DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_password_shown" AND id_user = "' . $_SESSION['user_id'] . '"'); |
|
| 80 | +DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_password_shown" AND id_user = "'.$_SESSION['user_id'].'"'); |
|
| 81 | 81 | $userSeenPasswordsNumber = DB::count(); |
| 82 | 82 | |
| 83 | 83 | $userInfo = DB::queryFirstRow( |
| 84 | 84 | 'SELECT avatar |
| 85 | - FROM ' . prefixTable('users') . ' |
|
| 86 | - WHERE id = "' . $_SESSION['user_id'] . '"' |
|
| 85 | + FROM ' . prefixTable('users').' |
|
| 86 | + WHERE id = "' . $_SESSION['user_id'].'"' |
|
| 87 | 87 | ); |
| 88 | 88 | if (empty($userInfo['avatar']) === true) { |
| 89 | - $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg'; |
|
| 89 | + $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg'; |
|
| 90 | 90 | } else { |
| 91 | - $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $userInfo['avatar']; |
|
| 91 | + $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$userInfo['avatar']; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // Get Groups name |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | foreach ($_SESSION['user_roles'] as $role) { |
| 97 | 97 | $tmp = DB::queryFirstRow( |
| 98 | 98 | 'SELECT title |
| 99 | - FROM ' . prefixTable('roles_title') . ' |
|
| 100 | - WHERE id = "' . $role . '"' |
|
| 99 | + FROM ' . prefixTable('roles_title').' |
|
| 100 | + WHERE id = "' . $role.'"' |
|
| 101 | 101 | ); |
| 102 | 102 | if ($tmp !== null) { |
| 103 | 103 | array_push($userParOfGroups, $tmp['title']); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | <h3 id="profile-username" class="text-center"> |
| 142 | 142 | <?php |
| 143 | 143 | if (isset($_SESSION['name']) === true && empty($_SESSION['name']) === false) { |
| 144 | - echo $_SESSION['name'] . ' ' . $_SESSION['lastname']; |
|
| 144 | + echo $_SESSION['name'].' '.$_SESSION['lastname']; |
|
| 145 | 145 | } else { |
| 146 | 146 | echo $_SESSION['login']; |
| 147 | 147 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | } else { |
| 209 | 209 | echo date('d/m/Y', $_SESSION['last_connection']); |
| 210 | 210 | } |
| 211 | - echo ' ' . langHdl('at') . ' '; |
|
| 211 | + echo ' '.langHdl('at').' '; |
|
| 212 | 212 | if (isset($SETTINGS['time_format']) === true) { |
| 213 | 213 | echo date($SETTINGS['time_format'], $_SESSION['last_connection']); |
| 214 | 214 | } else { |
@@ -238,12 +238,12 @@ discard block |
||
| 238 | 238 | ) { |
| 239 | 239 | $numDaysBeforePwExpiration = ''; |
| 240 | 240 | } else { |
| 241 | - $numDaysBeforePwExpiration = $LANG['index_pw_expiration'] . ' ' . $_SESSION['numDaysBeforePwExpiration'] . ' ' . $LANG['days'] . '.'; |
|
| 241 | + $numDaysBeforePwExpiration = $LANG['index_pw_expiration'].' '.$_SESSION['numDaysBeforePwExpiration'].' '.$LANG['days'].'.'; |
|
| 242 | 242 | } |
| 243 | 243 | echo ' |
| 244 | 244 | <li class="list-group-item"> |
| 245 | - <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . langHdl('index_last_pw_change') . '</b> |
|
| 246 | - <a class="float-right">' . $last_pw_change . ' ' . $numDaysBeforePwExpiration . '</a> |
|
| 245 | + <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . langHdl('index_last_pw_change').'</b> |
|
| 246 | + <a class="float-right">' . $last_pw_change.' '.$numDaysBeforePwExpiration.'</a> |
|
| 247 | 247 | </li>'; |
| 248 | 248 | } |
| 249 | 249 | ?> |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) { |
| 264 | 264 | echo ' |
| 265 | 265 | <li class="list-group-item"> |
| 266 | - <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_api_key') . '</b> |
|
| 266 | + <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_api_key').'</b> |
|
| 267 | 267 | <a class="float-right" id="profile-user-api-token">', |
| 268 | 268 | isset($_SESSION['user']['api-key']) === true ? $_SESSION['user']['api-key'] : '', |
| 269 | 269 | '</a> |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | ) { |
| 276 | 276 | echo ' |
| 277 | 277 | <li class="list-group-item"> |
| 278 | - <b><i class="fas fa-id-card-o fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_agses_card_id') . '</b> |
|
| 278 | + <b><i class="fas fa-id-card-o fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_agses_card_id').'</b> |
|
| 279 | 279 | <a class="float-right">', |
| 280 | 280 | isset($_SESSION['user']['agses-usercardid']) ? $_SESSION['user']['agses-usercardid'] : '', |
| 281 | 281 | '</a> |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | <ul class=""> |
| 300 | 300 | <?php |
| 301 | 301 | foreach ($_SESSION['user']['unsuccessfull_login_attempts_list'] as $entry) { |
| 302 | - echo '<li class="">' . $entry . '</li>'; |
|
| 302 | + echo '<li class="">'.$entry.'</li>'; |
|
| 303 | 303 | } ?> |
| 304 | 304 | </ul> |
| 305 | 305 | </div> |
@@ -312,12 +312,12 @@ discard block |
||
| 312 | 312 | <?php |
| 313 | 313 | $rows = DB::query( |
| 314 | 314 | 'SELECT label AS labelAction, date, null |
| 315 | - FROM ' . prefixTable('log_system') . ' |
|
| 315 | + FROM ' . prefixTable('log_system').' |
|
| 316 | 316 | WHERE qui = %i |
| 317 | 317 | UNION |
| 318 | 318 | SELECT l.action, l.date, i.label AS itemLabel |
| 319 | - FROM ' . prefixTable('log_items') . ' AS l |
|
| 320 | - INNER JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id) |
|
| 319 | + FROM ' . prefixTable('log_items').' AS l |
|
| 320 | + INNER JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id) |
|
| 321 | 321 | WHERE l.id_user = %i AND l.action IN ("at_access") |
| 322 | 322 | ORDER BY date DESC |
| 323 | 323 | LIMIT 0, 40', |
@@ -331,9 +331,9 @@ discard block |
||
| 331 | 331 | $text = langHdl($record['labelAction']); |
| 332 | 332 | } |
| 333 | 333 | if (empty($record['NULL']) === false) { |
| 334 | - $text .= ' ' . langHdl('for') . ' <span class="font-weight-light">' . addslashes($record['NULL']) . '</span>'; |
|
| 334 | + $text .= ' '.langHdl('for').' <span class="font-weight-light">'.addslashes($record['NULL']).'</span>'; |
|
| 335 | 335 | } |
| 336 | - echo '<li class="list-group-item">' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $record['date']) . ' - ' . $text . '</li>'; |
|
| 336 | + echo '<li class="list-group-item">'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $record['date']).' - '.$text.'</li>'; |
|
| 337 | 337 | } |
| 338 | 338 | ?> |
| 339 | 339 | </ul> |
@@ -374,11 +374,10 @@ discard block |
||
| 374 | 374 | <?php |
| 375 | 375 | foreach ($zones as $key => $zone) { |
| 376 | 376 | echo ' |
| 377 | - <option value="' . $key . '"', |
|
| 377 | + <option value="' . $key.'"', |
|
| 378 | 378 | isset($_SESSION['user']['usertimezone']) === true && $_SESSION['user']['usertimezone'] === $key ? |
| 379 | - ' selected' : |
|
| 380 | - (isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''), |
|
| 381 | - '>' . $zone . '</option>'; |
|
| 379 | + ' selected' : (isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''), |
|
| 380 | + '>'.$zone.'</option>'; |
|
| 382 | 381 | } |
| 383 | 382 | ?> |
| 384 | 383 | </select> |
@@ -391,11 +390,10 @@ discard block |
||
| 391 | 390 | <?php |
| 392 | 391 | foreach ($languages as $language) { |
| 393 | 392 | echo |
| 394 | - '<option value="' . $language['label'] . '"', |
|
| 393 | + '<option value="'.$language['label'].'"', |
|
| 395 | 394 | $_SESSION['user']['user_language'] === strtolower($language['label']) ? |
| 396 | - ' selected="selected"' : |
|
| 397 | - ($SETTINGS['default_language'] === strtolower($language['label']) ? ' selected="selected"' : ''), |
|
| 398 | - '>' . $language['label'] . '</option>'; |
|
| 395 | + ' selected="selected"' : ($SETTINGS['default_language'] === strtolower($language['label']) ? ' selected="selected"' : ''), |
|
| 396 | + '>'.$language['label'].'</option>'; |
|
| 399 | 397 | } |
| 400 | 398 | ?> |
| 401 | 399 | </select> |
@@ -446,7 +444,7 @@ discard block |
||
| 446 | 444 | <button type="button" class="btn btn-warning float-right ml-2" id="profile-avatar-file"><?php echo langHdl('upload_new_avatar'); ?></button> |
| 447 | 445 | <?php |
| 448 | 446 | if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) { |
| 449 | - echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">' . langHdl('generate_api_token') . '</button>'; |
|
| 447 | + echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">'.langHdl('generate_api_token').'</button>'; |
|
| 450 | 448 | } |
| 451 | 449 | ?> |
| 452 | 450 | <div id="profile-avatar-file-container" class="hidden"></div> |
@@ -36,15 +36,15 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /* do checks */ |
| 39 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 39 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 40 | 40 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'admin', $SETTINGS) === false) { |
| 41 | 41 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 42 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 42 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 43 | 43 | exit(); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // Load template |
| 47 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 47 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 48 | 48 | |
| 49 | 49 | // Generates zones |
| 50 | 50 | $zones = timezone_list(); |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | // get list of all timezones |
| 255 | 255 | foreach ($zones as $key => $zone) { |
| 256 | 256 | echo ' |
| 257 | - <option value="' . $key . '"', isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : '', '>' . $zone . '</option>'; |
|
| 257 | + <option value="' . $key.'"', isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : '', '>'.$zone.'</option>'; |
|
| 258 | 258 | } |
| 259 | 259 | ?> |
| 260 | 260 | </select> |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | <?php |
| 306 | 306 | foreach ($languagesList as $lang) { |
| 307 | 307 | echo ' |
| 308 | - <option value="' . $lang . '"', isset($SETTINGS['default_language']) === true && $SETTINGS['default_language'] === $lang ? ' selected' : '', '>' . $lang . '</option>'; |
|
| 308 | + <option value="' . $lang.'"', isset($SETTINGS['default_language']) === true && $SETTINGS['default_language'] === $lang ? ' selected' : '', '>'.$lang.'</option>'; |
|
| 309 | 309 | } |
| 310 | 310 | ?> |
| 311 | 311 | </select> |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | <?php |
| 403 | 403 | foreach (TP_PW_COMPLEXITY as $complex) { |
| 404 | 404 | echo ' |
| 405 | - <option value="' . $complex[0] . '"', isset($SETTINGS['personal_saltkey_security_level']) === true && $SETTINGS['personal_saltkey_security_level'] == $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>'; |
|
| 405 | + <option value="' . $complex[0].'"', isset($SETTINGS['personal_saltkey_security_level']) === true && $SETTINGS['personal_saltkey_security_level'] == $complex[0] ? ' selected' : '', '>'.$complex[1].'</option>'; |
|
| 406 | 406 | } |
| 407 | 407 | ?> |
| 408 | 408 | </select> |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | ); |
| 715 | 715 | foreach ($roles as $role) { |
| 716 | 716 | echo ' |
| 717 | - <option value="' . $role['id'] . '"', in_array($role['id'], $arrRolesToPrint) === true ? ' selected' : '', '>' . addslashes($role['title']) . '</option>'; |
|
| 717 | + <option value="' . $role['id'].'"', in_array($role['id'], $arrRolesToPrint) === true ? ' selected' : '', '>'.addslashes($role['title']).'</option>'; |
|
| 718 | 718 | } |
| 719 | 719 | ?> |
| 720 | 720 | </select> |
@@ -886,7 +886,7 @@ discard block |
||
| 886 | 886 | <?php |
| 887 | 887 | foreach (TP_PW_COMPLEXITY as $complex) { |
| 888 | 888 | echo ' |
| 889 | - <option value="' . $complex[0] . '"', isset($SETTINGS['offline_key_level']) === true && $SETTINGS['offline_key_level'] == $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>'; |
|
| 889 | + <option value="' . $complex[0].'"', isset($SETTINGS['offline_key_level']) === true && $SETTINGS['offline_key_level'] == $complex[0] ? ' selected' : '', '>'.$complex[1].'</option>'; |
|
| 890 | 890 | } |
| 891 | 891 | ?> |
| 892 | 892 | </select> |
@@ -36,15 +36,15 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /* do checks */ |
| 39 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 39 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 40 | 40 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], '2fa', $SETTINGS) === false) { |
| 41 | 41 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 42 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 42 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 43 | 43 | exit(); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // Load template |
| 47 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 47 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 48 | 48 | |
| 49 | 49 | ?> |
| 50 | 50 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | ); |
| 109 | 109 | foreach ($roles as $role) { |
| 110 | 110 | echo ' |
| 111 | - <option value="' . $role['id'] . '"', in_array($role['id'], $arrRolesMFA) === true ? ' selected' : '', '>' . addslashes($role['title']) . '</option>'; |
|
| 111 | + <option value="' . $role['id'].'"', in_array($role['id'], $arrRolesMFA) === true ? ' selected' : '', '>'.addslashes($role['title']).'</option>'; |
|
| 112 | 112 | } |
| 113 | 113 | ?> |
| 114 | 114 | </select> |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $var_dk = ''; // Derived key |
| 108 | 108 | |
| 109 | 109 | for ($block = 1; $block <= $var_kb; ++$block) { // Create key |
| 110 | - $var_ib = $var_h = hash_hmac($var_a, $var_s . pack('N', $block), $var_p, true); // Initial hash for this block |
|
| 110 | + $var_ib = $var_h = hash_hmac($var_a, $var_s.pack('N', $block), $var_p, true); // Initial hash for this block |
|
| 111 | 111 | for ($var_i = 1; $var_i < $var_c; ++$var_i) { // Perform block iterations |
| 112 | 112 | $var_ib ^= ($var_h = hash_hmac($var_a, $var_h, $var_p, true)); // XOR each iterate |
| 113 | 113 | } |
@@ -341,25 +341,25 @@ discard block |
||
| 341 | 341 | */ |
| 342 | 342 | function cryption($message, $ascii_key, $type, $SETTINGS) |
| 343 | 343 | { |
| 344 | - $ascii_key = (empty($ascii_key) === true) ? file_get_contents(SECUREPATH . '/teampass-seckey.txt') : $ascii_key; |
|
| 344 | + $ascii_key = (empty($ascii_key) === true) ? file_get_contents(SECUREPATH.'/teampass-seckey.txt') : $ascii_key; |
|
| 345 | 345 | $err = false; |
| 346 | 346 | |
| 347 | 347 | // load PhpEncryption library |
| 348 | 348 | if (isset($SETTINGS['cpassman_dir']) === false || empty($SETTINGS['cpassman_dir']) === true) { |
| 349 | 349 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 350 | 350 | } else { |
| 351 | - $path = $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/'; |
|
| 351 | + $path = $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'; |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | - include_once $path . 'Crypto.php'; |
|
| 355 | - include_once $path . 'Encoding.php'; |
|
| 356 | - include_once $path . 'DerivedKeys.php'; |
|
| 357 | - include_once $path . 'Key.php'; |
|
| 358 | - include_once $path . 'KeyOrPassword.php'; |
|
| 359 | - include_once $path . 'File.php'; |
|
| 360 | - include_once $path . 'RuntimeTests.php'; |
|
| 361 | - include_once $path . 'KeyProtectedByPassword.php'; |
|
| 362 | - include_once $path . 'Core.php'; |
|
| 354 | + include_once $path.'Crypto.php'; |
|
| 355 | + include_once $path.'Encoding.php'; |
|
| 356 | + include_once $path.'DerivedKeys.php'; |
|
| 357 | + include_once $path.'Key.php'; |
|
| 358 | + include_once $path.'KeyOrPassword.php'; |
|
| 359 | + include_once $path.'File.php'; |
|
| 360 | + include_once $path.'RuntimeTests.php'; |
|
| 361 | + include_once $path.'KeyProtectedByPassword.php'; |
|
| 362 | + include_once $path.'Core.php'; |
|
| 363 | 363 | |
| 364 | 364 | // convert KEY |
| 365 | 365 | $key = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key); |
@@ -405,15 +405,15 @@ discard block |
||
| 405 | 405 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | - include_once $path . 'Crypto.php'; |
|
| 409 | - include_once $path . 'Encoding.php'; |
|
| 410 | - include_once $path . 'DerivedKeys.php'; |
|
| 411 | - include_once $path . 'Key.php'; |
|
| 412 | - include_once $path . 'KeyOrPassword.php'; |
|
| 413 | - include_once $path . 'File.php'; |
|
| 414 | - include_once $path . 'RuntimeTests.php'; |
|
| 415 | - include_once $path . 'KeyProtectedByPassword.php'; |
|
| 416 | - include_once $path . 'Core.php'; |
|
| 408 | + include_once $path.'Crypto.php'; |
|
| 409 | + include_once $path.'Encoding.php'; |
|
| 410 | + include_once $path.'DerivedKeys.php'; |
|
| 411 | + include_once $path.'Key.php'; |
|
| 412 | + include_once $path.'KeyOrPassword.php'; |
|
| 413 | + include_once $path.'File.php'; |
|
| 414 | + include_once $path.'RuntimeTests.php'; |
|
| 415 | + include_once $path.'KeyProtectedByPassword.php'; |
|
| 416 | + include_once $path.'Core.php'; |
|
| 417 | 417 | |
| 418 | 418 | $key = \Defuse\Crypto\Key::createNewRandomKey(); |
| 419 | 419 | $key = $key->saveToAsciiSafeString(); |
@@ -439,15 +439,15 @@ discard block |
||
| 439 | 439 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | - include_once $path . 'Crypto.php'; |
|
| 443 | - include_once $path . 'Encoding.php'; |
|
| 444 | - include_once $path . 'DerivedKeys.php'; |
|
| 445 | - include_once $path . 'Key.php'; |
|
| 446 | - include_once $path . 'KeyOrPassword.php'; |
|
| 447 | - include_once $path . 'File.php'; |
|
| 448 | - include_once $path . 'RuntimeTests.php'; |
|
| 449 | - include_once $path . 'KeyProtectedByPassword.php'; |
|
| 450 | - include_once $path . 'Core.php'; |
|
| 442 | + include_once $path.'Crypto.php'; |
|
| 443 | + include_once $path.'Encoding.php'; |
|
| 444 | + include_once $path.'DerivedKeys.php'; |
|
| 445 | + include_once $path.'Key.php'; |
|
| 446 | + include_once $path.'KeyOrPassword.php'; |
|
| 447 | + include_once $path.'File.php'; |
|
| 448 | + include_once $path.'RuntimeTests.php'; |
|
| 449 | + include_once $path.'KeyProtectedByPassword.php'; |
|
| 450 | + include_once $path.'Core.php'; |
|
| 451 | 451 | |
| 452 | 452 | $protected_key = \Defuse\Crypto\KeyProtectedByPassword::createRandomPasswordProtectedKey($psk); |
| 453 | 453 | $protected_key_encoded = $protected_key->saveToAsciiSafeString(); |
@@ -474,15 +474,15 @@ discard block |
||
| 474 | 474 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | - include_once $path . 'Crypto.php'; |
|
| 478 | - include_once $path . 'Encoding.php'; |
|
| 479 | - include_once $path . 'DerivedKeys.php'; |
|
| 480 | - include_once $path . 'Key.php'; |
|
| 481 | - include_once $path . 'KeyOrPassword.php'; |
|
| 482 | - include_once $path . 'File.php'; |
|
| 483 | - include_once $path . 'RuntimeTests.php'; |
|
| 484 | - include_once $path . 'KeyProtectedByPassword.php'; |
|
| 485 | - include_once $path . 'Core.php'; |
|
| 477 | + include_once $path.'Crypto.php'; |
|
| 478 | + include_once $path.'Encoding.php'; |
|
| 479 | + include_once $path.'DerivedKeys.php'; |
|
| 480 | + include_once $path.'Key.php'; |
|
| 481 | + include_once $path.'KeyOrPassword.php'; |
|
| 482 | + include_once $path.'File.php'; |
|
| 483 | + include_once $path.'RuntimeTests.php'; |
|
| 484 | + include_once $path.'KeyProtectedByPassword.php'; |
|
| 485 | + include_once $path.'Core.php'; |
|
| 486 | 486 | |
| 487 | 487 | try { |
| 488 | 488 | $protected_key = \Defuse\Crypto\KeyProtectedByPassword::loadFromAsciiSafeString($protected_key_encoded); |
@@ -569,8 +569,8 @@ discard block |
||
| 569 | 569 | */ |
| 570 | 570 | function db_error_handler($params) |
| 571 | 571 | { |
| 572 | - echo 'Error: ' . $params['error'] . "<br>\n"; |
|
| 573 | - echo 'Query: ' . $params['query'] . "<br>\n"; |
|
| 572 | + echo 'Error: '.$params['error']."<br>\n"; |
|
| 573 | + echo 'Query: '.$params['query']."<br>\n"; |
|
| 574 | 574 | throw new Exception('Error - Query', 1); |
| 575 | 575 | } |
| 576 | 576 | |
@@ -592,14 +592,14 @@ discard block |
||
| 592 | 592 | $SETTINGS |
| 593 | 593 | ) { |
| 594 | 594 | //load ClassLoader |
| 595 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 595 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 596 | 596 | |
| 597 | 597 | // Load superglobal |
| 598 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 598 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 599 | 599 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 600 | 600 | |
| 601 | 601 | //Connect to DB |
| 602 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 602 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 603 | 603 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 604 | 604 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 605 | 605 | } |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | DB::$encoding = DB_ENCODING; |
| 612 | 612 | |
| 613 | 613 | //Build tree |
| 614 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 614 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 615 | 615 | $tree->register(); |
| 616 | 616 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 617 | 617 | |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | function identAdmin($idFonctions, $SETTINGS, $tree) |
| 654 | 654 | { |
| 655 | 655 | // Load superglobal |
| 656 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 656 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 657 | 657 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 658 | 658 | |
| 659 | 659 | // Init |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | $globalsPersonalVisibleFolders = $superGlobal->get('personal_visible_groups', 'SESSION'); |
| 676 | 676 | |
| 677 | 677 | // Get list of Folders |
| 678 | - $rows = DB::query('SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0); |
|
| 678 | + $rows = DB::query('SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0); |
|
| 679 | 679 | foreach ($rows as $record) { |
| 680 | 680 | array_push($groupesVisibles, $record['id']); |
| 681 | 681 | } |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | } |
| 695 | 695 | // Get ID of personal folder |
| 696 | 696 | $persfld = DB::queryfirstrow( |
| 697 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %s', |
|
| 697 | + 'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %s', |
|
| 698 | 698 | $globalsUserId |
| 699 | 699 | ); |
| 700 | 700 | if (empty($persfld['id']) === false) { |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | // get complete list of ROLES |
| 716 | 716 | $tmp = explode(';', $idFonctions); |
| 717 | 717 | $rows = DB::query( |
| 718 | - 'SELECT * FROM ' . prefixTable('roles_title') . ' |
|
| 718 | + 'SELECT * FROM '.prefixTable('roles_title').' |
|
| 719 | 719 | ORDER BY title ASC' |
| 720 | 720 | ); |
| 721 | 721 | foreach ($rows as $record) { |
@@ -727,9 +727,9 @@ discard block |
||
| 727 | 727 | $superGlobal->put('is_admin', 1, 'SESSION'); |
| 728 | 728 | |
| 729 | 729 | // Check if admin has created Folders and Roles |
| 730 | - DB::query('SELECT * FROM ' . prefixTable('nested_tree') . ''); |
|
| 730 | + DB::query('SELECT * FROM '.prefixTable('nested_tree').''); |
|
| 731 | 731 | $superGlobal->put('nb_folders', DB::count(), 'SESSION'); |
| 732 | - DB::query('SELECT * FROM ' . prefixTable('roles_title')); |
|
| 732 | + DB::query('SELECT * FROM '.prefixTable('roles_title')); |
|
| 733 | 733 | $superGlobal->put('nb_roles', DB::count(), 'SESSION'); |
| 734 | 734 | } |
| 735 | 735 | |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | $tree |
| 774 | 774 | ) { |
| 775 | 775 | // Load superglobal |
| 776 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 776 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 777 | 777 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 778 | 778 | |
| 779 | 779 | // Init |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | // Get list of folders depending on Roles |
| 807 | 807 | $rows = DB::query( |
| 808 | 808 | 'SELECT * |
| 809 | - FROM ' . prefixTable('roles_values') . ' |
|
| 809 | + FROM ' . prefixTable('roles_values').' |
|
| 810 | 810 | WHERE role_id IN %li AND type IN %ls', |
| 811 | 811 | $userRoles, |
| 812 | 812 | array('W', 'ND', 'NE', 'NDNE', 'R') |
@@ -831,9 +831,9 @@ discard block |
||
| 831 | 831 | // Does this user is allowed to see other items |
| 832 | 832 | $inc = 0; |
| 833 | 833 | $rows = DB::query( |
| 834 | - 'SELECT id, id_tree FROM ' . prefixTable('items') . ' |
|
| 834 | + 'SELECT id, id_tree FROM '.prefixTable('items').' |
|
| 835 | 835 | WHERE restricted_to LIKE %ss AND inactif = %s', |
| 836 | - $globalsUserId . ';', |
|
| 836 | + $globalsUserId.';', |
|
| 837 | 837 | '0' |
| 838 | 838 | ); |
| 839 | 839 | foreach ($rows as $record) { |
@@ -847,8 +847,8 @@ discard block |
||
| 847 | 847 | // Check for the users roles if some specific rights exist on items |
| 848 | 848 | $rows = DB::query( |
| 849 | 849 | 'SELECT i.id_tree, r.item_id |
| 850 | - FROM ' . prefixTable('items') . ' as i |
|
| 851 | - INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (r.item_id=i.id) |
|
| 850 | + FROM ' . prefixTable('items').' as i |
|
| 851 | + INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (r.item_id=i.id) |
|
| 852 | 852 | WHERE r.role_id IN %li |
| 853 | 853 | ORDER BY i.id_tree ASC', |
| 854 | 854 | $userRoles |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | ) { |
| 870 | 870 | $persoFld = DB::queryfirstrow( |
| 871 | 871 | 'SELECT id |
| 872 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 872 | + FROM ' . prefixTable('nested_tree').' |
|
| 873 | 873 | WHERE title = %s AND personal_folder = %i', |
| 874 | 874 | $globalsUserId, |
| 875 | 875 | 1 |
@@ -903,7 +903,7 @@ discard block |
||
| 903 | 903 | } |
| 904 | 904 | $persoFlds = DB::query( |
| 905 | 905 | 'SELECT id |
| 906 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 906 | + FROM ' . prefixTable('nested_tree').' |
|
| 907 | 907 | WHERE %l', |
| 908 | 908 | $where |
| 909 | 909 | ); |
@@ -946,17 +946,17 @@ discard block |
||
| 946 | 946 | ); |
| 947 | 947 | |
| 948 | 948 | // Folders and Roles numbers |
| 949 | - DB::queryfirstrow('SELECT id FROM ' . prefixTable('nested_tree') . ''); |
|
| 949 | + DB::queryfirstrow('SELECT id FROM '.prefixTable('nested_tree').''); |
|
| 950 | 950 | $superGlobal->put('nb_folders', DB::count(), 'SESSION'); |
| 951 | - DB::queryfirstrow('SELECT id FROM ' . prefixTable('roles_title')); |
|
| 951 | + DB::queryfirstrow('SELECT id FROM '.prefixTable('roles_title')); |
|
| 952 | 952 | $superGlobal->put('nb_roles', DB::count(), 'SESSION'); |
| 953 | 953 | |
| 954 | 954 | // check if change proposals on User's items |
| 955 | 955 | if (isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1) { |
| 956 | 956 | DB::query( |
| 957 | 957 | 'SELECT * |
| 958 | - FROM ' . prefixTable('items_change') . ' AS c |
|
| 959 | - LEFT JOIN ' . prefixTable('log_items') . ' AS i ON (c.item_id = i.id_item) |
|
| 958 | + FROM ' . prefixTable('items_change').' AS c |
|
| 959 | + LEFT JOIN ' . prefixTable('log_items').' AS i ON (c.item_id = i.id_item) |
|
| 960 | 960 | WHERE i.action = %s AND i.id_user = %i', |
| 961 | 961 | 'at_creation', |
| 962 | 962 | $globalsUserId |
@@ -1000,10 +1000,10 @@ discard block |
||
| 1000 | 1000 | */ |
| 1001 | 1001 | function cacheTableRefresh($SETTINGS) |
| 1002 | 1002 | { |
| 1003 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1003 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1004 | 1004 | |
| 1005 | 1005 | //Connect to DB |
| 1006 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1006 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1007 | 1007 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1008 | 1008 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1009 | 1009 | } |
@@ -1020,13 +1020,13 @@ discard block |
||
| 1020 | 1020 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 1021 | 1021 | |
| 1022 | 1022 | // truncate table |
| 1023 | - DB::query('TRUNCATE TABLE ' . prefixTable('cache')); |
|
| 1023 | + DB::query('TRUNCATE TABLE '.prefixTable('cache')); |
|
| 1024 | 1024 | |
| 1025 | 1025 | // reload date |
| 1026 | 1026 | $rows = DB::query( |
| 1027 | 1027 | 'SELECT * |
| 1028 | - FROM ' . prefixTable('items') . ' as i |
|
| 1029 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 1028 | + FROM ' . prefixTable('items').' as i |
|
| 1029 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 1030 | 1030 | AND l.action = %s |
| 1031 | 1031 | AND i.inactif = %i', |
| 1032 | 1032 | 'at_creation', |
@@ -1038,18 +1038,18 @@ discard block |
||
| 1038 | 1038 | $tags = ''; |
| 1039 | 1039 | $itemTags = DB::query( |
| 1040 | 1040 | 'SELECT tag |
| 1041 | - FROM ' . prefixTable('tags') . ' |
|
| 1041 | + FROM ' . prefixTable('tags').' |
|
| 1042 | 1042 | WHERE item_id = %i AND tag != ""', |
| 1043 | 1043 | $record['id'] |
| 1044 | 1044 | ); |
| 1045 | 1045 | foreach ($itemTags as $itemTag) { |
| 1046 | - $tags .= $itemTag['tag'] . ' '; |
|
| 1046 | + $tags .= $itemTag['tag'].' '; |
|
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | 1049 | // Get renewal period |
| 1050 | 1050 | $resNT = DB::queryfirstrow( |
| 1051 | 1051 | 'SELECT renewal_period |
| 1052 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 1052 | + FROM ' . prefixTable('nested_tree').' |
|
| 1053 | 1053 | WHERE id = %i', |
| 1054 | 1054 | $record['id_tree'] |
| 1055 | 1055 | ); |
@@ -1063,7 +1063,7 @@ discard block |
||
| 1063 | 1063 | // Is this a User id? |
| 1064 | 1064 | $user = DB::queryfirstrow( |
| 1065 | 1065 | 'SELECT id, login |
| 1066 | - FROM ' . prefixTable('users') . ' |
|
| 1066 | + FROM ' . prefixTable('users').' |
|
| 1067 | 1067 | WHERE id = %i', |
| 1068 | 1068 | $elem->title |
| 1069 | 1069 | ); |
@@ -1105,14 +1105,14 @@ discard block |
||
| 1105 | 1105 | */ |
| 1106 | 1106 | function cacheTableUpdate($SETTINGS, $ident = null) |
| 1107 | 1107 | { |
| 1108 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1108 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1109 | 1109 | |
| 1110 | 1110 | // Load superglobal |
| 1111 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1111 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1112 | 1112 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1113 | 1113 | |
| 1114 | 1114 | //Connect to DB |
| 1115 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1115 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1116 | 1116 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1117 | 1117 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1118 | 1118 | } |
@@ -1131,7 +1131,7 @@ discard block |
||
| 1131 | 1131 | // get new value from db |
| 1132 | 1132 | $data = DB::queryfirstrow( |
| 1133 | 1133 | 'SELECT label, description, id_tree, perso, restricted_to, login, url |
| 1134 | - FROM ' . prefixTable('items') . ' |
|
| 1134 | + FROM ' . prefixTable('items').' |
|
| 1135 | 1135 | WHERE id=%i', |
| 1136 | 1136 | $ident |
| 1137 | 1137 | ); |
@@ -1139,12 +1139,12 @@ discard block |
||
| 1139 | 1139 | $tags = ''; |
| 1140 | 1140 | $itemTags = DB::query( |
| 1141 | 1141 | 'SELECT tag |
| 1142 | - FROM ' . prefixTable('tags') . ' |
|
| 1142 | + FROM ' . prefixTable('tags').' |
|
| 1143 | 1143 | WHERE item_id = %i AND tag != ""', |
| 1144 | 1144 | $ident |
| 1145 | 1145 | ); |
| 1146 | 1146 | foreach ($itemTags as $itemTag) { |
| 1147 | - $tags .= $itemTag['tag'] . ' '; |
|
| 1147 | + $tags .= $itemTag['tag'].' '; |
|
| 1148 | 1148 | } |
| 1149 | 1149 | // form id_tree to full foldername |
| 1150 | 1150 | $folder = array(); |
@@ -1155,7 +1155,7 @@ discard block |
||
| 1155 | 1155 | // Is this a User id? |
| 1156 | 1156 | $user = DB::queryfirstrow( |
| 1157 | 1157 | 'SELECT id, login |
| 1158 | - FROM ' . prefixTable('users') . ' |
|
| 1158 | + FROM ' . prefixTable('users').' |
|
| 1159 | 1159 | WHERE id = %i', |
| 1160 | 1160 | $elem->title |
| 1161 | 1161 | ); |
@@ -1194,17 +1194,17 @@ discard block |
||
| 1194 | 1194 | */ |
| 1195 | 1195 | function cacheTableAdd($SETTINGS, $ident = null) |
| 1196 | 1196 | { |
| 1197 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1197 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1198 | 1198 | |
| 1199 | 1199 | // Load superglobal |
| 1200 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1200 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1201 | 1201 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1202 | 1202 | |
| 1203 | 1203 | // Get superglobals |
| 1204 | 1204 | $globalsUserId = $superGlobal->get('user_id', 'SESSION'); |
| 1205 | 1205 | |
| 1206 | 1206 | //Connect to DB |
| 1207 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1207 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1208 | 1208 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1209 | 1209 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1210 | 1210 | } |
@@ -1223,8 +1223,8 @@ discard block |
||
| 1223 | 1223 | // get new value from db |
| 1224 | 1224 | $data = DB::queryFirstRow( |
| 1225 | 1225 | 'SELECT i.label, i.description, i.id_tree as id_tree, i.perso, i.restricted_to, i.id, i.login, i.url, l.date |
| 1226 | - FROM ' . prefixTable('items') . ' as i |
|
| 1227 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 1226 | + FROM ' . prefixTable('items').' as i |
|
| 1227 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 1228 | 1228 | WHERE i.id = %i |
| 1229 | 1229 | AND l.action = %s', |
| 1230 | 1230 | $ident, |
@@ -1234,12 +1234,12 @@ discard block |
||
| 1234 | 1234 | $tags = ''; |
| 1235 | 1235 | $itemTags = DB::query( |
| 1236 | 1236 | 'SELECT tag |
| 1237 | - FROM ' . prefixTable('tags') . ' |
|
| 1237 | + FROM ' . prefixTable('tags').' |
|
| 1238 | 1238 | WHERE item_id = %i AND tag != ""', |
| 1239 | 1239 | $ident |
| 1240 | 1240 | ); |
| 1241 | 1241 | foreach ($itemTags as $itemTag) { |
| 1242 | - $tags .= $itemTag['tag'] . ' '; |
|
| 1242 | + $tags .= $itemTag['tag'].' '; |
|
| 1243 | 1243 | } |
| 1244 | 1244 | // form id_tree to full foldername |
| 1245 | 1245 | $folder = array(); |
@@ -1250,7 +1250,7 @@ discard block |
||
| 1250 | 1250 | // Is this a User id? |
| 1251 | 1251 | $user = DB::queryfirstrow( |
| 1252 | 1252 | 'SELECT id, login |
| 1253 | - FROM ' . prefixTable('users') . ' |
|
| 1253 | + FROM ' . prefixTable('users').' |
|
| 1254 | 1254 | WHERE id = %i', |
| 1255 | 1255 | $elem->title |
| 1256 | 1256 | ); |
@@ -1291,48 +1291,48 @@ discard block |
||
| 1291 | 1291 | function getStatisticsData($SETTINGS) |
| 1292 | 1292 | { |
| 1293 | 1293 | DB::query( |
| 1294 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', |
|
| 1294 | + 'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', |
|
| 1295 | 1295 | 0 |
| 1296 | 1296 | ); |
| 1297 | 1297 | $counter_folders = DB::count(); |
| 1298 | 1298 | |
| 1299 | 1299 | DB::query( |
| 1300 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', |
|
| 1300 | + 'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', |
|
| 1301 | 1301 | 1 |
| 1302 | 1302 | ); |
| 1303 | 1303 | $counter_folders_perso = DB::count(); |
| 1304 | 1304 | |
| 1305 | 1305 | DB::query( |
| 1306 | - 'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', |
|
| 1306 | + 'SELECT id FROM '.prefixTable('items').' WHERE perso = %i', |
|
| 1307 | 1307 | 0 |
| 1308 | 1308 | ); |
| 1309 | 1309 | $counter_items = DB::count(); |
| 1310 | 1310 | |
| 1311 | 1311 | DB::query( |
| 1312 | - 'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', |
|
| 1312 | + 'SELECT id FROM '.prefixTable('items').' WHERE perso = %i', |
|
| 1313 | 1313 | 1 |
| 1314 | 1314 | ); |
| 1315 | 1315 | $counter_items_perso = DB::count(); |
| 1316 | 1316 | |
| 1317 | 1317 | DB::query( |
| 1318 | - 'SELECT id FROM ' . prefixTable('users') . '' |
|
| 1318 | + 'SELECT id FROM '.prefixTable('users').'' |
|
| 1319 | 1319 | ); |
| 1320 | 1320 | $counter_users = DB::count(); |
| 1321 | 1321 | |
| 1322 | 1322 | DB::query( |
| 1323 | - 'SELECT id FROM ' . prefixTable('users') . ' WHERE admin = %i', |
|
| 1323 | + 'SELECT id FROM '.prefixTable('users').' WHERE admin = %i', |
|
| 1324 | 1324 | 1 |
| 1325 | 1325 | ); |
| 1326 | 1326 | $admins = DB::count(); |
| 1327 | 1327 | |
| 1328 | 1328 | DB::query( |
| 1329 | - 'SELECT id FROM ' . prefixTable('users') . ' WHERE gestionnaire = %i', |
|
| 1329 | + 'SELECT id FROM '.prefixTable('users').' WHERE gestionnaire = %i', |
|
| 1330 | 1330 | 1 |
| 1331 | 1331 | ); |
| 1332 | 1332 | $managers = DB::count(); |
| 1333 | 1333 | |
| 1334 | 1334 | DB::query( |
| 1335 | - 'SELECT id FROM ' . prefixTable('users') . ' WHERE read_only = %i', |
|
| 1335 | + 'SELECT id FROM '.prefixTable('users').' WHERE read_only = %i', |
|
| 1336 | 1336 | 1 |
| 1337 | 1337 | ); |
| 1338 | 1338 | $readOnly = DB::count(); |
@@ -1340,11 +1340,11 @@ discard block |
||
| 1340 | 1340 | // list the languages |
| 1341 | 1341 | $usedLang = []; |
| 1342 | 1342 | $tp_languages = DB::query( |
| 1343 | - 'SELECT name FROM ' . prefixTable('languages') |
|
| 1343 | + 'SELECT name FROM '.prefixTable('languages') |
|
| 1344 | 1344 | ); |
| 1345 | 1345 | foreach ($tp_languages as $tp_language) { |
| 1346 | 1346 | DB::query( |
| 1347 | - 'SELECT * FROM ' . prefixTable('users') . ' WHERE user_language = %s', |
|
| 1347 | + 'SELECT * FROM '.prefixTable('users').' WHERE user_language = %s', |
|
| 1348 | 1348 | $tp_language['name'] |
| 1349 | 1349 | ); |
| 1350 | 1350 | $usedLang[$tp_language['name']] = round((DB::count() * 100 / $counter_users), 0); |
@@ -1353,7 +1353,7 @@ discard block |
||
| 1353 | 1353 | // get list of ips |
| 1354 | 1354 | $usedIp = []; |
| 1355 | 1355 | $tp_ips = DB::query( |
| 1356 | - 'SELECT user_ip FROM ' . prefixTable('users') |
|
| 1356 | + 'SELECT user_ip FROM '.prefixTable('users') |
|
| 1357 | 1357 | ); |
| 1358 | 1358 | foreach ($tp_ips as $ip) { |
| 1359 | 1359 | if (array_key_exists($ip['user_ip'], $usedIp)) { |
@@ -1415,21 +1415,21 @@ discard block |
||
| 1415 | 1415 | ) { |
| 1416 | 1416 | // CAse where email not defined |
| 1417 | 1417 | if ($email === 'none' || empty($email) === true) { |
| 1418 | - return '"error":"" , "message":"' . langHdl('forgot_my_pw_email_sent') . '"'; |
|
| 1418 | + return '"error":"" , "message":"'.langHdl('forgot_my_pw_email_sent').'"'; |
|
| 1419 | 1419 | } |
| 1420 | 1420 | |
| 1421 | 1421 | // Load settings |
| 1422 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 1422 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 1423 | 1423 | |
| 1424 | 1424 | // Load superglobal |
| 1425 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1425 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1426 | 1426 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1427 | 1427 | |
| 1428 | 1428 | // Get user language |
| 1429 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $superGlobal->get('user_language', 'SESSION') . '.php'; |
|
| 1429 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$superGlobal->get('user_language', 'SESSION').'.php'; |
|
| 1430 | 1430 | |
| 1431 | 1431 | // Load library |
| 1432 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1432 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1433 | 1433 | |
| 1434 | 1434 | // load PHPMailer |
| 1435 | 1435 | $mail = new SplClassLoader('PHPMailer\PHPMailer', '../includes/libraries'); |
@@ -1437,7 +1437,7 @@ discard block |
||
| 1437 | 1437 | $mail = new PHPMailer\PHPMailer\PHPMailer(true); |
| 1438 | 1438 | try { |
| 1439 | 1439 | // send to user |
| 1440 | - $mail->setLanguage('en', $SETTINGS['cpassman_dir'] . '/includes/libraries/PHPMailer/PHPMailer/language/'); |
|
| 1440 | + $mail->setLanguage('en', $SETTINGS['cpassman_dir'].'/includes/libraries/PHPMailer/PHPMailer/language/'); |
|
| 1441 | 1441 | $mail->SMTPDebug = 0; //value 1 can be used to debug - 4 for debuging connections |
| 1442 | 1442 | $mail->Port = $SETTINGS['email_port']; //COULD BE USED |
| 1443 | 1443 | $mail->CharSet = 'utf-8'; |
@@ -1523,7 +1523,7 @@ discard block |
||
| 1523 | 1523 | <table width="600" cellpadding="0" cellspacing="0" border="0" class="container" bgcolor="#ffffff" style="border-spacing: 0; border-bottom: 1px solid #e0e0e0; box-shadow: 0 0 3px #ddd; color: #434343; font-family: Helvetica, Verdana, sans-serif;"> |
| 1524 | 1524 | <tr><td class="container-padding" bgcolor="#ffffff" style="border-collapse: collapse; border-left: 1px solid #e0e0e0; background-color: #ffffff; padding-left: 30px; padding-right: 30px;"> |
| 1525 | 1525 | <br><div style="float:right;">' . |
| 1526 | - $textMail . |
|
| 1526 | + $textMail. |
|
| 1527 | 1527 | '<br><br></td></tr></table> |
| 1528 | 1528 | </td></tr></table> |
| 1529 | 1529 | <br></body></html>'; |
@@ -1536,7 +1536,7 @@ discard block |
||
| 1536 | 1536 | */ |
| 1537 | 1537 | function generateKey() |
| 1538 | 1538 | { |
| 1539 | - return substr(md5(rand() . rand()), 0, 15); |
|
| 1539 | + return substr(md5(rand().rand()), 0, 15); |
|
| 1540 | 1540 | } |
| 1541 | 1541 | |
| 1542 | 1542 | /** |
@@ -1606,7 +1606,7 @@ discard block |
||
| 1606 | 1606 | { |
| 1607 | 1607 | array_walk_recursive( |
| 1608 | 1608 | $array, |
| 1609 | - function (&$item) { |
|
| 1609 | + function(&$item) { |
|
| 1610 | 1610 | if (mb_detect_encoding($item, 'utf-8', true) === false) { |
| 1611 | 1611 | $item = utf8_encode($item); |
| 1612 | 1612 | } |
@@ -1642,7 +1642,7 @@ discard block |
||
| 1642 | 1642 | } |
| 1643 | 1643 | |
| 1644 | 1644 | // Load superglobal |
| 1645 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1645 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1646 | 1646 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1647 | 1647 | |
| 1648 | 1648 | // Get superglobals |
@@ -1654,9 +1654,9 @@ discard block |
||
| 1654 | 1654 | } |
| 1655 | 1655 | |
| 1656 | 1656 | //load ClassLoader |
| 1657 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1657 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1658 | 1658 | //Load AES |
| 1659 | - $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1659 | + $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1660 | 1660 | $aes->register(); |
| 1661 | 1661 | |
| 1662 | 1662 | if ($type === 'encode' && is_array($data) === true) { |
@@ -1711,7 +1711,7 @@ discard block |
||
| 1711 | 1711 | function makeThumbnail($src, $dest, $desired_width) |
| 1712 | 1712 | { |
| 1713 | 1713 | /* read the source image */ |
| 1714 | - if(is_file($src) === true && mime_content_type($src) === 'image/png'){ |
|
| 1714 | + if (is_file($src) === true && mime_content_type($src) === 'image/png') { |
|
| 1715 | 1715 | $source_image = imagecreatefrompng($src); |
| 1716 | 1716 | if ($source_image === false) { |
| 1717 | 1717 | return "Error: Not a valid PNG file! It's type is ".mime_content_type($src); |
@@ -1748,7 +1748,7 @@ discard block |
||
| 1748 | 1748 | */ |
| 1749 | 1749 | function prefixTable($table) |
| 1750 | 1750 | { |
| 1751 | - $safeTable = htmlspecialchars(DB_PREFIX . $table); |
|
| 1751 | + $safeTable = htmlspecialchars(DB_PREFIX.$table); |
|
| 1752 | 1752 | if (!empty($safeTable)) { |
| 1753 | 1753 | // sanitize string |
| 1754 | 1754 | return $safeTable; |
@@ -1780,14 +1780,14 @@ discard block |
||
| 1780 | 1780 | $lowercase = false, |
| 1781 | 1781 | $SETTINGS |
| 1782 | 1782 | ) { |
| 1783 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1784 | - $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1783 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1784 | + $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1785 | 1785 | $generator->register(); |
| 1786 | 1786 | $generator = new PasswordGenerator\Generator\ComputerPasswordGenerator(); |
| 1787 | 1787 | |
| 1788 | 1788 | // Is PHP7 being used? |
| 1789 | 1789 | if (version_compare(PHP_VERSION, '7.0.0', '>=')) { |
| 1790 | - $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1790 | + $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1791 | 1791 | $php7generator->register(); |
| 1792 | 1792 | $generator->setRandomGenerator(new PasswordGenerator\RandomGenerator\Php7RandomGenerator()); |
| 1793 | 1793 | } |
@@ -1818,7 +1818,7 @@ discard block |
||
| 1818 | 1818 | function send_syslog($message, $host, $port, $component = 'teampass') |
| 1819 | 1819 | { |
| 1820 | 1820 | $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); |
| 1821 | - $syslog_message = '<123>' . date('M d H:i:s ') . $component . ': ' . $message; |
|
| 1821 | + $syslog_message = '<123>'.date('M d H:i:s ').$component.': '.$message; |
|
| 1822 | 1822 | socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $host, $port); |
| 1823 | 1823 | socket_close($sock); |
| 1824 | 1824 | } |
@@ -1842,7 +1842,7 @@ discard block |
||
| 1842 | 1842 | } |
| 1843 | 1843 | |
| 1844 | 1844 | // include librairies & connect to DB |
| 1845 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1845 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1846 | 1846 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1847 | 1847 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1848 | 1848 | } |
@@ -1868,14 +1868,14 @@ discard block |
||
| 1868 | 1868 | if (isset($SETTINGS['syslog_enable']) === true && (int) $SETTINGS['syslog_enable'] === 1) { |
| 1869 | 1869 | if ($type === 'user_mngt') { |
| 1870 | 1870 | send_syslog( |
| 1871 | - 'action=' . str_replace('at_', '', $label) . ' attribute=user user=' . $who . ' userid="' . $login . '" change="' . $field_1 . '" ', |
|
| 1871 | + 'action='.str_replace('at_', '', $label).' attribute=user user='.$who.' userid="'.$login.'" change="'.$field_1.'" ', |
|
| 1872 | 1872 | $SETTINGS['syslog_host'], |
| 1873 | 1873 | $SETTINGS['syslog_port'], |
| 1874 | 1874 | 'teampass' |
| 1875 | 1875 | ); |
| 1876 | 1876 | } else { |
| 1877 | 1877 | send_syslog( |
| 1878 | - 'action=' . $type . ' attribute=' . $label . ' user=' . $who . ' userid="' . $login . '" ', |
|
| 1878 | + 'action='.$type.' attribute='.$label.' user='.$who.' userid="'.$login.'" ', |
|
| 1879 | 1879 | $SETTINGS['syslog_host'], |
| 1880 | 1880 | $SETTINGS['syslog_port'], |
| 1881 | 1881 | 'teampass' |
@@ -1907,7 +1907,7 @@ discard block |
||
| 1907 | 1907 | $encryption_type = null |
| 1908 | 1908 | ) { |
| 1909 | 1909 | // include librairies & connect to DB |
| 1910 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1910 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1911 | 1911 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1912 | 1912 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1913 | 1913 | } |
@@ -1953,7 +1953,7 @@ discard block |
||
| 1953 | 1953 | if (empty($item_label) === true) { |
| 1954 | 1954 | $dataItem = DB::queryfirstrow( |
| 1955 | 1955 | 'SELECT id, id_tree, label |
| 1956 | - FROM ' . prefixTable('items') . ' |
|
| 1956 | + FROM ' . prefixTable('items').' |
|
| 1957 | 1957 | WHERE id = %i', |
| 1958 | 1958 | $item_id |
| 1959 | 1959 | ); |
@@ -1962,7 +1962,7 @@ discard block |
||
| 1962 | 1962 | } |
| 1963 | 1963 | |
| 1964 | 1964 | send_syslog( |
| 1965 | - 'action=' . str_replace('at_', '', $action) . ' attribute=' . str_replace('at_', '', $attribute[0]) . ' itemno=' . $item_id . ' user=' . addslashes($login) . ' itemname="' . addslashes($item_label) . '"', |
|
| 1965 | + 'action='.str_replace('at_', '', $action).' attribute='.str_replace('at_', '', $attribute[0]).' itemno='.$item_id.' user='.addslashes($login).' itemname="'.addslashes($item_label).'"', |
|
| 1966 | 1966 | $SETTINGS['syslog_host'], |
| 1967 | 1967 | $SETTINGS['syslog_port'], |
| 1968 | 1968 | 'teampass' |
@@ -1988,7 +1988,7 @@ discard block |
||
| 1988 | 1988 | && $action === 'at_shown' |
| 1989 | 1989 | ) { |
| 1990 | 1990 | // Load superglobal |
| 1991 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1991 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1992 | 1992 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1993 | 1993 | |
| 1994 | 1994 | // Get superglobals |
@@ -1999,7 +1999,7 @@ discard block |
||
| 1999 | 1999 | // Get info about item |
| 2000 | 2000 | $dataItem = DB::queryfirstrow( |
| 2001 | 2001 | 'SELECT id, id_tree, label |
| 2002 | - FROM ' . prefixTable('items') . ' |
|
| 2002 | + FROM ' . prefixTable('items').' |
|
| 2003 | 2003 | WHERE id = %i', |
| 2004 | 2004 | $item_id |
| 2005 | 2005 | ); |
@@ -2014,9 +2014,9 @@ discard block |
||
| 2014 | 2014 | 'body' => str_replace( |
| 2015 | 2015 | array('#tp_user#', '#tp_item#', '#tp_link#'), |
| 2016 | 2016 | array( |
| 2017 | - addslashes($globalsName . ' ' . $globalsLastname), |
|
| 2017 | + addslashes($globalsName.' '.$globalsLastname), |
|
| 2018 | 2018 | addslashes($item_label), |
| 2019 | - $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $item_id, |
|
| 2019 | + $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$item_id, |
|
| 2020 | 2020 | ), |
| 2021 | 2021 | langHdl('email_on_open_notification_mail') |
| 2022 | 2022 | ), |
@@ -2038,7 +2038,7 @@ discard block |
||
| 2038 | 2038 | function notifyChangesToSubscribers($item_id, $label, $changes, $SETTINGS) |
| 2039 | 2039 | { |
| 2040 | 2040 | // Load superglobal |
| 2041 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2041 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2042 | 2042 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 2043 | 2043 | |
| 2044 | 2044 | // Get superglobals |
@@ -2050,8 +2050,8 @@ discard block |
||
| 2050 | 2050 | $notification = DB::queryOneColumn( |
| 2051 | 2051 | 'email', |
| 2052 | 2052 | 'SELECT * |
| 2053 | - FROM ' . prefixTable('notification') . ' AS n |
|
| 2054 | - INNER JOIN ' . prefixTable('users') . ' AS u ON (n.user_id = u.id) |
|
| 2053 | + FROM ' . prefixTable('notification').' AS n |
|
| 2054 | + INNER JOIN ' . prefixTable('users').' AS u ON (n.user_id = u.id) |
|
| 2055 | 2055 | WHERE n.item_id = %i AND n.user_id != %i', |
| 2056 | 2056 | $item_id, |
| 2057 | 2057 | $globalsUserId |
@@ -2064,7 +2064,7 @@ discard block |
||
| 2064 | 2064 | // Get list of changes |
| 2065 | 2065 | $htmlChanges = '<ul>'; |
| 2066 | 2066 | foreach ($changes as $change) { |
| 2067 | - $htmlChanges .= '<li>' . $change . '</li>'; |
|
| 2067 | + $htmlChanges .= '<li>'.$change.'</li>'; |
|
| 2068 | 2068 | } |
| 2069 | 2069 | $htmlChanges .= '</ul>'; |
| 2070 | 2070 | |
@@ -2098,7 +2098,7 @@ discard block |
||
| 2098 | 2098 | function geItemReadablePath($id_tree, $label, $SETTINGS) |
| 2099 | 2099 | { |
| 2100 | 2100 | // Class loader |
| 2101 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 2101 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 2102 | 2102 | |
| 2103 | 2103 | //Load Tree |
| 2104 | 2104 | $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries'); |
@@ -2109,15 +2109,15 @@ discard block |
||
| 2109 | 2109 | $path = ''; |
| 2110 | 2110 | foreach ($arbo as $elem) { |
| 2111 | 2111 | if (empty($path) === true) { |
| 2112 | - $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' '; |
|
| 2112 | + $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' '; |
|
| 2113 | 2113 | } else { |
| 2114 | - $path .= '→ ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 2114 | + $path .= '→ '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 2115 | 2115 | } |
| 2116 | 2116 | } |
| 2117 | 2117 | |
| 2118 | 2118 | // Build text to show user |
| 2119 | 2119 | if (empty($label) === false) { |
| 2120 | - return empty($path) === true ? addslashes($label) : addslashes($label) . ' (' . $path . ')'; |
|
| 2120 | + return empty($path) === true ? addslashes($label) : addslashes($label).' ('.$path.')'; |
|
| 2121 | 2121 | } else { |
| 2122 | 2122 | return empty($path) === true ? '' : $path; |
| 2123 | 2123 | } |
@@ -2176,10 +2176,10 @@ discard block |
||
| 2176 | 2176 | */ |
| 2177 | 2177 | function handleConfigFile($action, $SETTINGS, $field = null, $value = null) |
| 2178 | 2178 | { |
| 2179 | - $tp_config_file = $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php'; |
|
| 2179 | + $tp_config_file = $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php'; |
|
| 2180 | 2180 | |
| 2181 | 2181 | // include librairies & connect to DB |
| 2182 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2182 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2183 | 2183 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 2184 | 2184 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 2185 | 2185 | } |
@@ -2193,8 +2193,8 @@ discard block |
||
| 2193 | 2193 | if (file_exists($tp_config_file) === false || $action === 'rebuild') { |
| 2194 | 2194 | // perform a copy |
| 2195 | 2195 | if (file_exists($tp_config_file)) { |
| 2196 | - if (!copy($tp_config_file, $tp_config_file . '.' . date('Y_m_d_His', time()))) { |
|
| 2197 | - return "ERROR: Could not copy file '" . $tp_config_file . "'"; |
|
| 2196 | + if (!copy($tp_config_file, $tp_config_file.'.'.date('Y_m_d_His', time()))) { |
|
| 2197 | + return "ERROR: Could not copy file '".$tp_config_file."'"; |
|
| 2198 | 2198 | } |
| 2199 | 2199 | } |
| 2200 | 2200 | |
@@ -2205,11 +2205,11 @@ discard block |
||
| 2205 | 2205 | $data[1] = "global \$SETTINGS;\n"; |
| 2206 | 2206 | $data[2] = "\$SETTINGS = array (\n"; |
| 2207 | 2207 | $rows = DB::query( |
| 2208 | - 'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s', |
|
| 2208 | + 'SELECT * FROM '.prefixTable('misc').' WHERE type=%s', |
|
| 2209 | 2209 | 'admin' |
| 2210 | 2210 | ); |
| 2211 | 2211 | foreach ($rows as $record) { |
| 2212 | - array_push($data, " '" . $record['intitule'] . "' => '" . $record['valeur'] . "',\n"); |
|
| 2212 | + array_push($data, " '".$record['intitule']."' => '".$record['valeur']."',\n"); |
|
| 2213 | 2213 | } |
| 2214 | 2214 | array_push($data, ");\n"); |
| 2215 | 2215 | $data = array_unique($data); |
@@ -2223,15 +2223,15 @@ discard block |
||
| 2223 | 2223 | break; |
| 2224 | 2224 | } |
| 2225 | 2225 | |
| 2226 | - if (stristr($line, "'" . $field . "' => '")) { |
|
| 2227 | - $data[$inc] = " '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n"; |
|
| 2226 | + if (stristr($line, "'".$field."' => '")) { |
|
| 2227 | + $data[$inc] = " '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n"; |
|
| 2228 | 2228 | $bFound = true; |
| 2229 | 2229 | break; |
| 2230 | 2230 | } |
| 2231 | 2231 | ++$inc; |
| 2232 | 2232 | } |
| 2233 | 2233 | if ($bFound === false) { |
| 2234 | - $data[($inc)] = " '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n);\n"; |
|
| 2234 | + $data[($inc)] = " '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n);\n"; |
|
| 2235 | 2235 | } |
| 2236 | 2236 | } |
| 2237 | 2237 | |
@@ -2269,7 +2269,7 @@ discard block |
||
| 2269 | 2269 | $settings = array(); |
| 2270 | 2270 | |
| 2271 | 2271 | $rows = DB::query( |
| 2272 | - 'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s_type OR type=%s_type2', |
|
| 2272 | + 'SELECT * FROM '.prefixTable('misc').' WHERE type=%s_type OR type=%s_type2', |
|
| 2273 | 2273 | array( |
| 2274 | 2274 | 'type' => 'admin', |
| 2275 | 2275 | 'type2' => 'settings', |
@@ -2296,7 +2296,7 @@ discard block |
||
| 2296 | 2296 | $source_cf = array(); |
| 2297 | 2297 | $rows = DB::QUERY( |
| 2298 | 2298 | 'SELECT id_category |
| 2299 | - FROM ' . prefixTable('categories_folders') . ' |
|
| 2299 | + FROM ' . prefixTable('categories_folders').' |
|
| 2300 | 2300 | WHERE id_folder = %i', |
| 2301 | 2301 | $source_id |
| 2302 | 2302 | ); |
@@ -2307,7 +2307,7 @@ discard block |
||
| 2307 | 2307 | $target_cf = array(); |
| 2308 | 2308 | $rows = DB::QUERY( |
| 2309 | 2309 | 'SELECT id_category |
| 2310 | - FROM ' . prefixTable('categories_folders') . ' |
|
| 2310 | + FROM ' . prefixTable('categories_folders').' |
|
| 2311 | 2311 | WHERE id_folder = %i', |
| 2312 | 2312 | $target_id |
| 2313 | 2313 | ); |
@@ -2342,9 +2342,9 @@ discard block |
||
| 2342 | 2342 | $password = null |
| 2343 | 2343 | ) { |
| 2344 | 2344 | // Load AntiXSS |
| 2345 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 2346 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php'; |
|
| 2347 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php'; |
|
| 2345 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 2346 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php'; |
|
| 2347 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php'; |
|
| 2348 | 2348 | $antiXss = new voku\helper\AntiXSS(); |
| 2349 | 2349 | |
| 2350 | 2350 | // Protect against bad inputs |
@@ -2358,7 +2358,7 @@ discard block |
||
| 2358 | 2358 | |
| 2359 | 2359 | if (empty($password) === true || is_null($password) === true) { |
| 2360 | 2360 | // get KEY to define password |
| 2361 | - $ascii_key = file_get_contents(SECUREPATH . '/teampass-seckey.txt'); |
|
| 2361 | + $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt'); |
|
| 2362 | 2362 | $password = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key); |
| 2363 | 2363 | } |
| 2364 | 2364 | |
@@ -2404,15 +2404,15 @@ discard block |
||
| 2404 | 2404 | ) { |
| 2405 | 2405 | // load PhpEncryption library |
| 2406 | 2406 | $path_to_encryption = '/includes/libraries/Encryption/Encryption/'; |
| 2407 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php'; |
|
| 2408 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php'; |
|
| 2409 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php'; |
|
| 2410 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php'; |
|
| 2411 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php'; |
|
| 2412 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php'; |
|
| 2413 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php'; |
|
| 2414 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php'; |
|
| 2415 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php'; |
|
| 2407 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php'; |
|
| 2408 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php'; |
|
| 2409 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php'; |
|
| 2410 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php'; |
|
| 2411 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php'; |
|
| 2412 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php'; |
|
| 2413 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php'; |
|
| 2414 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php'; |
|
| 2415 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php'; |
|
| 2416 | 2416 | |
| 2417 | 2417 | try { |
| 2418 | 2418 | \Defuse\Crypto\File::encryptFileWithPassword( |
@@ -2450,15 +2450,15 @@ discard block |
||
| 2450 | 2450 | ) { |
| 2451 | 2451 | // load PhpEncryption library |
| 2452 | 2452 | $path_to_encryption = '/includes/libraries/Encryption/Encryption/'; |
| 2453 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php'; |
|
| 2454 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php'; |
|
| 2455 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php'; |
|
| 2456 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php'; |
|
| 2457 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php'; |
|
| 2458 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php'; |
|
| 2459 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php'; |
|
| 2460 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php'; |
|
| 2461 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php'; |
|
| 2453 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php'; |
|
| 2454 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php'; |
|
| 2455 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php'; |
|
| 2456 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php'; |
|
| 2457 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php'; |
|
| 2458 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php'; |
|
| 2459 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php'; |
|
| 2460 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php'; |
|
| 2461 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php'; |
|
| 2462 | 2462 | |
| 2463 | 2463 | try { |
| 2464 | 2464 | \Defuse\Crypto\File::decryptFileWithPassword( |
@@ -2504,9 +2504,9 @@ discard block |
||
| 2504 | 2504 | function fileDelete($file, $SETTINGS) |
| 2505 | 2505 | { |
| 2506 | 2506 | // Load AntiXSS |
| 2507 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php'; |
|
| 2508 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php'; |
|
| 2509 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 2507 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php'; |
|
| 2508 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php'; |
|
| 2509 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 2510 | 2510 | $antiXss = new voku\helper\AntiXSS(); |
| 2511 | 2511 | |
| 2512 | 2512 | $file = $antiXss->xss_clean($file); |
@@ -2552,7 +2552,7 @@ discard block |
||
| 2552 | 2552 | continue; |
| 2553 | 2553 | } |
| 2554 | 2554 | |
| 2555 | - $fullPath = $dir . '/' . $file; |
|
| 2555 | + $fullPath = $dir.'/'.$file; |
|
| 2556 | 2556 | |
| 2557 | 2557 | if (is_dir($fullPath)) { |
| 2558 | 2558 | if ($res = @chmod($fullPath, $dirPermissions)) { |
@@ -2582,7 +2582,7 @@ discard block |
||
| 2582 | 2582 | */ |
| 2583 | 2583 | function accessToItemIsGranted($item_id, $SETTINGS) |
| 2584 | 2584 | { |
| 2585 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2585 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2586 | 2586 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 2587 | 2587 | |
| 2588 | 2588 | // Prepare superGlobal variables |
@@ -2592,7 +2592,7 @@ discard block |
||
| 2592 | 2592 | // Load item data |
| 2593 | 2593 | $data = DB::queryFirstRow( |
| 2594 | 2594 | 'SELECT id_tree |
| 2595 | - FROM ' . prefixTable('items') . ' |
|
| 2595 | + FROM ' . prefixTable('items').' |
|
| 2596 | 2596 | WHERE id = %i', |
| 2597 | 2597 | $item_id |
| 2598 | 2598 | ); |
@@ -2674,8 +2674,8 @@ discard block |
||
| 2674 | 2674 | function performDBQuery($SETTINGS, $fields, $table) |
| 2675 | 2675 | { |
| 2676 | 2676 | // include librairies & connect to DB |
| 2677 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 2678 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2677 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 2678 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2679 | 2679 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 2680 | 2680 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 2681 | 2681 | } |
@@ -2688,7 +2688,7 @@ discard block |
||
| 2688 | 2688 | |
| 2689 | 2689 | // Insert log in DB |
| 2690 | 2690 | return DB::query( |
| 2691 | - 'SELECT ' . $fields . ' |
|
| 2691 | + 'SELECT '.$fields.' |
|
| 2692 | 2692 | FROM ' . prefixTable($table) |
| 2693 | 2693 | ); |
| 2694 | 2694 | } |
@@ -2703,15 +2703,15 @@ discard block |
||
| 2703 | 2703 | function formatSizeUnits($bytes) |
| 2704 | 2704 | { |
| 2705 | 2705 | if ($bytes >= 1073741824) { |
| 2706 | - $bytes = number_format($bytes / 1073741824, 2) . ' GB'; |
|
| 2706 | + $bytes = number_format($bytes / 1073741824, 2).' GB'; |
|
| 2707 | 2707 | } elseif ($bytes >= 1048576) { |
| 2708 | - $bytes = number_format($bytes / 1048576, 2) . ' MB'; |
|
| 2708 | + $bytes = number_format($bytes / 1048576, 2).' MB'; |
|
| 2709 | 2709 | } elseif ($bytes >= 1024) { |
| 2710 | - $bytes = number_format($bytes / 1024, 2) . ' KB'; |
|
| 2710 | + $bytes = number_format($bytes / 1024, 2).' KB'; |
|
| 2711 | 2711 | } elseif ($bytes > 1) { |
| 2712 | - $bytes = $bytes . ' bytes'; |
|
| 2712 | + $bytes = $bytes.' bytes'; |
|
| 2713 | 2713 | } elseif ($bytes == 1) { |
| 2714 | - $bytes = $bytes . ' byte'; |
|
| 2714 | + $bytes = $bytes.' byte'; |
|
| 2715 | 2715 | } else { |
| 2716 | 2716 | $bytes = '0 bytes'; |
| 2717 | 2717 | } |
@@ -2891,7 +2891,7 @@ discard block |
||
| 2891 | 2891 | // Decrypt |
| 2892 | 2892 | try { |
| 2893 | 2893 | $ret = base64_encode($rsa->decrypt(base64_decode($key))); |
| 2894 | - } catch(Exception $e) { |
|
| 2894 | + } catch (Exception $e) { |
|
| 2895 | 2895 | return $e; |
| 2896 | 2896 | } |
| 2897 | 2897 | |
@@ -2933,16 +2933,16 @@ discard block |
||
| 2933 | 2933 | |
| 2934 | 2934 | // Encrypt the file content |
| 2935 | 2935 | $plaintext = file_get_contents( |
| 2936 | - filter_var($fileInPath . '/' . $fileInName, FILTER_SANITIZE_URL) |
|
| 2936 | + filter_var($fileInPath.'/'.$fileInName, FILTER_SANITIZE_URL) |
|
| 2937 | 2937 | ); |
| 2938 | 2938 | |
| 2939 | 2939 | $ciphertext = $cipher->encrypt($plaintext); |
| 2940 | 2940 | |
| 2941 | 2941 | // Save new file |
| 2942 | 2942 | $hash = md5($plaintext); |
| 2943 | - $fileOut = $fileInPath . '/' . TP_FILE_PREFIX . $hash; |
|
| 2943 | + $fileOut = $fileInPath.'/'.TP_FILE_PREFIX.$hash; |
|
| 2944 | 2944 | file_put_contents($fileOut, $ciphertext); |
| 2945 | - unlink($fileInPath . '/' . $fileInName); |
|
| 2945 | + unlink($fileInPath.'/'.$fileInName); |
|
| 2946 | 2946 | |
| 2947 | 2947 | return array( |
| 2948 | 2948 | 'fileHash' => base64_encode($hash), |
@@ -2985,7 +2985,7 @@ discard block |
||
| 2985 | 2985 | $cipher->disablePadding(); |
| 2986 | 2986 | |
| 2987 | 2987 | // Get file content |
| 2988 | - $ciphertext = file_get_contents($filePath . '/' . TP_FILE_PREFIX . $fileName); |
|
| 2988 | + $ciphertext = file_get_contents($filePath.'/'.TP_FILE_PREFIX.$fileName); |
|
| 2989 | 2989 | |
| 2990 | 2990 | // Decrypt file content and return |
| 2991 | 2991 | return base64_encode($cipher->decrypt($ciphertext)); |
@@ -3041,8 +3041,8 @@ discard block |
||
| 3041 | 3041 | $SETTINGS |
| 3042 | 3042 | ) { |
| 3043 | 3043 | // include librairies & connect to DB |
| 3044 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 3045 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 3044 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 3045 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 3046 | 3046 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 3047 | 3047 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 3048 | 3048 | } |
@@ -3061,7 +3061,7 @@ discard block |
||
| 3061 | 3061 | ); |
| 3062 | 3062 | |
| 3063 | 3063 | // Superglobals |
| 3064 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 3064 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 3065 | 3065 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 3066 | 3066 | |
| 3067 | 3067 | // Prepare superGlobal variables |
@@ -3088,8 +3088,8 @@ discard block |
||
| 3088 | 3088 | // Create sharekey for each user |
| 3089 | 3089 | $users = DB::query( |
| 3090 | 3090 | 'SELECT id, public_key |
| 3091 | - FROM ' . prefixTable('users') . ' |
|
| 3092 | - WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '") |
|
| 3091 | + FROM ' . prefixTable('users').' |
|
| 3092 | + WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'") |
|
| 3093 | 3093 | AND public_key != ""' |
| 3094 | 3094 | ); |
| 3095 | 3095 | foreach ($users as $user) { |
@@ -3190,13 +3190,13 @@ discard block |
||
| 3190 | 3190 | ]; |
| 3191 | 3191 | |
| 3192 | 3192 | // Load expected libraries |
| 3193 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 3194 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 3195 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 3196 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php'; |
|
| 3197 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 3198 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php'; |
|
| 3199 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php'; |
|
| 3193 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 3194 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 3195 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 3196 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php'; |
|
| 3197 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 3198 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php'; |
|
| 3199 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php'; |
|
| 3200 | 3200 | |
| 3201 | 3201 | $ad = new SplClassLoader('LdapRecord', '../includes/libraries'); |
| 3202 | 3202 | $ad->register(); |
@@ -3209,7 +3209,7 @@ discard block |
||
| 3209 | 3209 | } catch (\LdapRecord\Auth\BindException $e) { |
| 3210 | 3210 | $error = $e->getDetailedError(); |
| 3211 | 3211 | |
| 3212 | - echo "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage(); |
|
| 3212 | + echo "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage(); |
|
| 3213 | 3213 | return false; |
| 3214 | 3214 | } |
| 3215 | 3215 | |
@@ -3220,7 +3220,7 @@ discard block |
||
| 3220 | 3220 | } catch (\LdapRecord\Auth\BindException $e) { |
| 3221 | 3221 | $error = $e->getDetailedError(); |
| 3222 | 3222 | |
| 3223 | - echo "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage(); |
|
| 3223 | + echo "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage(); |
|
| 3224 | 3224 | return false; |
| 3225 | 3225 | } |
| 3226 | 3226 | |
@@ -3241,8 +3241,8 @@ discard block |
||
| 3241 | 3241 | function deleteUserObjetsKeys($userId, $SETTINGS) |
| 3242 | 3242 | { |
| 3243 | 3243 | // include librairies & connect to DB |
| 3244 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 3245 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 3244 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 3245 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 3246 | 3246 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 3247 | 3247 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 3248 | 3248 | } |
@@ -3303,7 +3303,7 @@ discard block |
||
| 3303 | 3303 | foreach (DateTimeZone::listIdentifiers() as $timezone) { |
| 3304 | 3304 | $now->setTimezone(new DateTimeZone($timezone)); |
| 3305 | 3305 | $offsets[] = $offset = $now->getOffset(); |
| 3306 | - $timezones[$timezone] = '(' . format_GMT_offset($offset) . ') ' . format_timezone_name($timezone); |
|
| 3306 | + $timezones[$timezone] = '('.format_GMT_offset($offset).') '.format_timezone_name($timezone); |
|
| 3307 | 3307 | } |
| 3308 | 3308 | |
| 3309 | 3309 | array_multisort($offsets, $timezones); |
@@ -3315,7 +3315,7 @@ discard block |
||
| 3315 | 3315 | function format_GMT_offset($offset) { |
| 3316 | 3316 | $hours = intval($offset / 3600); |
| 3317 | 3317 | $minutes = abs(intval($offset % 3600 / 60)); |
| 3318 | - return 'GMT' . ($offset ? sprintf('%+03d:%02d', $hours, $minutes) : ''); |
|
| 3318 | + return 'GMT'.($offset ? sprintf('%+03d:%02d', $hours, $minutes) : ''); |
|
| 3319 | 3319 | } |
| 3320 | 3320 | |
| 3321 | 3321 | function format_timezone_name($name) { |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | // includes |
| 43 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 44 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 45 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 47 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 43 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 44 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 45 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 47 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 48 | 48 | |
| 49 | 49 | // header |
| 50 | 50 | header('Content-type: text/html; charset=utf-8'); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // Connect to mysql server |
| 61 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 61 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 62 | 62 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 63 | 63 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 64 | 64 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | DB::$encoding = DB_ENCODING; |
| 71 | 71 | |
| 72 | 72 | // Superglobal load |
| 73 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 73 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 74 | 74 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 75 | 75 | |
| 76 | 76 | $session_user_admin = $superGlobal->get('user_admin', 'GET'); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | $lastFolderChange = DB::query( |
| 82 | - 'SELECT * FROM ' . prefixTable('misc') . ' |
|
| 82 | + 'SELECT * FROM '.prefixTable('misc').' |
|
| 83 | 83 | WHERE type = %s AND intitule = %s', |
| 84 | 84 | 'timestamp', |
| 85 | 85 | 'last_folder_change' |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | || (isset($_GET['force_refresh']) === true && (int) $_GET['force_refresh'] === 1) |
| 91 | 91 | ) { |
| 92 | 92 | // Build tree |
| 93 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 93 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 94 | 94 | $tree->register(); |
| 95 | 95 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 96 | 96 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $SETTINGS |
| 190 | 190 | ) { |
| 191 | 191 | // Load library |
| 192 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 192 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 193 | 193 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 194 | 194 | |
| 195 | 195 | // Prepare superGlobal variables |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | // get count of Items in this folder |
| 244 | 244 | DB::query( |
| 245 | 245 | 'SELECT * |
| 246 | - FROM ' . prefixTable('items') . ' |
|
| 246 | + FROM ' . prefixTable('items').' |
|
| 247 | 247 | WHERE inactif=%i AND id_tree = %i', |
| 248 | 248 | 0, |
| 249 | 249 | $node->id |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | // get info about current folder |
| 254 | 254 | DB::query( |
| 255 | 255 | 'SELECT * |
| 256 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 256 | + FROM ' . prefixTable('nested_tree').' |
|
| 257 | 257 | WHERE parent_id = %i', |
| 258 | 258 | $node->id |
| 259 | 259 | ); |
@@ -261,11 +261,10 @@ discard block |
||
| 261 | 261 | |
| 262 | 262 | // If personal Folder, convert id into user name |
| 263 | 263 | $node->title = ($node->title === $session_user_id && (int) $node->nlevel === 1) ? |
| 264 | - $session_login : |
|
| 265 | - ($node->title === null ? '' : htmlspecialchars_decode($node->title, ENT_QUOTES)); |
|
| 264 | + $session_login : ($node->title === null ? '' : htmlspecialchars_decode($node->title, ENT_QUOTES)); |
|
| 266 | 265 | |
| 267 | 266 | // prepare json return for current node |
| 268 | - $parent = ($node->parent_id == 0) ? '#' : 'li_' . $node->parent_id; |
|
| 267 | + $parent = ($node->parent_id == 0) ? '#' : 'li_'.$node->parent_id; |
|
| 269 | 268 | |
| 270 | 269 | // special case for READ-ONLY folder |
| 271 | 270 | $title = ($session_user_read_only === true && !in_array($node->id, $session_personal_folders)) ? langHdl('read_only_account') : $title; |
@@ -275,36 +274,33 @@ discard block |
||
| 275 | 274 | |
| 276 | 275 | if (in_array($node->id, $session_groupes_visibles)) { |
| 277 | 276 | if (in_array($node->id, $session_read_only_folders)) { |
| 278 | - $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text; |
|
| 277 | + $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text; |
|
| 279 | 278 | $title = langHdl('read_only_account'); |
| 280 | 279 | $restricted = 1; |
| 281 | 280 | $folderClass = 'folder_not_droppable'; |
| 282 | 281 | } elseif ($session_user_read_only === true && !in_array($node->id, $session_personal_visible_groups)) { |
| 283 | - $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text; |
|
| 282 | + $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text; |
|
| 284 | 283 | } |
| 285 | 284 | $text .= |
| 286 | - ' <span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_' . $node->id . '\'>' . $itemsNb . '</span>' |
|
| 285 | + ' <span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_'.$node->id.'\'>'.$itemsNb.'</span>' |
|
| 287 | 286 | .((isset($SETTINGS['tree_counters']) && $SETTINGS['tree_counters'] == 1) ? |
| 288 | - '/'.$nbChildrenItems . |
|
| 289 | - '/'.(count($nodeDescendants) - 1) : |
|
| 290 | - '') |
|
| 287 | + '/'.$nbChildrenItems. |
|
| 288 | + '/'.(count($nodeDescendants) - 1) : '') |
|
| 291 | 289 | .'</span>'; |
| 292 | 290 | } elseif (in_array($node->id, $listFoldersLimitedKeys)) { |
| 293 | 291 | $restricted = '1'; |
| 294 | 292 | $text .= |
| 295 | 293 | $session_user_read_only === true ? |
| 296 | - "<i class='far fa-eye fa-xs mr-1'></i>" : |
|
| 297 | - '' |
|
| 298 | - .'<span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_' . $node->id . '\'>' . count($session_list_folders_limited[$node->id]) . '</span>'; |
|
| 294 | + "<i class='far fa-eye fa-xs mr-1'></i>" : '' |
|
| 295 | + .'<span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_'.$node->id.'\'>'.count($session_list_folders_limited[$node->id]).'</span>'; |
|
| 299 | 296 | } elseif (in_array($node->id, $listRestrictedFoldersForItemsKeys)) { |
| 300 | 297 | $restricted = '1'; |
| 301 | 298 | if ($session_user_read_only === true) { |
| 302 | - $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text; |
|
| 299 | + $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text; |
|
| 303 | 300 | } |
| 304 | 301 | $text .= $session_user_read_only === true ? |
| 305 | - "<i class='far fa-eye fa-xs mr-1'></i>" : |
|
| 306 | - '' |
|
| 307 | - . '<span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_' . $node->id . '\'>' . count($session_list_restricted_folders_for_items[$node->id]) . '</span>'; |
|
| 302 | + "<i class='far fa-eye fa-xs mr-1'></i>" : '' |
|
| 303 | + . '<span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_'.$node->id.'\'>'.count($session_list_restricted_folders_for_items[$node->id]).'</span>'; |
|
| 308 | 304 | } else { |
| 309 | 305 | $restricted = '1'; |
| 310 | 306 | $folderClass = 'folder_not_droppable'; |
@@ -330,18 +326,18 @@ discard block |
||
| 330 | 326 | array_push( |
| 331 | 327 | $ret_json, |
| 332 | 328 | array( |
| 333 | - 'id' => 'li_' . $node->id, |
|
| 329 | + 'id' => 'li_'.$node->id, |
|
| 334 | 330 | 'parent' => $parent, |
| 335 | 331 | 'text' => $text, |
| 336 | 332 | 'children' => $childrenNb == 0 ? false : true, |
| 337 | 333 | 'li_attr' => array( |
| 338 | 334 | 'class' => 'jstreeopen', |
| 339 | - 'title' => 'ID [' . $node->id . '] ' . $title, |
|
| 335 | + 'title' => 'ID ['.$node->id.'] '.$title, |
|
| 340 | 336 | ), |
| 341 | 337 | 'a_attr' => array( |
| 342 | - 'id' => 'fld_' . $node->id, |
|
| 338 | + 'id' => 'fld_'.$node->id, |
|
| 343 | 339 | 'class' => $folderClass, |
| 344 | - 'onclick' => 'ListerItems(' . $node->id . ', ' . $restricted . ', 0, 1)', |
|
| 340 | + 'onclick' => 'ListerItems('.$node->id.', '.$restricted.', 0, 1)', |
|
| 345 | 341 | 'data-title' => $node->title, |
| 346 | 342 | ), |
| 347 | 343 | ) |
@@ -350,13 +346,13 @@ discard block |
||
| 350 | 346 | array_push( |
| 351 | 347 | $ret_json, |
| 352 | 348 | array( |
| 353 | - 'id' => 'li_' . $node->id, |
|
| 349 | + 'id' => 'li_'.$node->id, |
|
| 354 | 350 | 'parent' => $parent, |
| 355 | 351 | 'children' => $childrenNb == 0 ? false : true, |
| 356 | - 'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>' . $text, |
|
| 352 | + 'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>'.$text, |
|
| 357 | 353 | 'li_attr' => array( |
| 358 | 354 | 'class' => '', |
| 359 | - 'title' => 'ID [' . $node->id . '] ' . langHdl('no_access'), |
|
| 355 | + 'title' => 'ID ['.$node->id.'] '.langHdl('no_access'), |
|
| 360 | 356 | ), |
| 361 | 357 | ) |
| 362 | 358 | ); |
@@ -408,7 +404,7 @@ discard block |
||
| 408 | 404 | } |
| 409 | 405 | |
| 410 | 406 | // Load library |
| 411 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 407 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 412 | 408 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 413 | 409 | |
| 414 | 410 | // Prepare superGlobal variables |
@@ -445,7 +441,7 @@ discard block |
||
| 445 | 441 | ) === true |
| 446 | 442 | ) { |
| 447 | 443 | DB::query( |
| 448 | - 'SELECT * FROM ' . prefixTable('items') . ' |
|
| 444 | + 'SELECT * FROM '.prefixTable('items').' |
|
| 449 | 445 | WHERE inactif=%i AND id_tree = %i', |
| 450 | 446 | 0, |
| 451 | 447 | $node |
@@ -475,7 +471,7 @@ discard block |
||
| 475 | 471 | if ($displayThisNode === true) { |
| 476 | 472 | // get info about current folder |
| 477 | 473 | DB::query( |
| 478 | - 'SELECT * FROM ' . prefixTable('items') . ' |
|
| 474 | + 'SELECT * FROM '.prefixTable('items').' |
|
| 479 | 475 | WHERE inactif=%i AND id_tree = %i', |
| 480 | 476 | 0, |
| 481 | 477 | $completTree[$nodeId]->id |
@@ -503,7 +499,7 @@ discard block |
||
| 503 | 499 | |
| 504 | 500 | if (in_array($completTree[$nodeId]->id, $session_groupes_visibles) === true) { |
| 505 | 501 | if (in_array($completTree[$nodeId]->id, $session_read_only_folders) === true) { |
| 506 | - $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text; |
|
| 502 | + $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text; |
|
| 507 | 503 | $title = langHdl('read_only_account'); |
| 508 | 504 | $restricted = 1; |
| 509 | 505 | $folderClass = 'folder_not_droppable'; |
@@ -511,27 +507,26 @@ discard block |
||
| 511 | 507 | $session_user_read_only === true |
| 512 | 508 | && in_array($completTree[$nodeId]->id, $session_personal_visible_groups) === false |
| 513 | 509 | ) { |
| 514 | - $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text; |
|
| 510 | + $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text; |
|
| 515 | 511 | } |
| 516 | 512 | $text .= |
| 517 | - '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_' . $completTree[$nodeId]->id . '\'>' . $itemsNb . |
|
| 513 | + '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_'.$completTree[$nodeId]->id.'\'>'.$itemsNb. |
|
| 518 | 514 | ((isset($SETTINGS['tree_counters']) === true && (int) $SETTINGS['tree_counters'] === 1) ? |
| 519 | - '/'.$nbChildrenItems . |
|
| 520 | - '/'.(count($nodeDescendants) - 1) : |
|
| 521 | - '') |
|
| 515 | + '/'.$nbChildrenItems. |
|
| 516 | + '/'.(count($nodeDescendants) - 1) : '') |
|
| 522 | 517 | . '</span>'; |
| 523 | 518 | } elseif (in_array($completTree[$nodeId]->id, $listFoldersLimitedKeys) === true) { |
| 524 | 519 | $restricted = '1'; |
| 525 | 520 | if ($session_user_read_only === true) { |
| 526 | - $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text; |
|
| 521 | + $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text; |
|
| 527 | 522 | } |
| 528 | - $text .= '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_' . $completTree[$nodeId]->id . '\'>' . count($session_list_folders_limited[$completTree[$nodeId]->id]); |
|
| 523 | + $text .= '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_'.$completTree[$nodeId]->id.'\'>'.count($session_list_folders_limited[$completTree[$nodeId]->id]); |
|
| 529 | 524 | } elseif (in_array($completTree[$nodeId]->id, $listRestrictedFoldersForItemsKeys) === true) { |
| 530 | 525 | $restricted = '1'; |
| 531 | 526 | if ($session_user_read_only === true) { |
| 532 | - $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text; |
|
| 527 | + $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text; |
|
| 533 | 528 | } |
| 534 | - $text .= '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_' . $completTree[$nodeId]->id . '\'>' . count($session_list_restricted_folders_for_items[$completTree[$nodeId]->id]) . '</span>'; |
|
| 529 | + $text .= '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_'.$completTree[$nodeId]->id.'\'>'.count($session_list_restricted_folders_for_items[$completTree[$nodeId]->id]).'</span>'; |
|
| 535 | 530 | } else { |
| 536 | 531 | $restricted = '1'; |
| 537 | 532 | $folderClass = 'folder_not_droppable'; |
@@ -568,7 +563,7 @@ discard block |
||
| 568 | 563 | } |
| 569 | 564 | |
| 570 | 565 | // prepare json return for current node |
| 571 | - $parent = ($completTree[$nodeId]->parent_id === '0') ? '#' : 'li_' . $completTree[$nodeId]->parent_id; |
|
| 566 | + $parent = ($completTree[$nodeId]->parent_id === '0') ? '#' : 'li_'.$completTree[$nodeId]->parent_id; |
|
| 572 | 567 | |
| 573 | 568 | // handle displaying |
| 574 | 569 | if ( |
@@ -588,17 +583,17 @@ discard block |
||
| 588 | 583 | array_push( |
| 589 | 584 | $ret_json, |
| 590 | 585 | array( |
| 591 | - 'id' => 'li_' . $completTree[$nodeId]->id, |
|
| 586 | + 'id' => 'li_'.$completTree[$nodeId]->id, |
|
| 592 | 587 | 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent, |
| 593 | 588 | 'text' => $text, |
| 594 | 589 | 'li_attr' => array( |
| 595 | 590 | 'class' => 'jstreeopen', |
| 596 | - 'title' => 'ID [' . $completTree[$nodeId]->id . '] ' . $title, |
|
| 591 | + 'title' => 'ID ['.$completTree[$nodeId]->id.'] '.$title, |
|
| 597 | 592 | ), |
| 598 | 593 | 'a_attr' => array( |
| 599 | - 'id' => 'fld_' . $completTree[$nodeId]->id, |
|
| 594 | + 'id' => 'fld_'.$completTree[$nodeId]->id, |
|
| 600 | 595 | 'class' => $folderClass, |
| 601 | - 'onclick' => 'ListerItems(' . $completTree[$nodeId]->id . ', ' . $restricted . ', 0, 1)', |
|
| 596 | + 'onclick' => 'ListerItems('.$completTree[$nodeId]->id.', '.$restricted.', 0, 1)', |
|
| 602 | 597 | 'data-title' => $completTree[$nodeId]->title, |
| 603 | 598 | ), |
| 604 | 599 | ) |
@@ -607,12 +602,12 @@ discard block |
||
| 607 | 602 | array_push( |
| 608 | 603 | $ret_json, |
| 609 | 604 | array( |
| 610 | - 'id' => 'li_' . $completTree[$nodeId]->id, |
|
| 605 | + 'id' => 'li_'.$completTree[$nodeId]->id, |
|
| 611 | 606 | 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent, |
| 612 | - 'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>' . $text, |
|
| 607 | + 'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>'.$text, |
|
| 613 | 608 | 'li_attr' => array( |
| 614 | 609 | 'class' => '', |
| 615 | - 'title' => 'ID [' . $completTree[$nodeId]->id . '] ' . langHdl('no_access'), |
|
| 610 | + 'title' => 'ID ['.$completTree[$nodeId]->id.'] '.langHdl('no_access'), |
|
| 616 | 611 | ), |
| 617 | 612 | ) |
| 618 | 613 | ); |
@@ -47,26 +47,26 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | // Do checks |
| 50 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 51 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 50 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 51 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 52 | 52 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) { |
| 53 | 53 | // Not allowed page |
| 54 | 54 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 55 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 55 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 56 | 56 | exit(); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // No time limit |
| 60 | 60 | set_time_limit(0); |
| 61 | 61 | |
| 62 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 62 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 63 | 63 | header('Content-type: text/html; charset=utf-8'); |
| 64 | 64 | error_reporting(E_ERROR); |
| 65 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 66 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 65 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 66 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 67 | 67 | |
| 68 | 68 | // Connect to mysql server |
| 69 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 69 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 70 | 70 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 71 | 71 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 72 | 72 | } |
@@ -78,12 +78,12 @@ discard block |
||
| 78 | 78 | DB::$encoding = DB_ENCODING; |
| 79 | 79 | |
| 80 | 80 | // Build tree |
| 81 | -$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 81 | +$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 82 | 82 | $tree->register(); |
| 83 | -$tree = new Tree\NestedTree\NestedTree($pre . 'nested_tree', 'id', 'parent_id', 'title'); |
|
| 83 | +$tree = new Tree\NestedTree\NestedTree($pre.'nested_tree', 'id', 'parent_id', 'title'); |
|
| 84 | 84 | |
| 85 | 85 | // User's language loading |
| 86 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 86 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 87 | 87 | |
| 88 | 88 | // Prepare POST variables |
| 89 | 89 | $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT); |
@@ -134,9 +134,9 @@ discard block |
||
| 134 | 134 | 'SELECT i.id as id, i.id_tree as id_tree, i.restricted_to as restricted_to, i.perso as perso, |
| 135 | 135 | i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url, |
| 136 | 136 | i.email as email,l.date as date, i.pw_iv as pw_iv,n.renewal_period as renewal_period |
| 137 | - FROM ' . prefixTable('items') . ' as i |
|
| 138 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 139 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 137 | + FROM ' . prefixTable('items').' as i |
|
| 138 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 139 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 140 | 140 | WHERE i.inactif = %i |
| 141 | 141 | AND i.id_tree= %i |
| 142 | 142 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | // Run query |
| 160 | 160 | $dataItem = DB::queryfirstrow( |
| 161 | 161 | 'SELECT i.pw AS pw, s.share_key AS share_key |
| 162 | - FROM ' . prefixTable('items') . ' AS i |
|
| 163 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id) |
|
| 162 | + FROM ' . prefixTable('items').' AS i |
|
| 163 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id) |
|
| 164 | 164 | WHERE user_id = %i AND i.id = %i', |
| 165 | 165 | $_SESSION['user_id'], |
| 166 | 166 | $record['id'] |
@@ -184,8 +184,8 @@ discard block |
||
| 184 | 184 | $arr_kbs = []; |
| 185 | 185 | $rows_kb = DB::query( |
| 186 | 186 | 'SELECT b.label, b.id |
| 187 | - FROM ' . prefixTable('kb_items') . ' AS a |
|
| 188 | - INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id) |
|
| 187 | + FROM ' . prefixTable('kb_items').' AS a |
|
| 188 | + INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id) |
|
| 189 | 189 | WHERE a.item_id = %i', |
| 190 | 190 | $record['id'] |
| 191 | 191 | ); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | $arr_tags = []; |
| 198 | 198 | $rows_tag = DB::query( |
| 199 | 199 | 'SELECT tag |
| 200 | - FROM ' . prefixTable('tags') . ' |
|
| 200 | + FROM ' . prefixTable('tags').' |
|
| 201 | 201 | WHERE item_id = %i', |
| 202 | 202 | $record['id'] |
| 203 | 203 | ); |
@@ -244,14 +244,14 @@ discard block |
||
| 244 | 244 | $tmp .= array2csv($value); |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - echo '[{"content":"' . base64_encode($tmp) . '"}]'; |
|
| 247 | + echo '[{"content":"'.base64_encode($tmp).'"}]'; |
|
| 248 | 248 | break; |
| 249 | 249 | |
| 250 | 250 | /* |
| 251 | 251 | * PDF - step 1 - Prepare database |
| 252 | 252 | */ |
| 253 | 253 | case 'initialize_export_table': |
| 254 | - DB::query('TRUNCATE TABLE ' . prefixTable('export')); |
|
| 254 | + DB::query('TRUNCATE TABLE '.prefixTable('export')); |
|
| 255 | 255 | break; |
| 256 | 256 | |
| 257 | 257 | /* |
@@ -295,9 +295,9 @@ discard block |
||
| 295 | 295 | 'SELECT i.id as id, i.restricted_to as restricted_to, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url, i.email as email, |
| 296 | 296 | l.date as date, i.pw_iv as pw_iv, |
| 297 | 297 | n.renewal_period as renewal_period |
| 298 | - FROM ' . prefixTable('items') . ' as i |
|
| 299 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 300 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 298 | + FROM ' . prefixTable('items').' as i |
|
| 299 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 300 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 301 | 301 | WHERE i.inactif = %i |
| 302 | 302 | AND i.id_tree= %i |
| 303 | 303 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -324,8 +324,8 @@ discard block |
||
| 324 | 324 | // Run query |
| 325 | 325 | $dataItem = DB::queryfirstrow( |
| 326 | 326 | 'SELECT i.pw AS pw, s.share_key AS share_key |
| 327 | - FROM ' . prefixTable('items') . ' AS i |
|
| 328 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id) |
|
| 327 | + FROM ' . prefixTable('items').' AS i |
|
| 328 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id) |
|
| 329 | 329 | WHERE user_id = %i AND i.id = %i', |
| 330 | 330 | $_SESSION['user_id'], |
| 331 | 331 | $record['id'] |
@@ -349,8 +349,8 @@ discard block |
||
| 349 | 349 | $arr_kbs = ''; |
| 350 | 350 | $rows_kb = DB::query( |
| 351 | 351 | 'SELECT b.label, b.id |
| 352 | - FROM ' . prefixTable('kb_items') . ' AS a |
|
| 353 | - INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id) |
|
| 352 | + FROM ' . prefixTable('kb_items').' AS a |
|
| 353 | + INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id) |
|
| 354 | 354 | WHERE a.item_id = %i', |
| 355 | 355 | $record['id'] |
| 356 | 356 | ); |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | if (empty($arr_kbs)) { |
| 359 | 359 | $arr_kbs = $rec_kb['label']; |
| 360 | 360 | } else { |
| 361 | - $arr_kbs .= ' | ' . $rec_kb['label']; |
|
| 361 | + $arr_kbs .= ' | '.$rec_kb['label']; |
|
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | 364 | |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | $arr_tags = ''; |
| 367 | 367 | $rows_tag = DB::query( |
| 368 | 368 | 'SELECT tag |
| 369 | - FROM ' . prefixTable('tags') . ' |
|
| 369 | + FROM ' . prefixTable('tags').' |
|
| 370 | 370 | WHERE item_id = %i', |
| 371 | 371 | $record['id'] |
| 372 | 372 | ); |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | if (empty($arr_tags)) { |
| 375 | 375 | $arr_tags = $rec_tag['tag']; |
| 376 | 376 | } else { |
| 377 | - $arr_tags .= ' ' . $rec_tag['tag']; |
|
| 377 | + $arr_tags .= ' '.$rec_tag['tag']; |
|
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | 380 | |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | header('Content-type: application/pdf'); |
| 444 | 444 | |
| 445 | 445 | // query |
| 446 | - $rows = DB::query('SELECT * FROM ' . prefixTable('export')); |
|
| 446 | + $rows = DB::query('SELECT * FROM '.prefixTable('export')); |
|
| 447 | 447 | $counter = DB::count(); |
| 448 | 448 | if ($counter > 0) { |
| 449 | 449 | |
@@ -453,8 +453,8 @@ discard block |
||
| 453 | 453 | $prev_path = ''; |
| 454 | 454 | |
| 455 | 455 | //Prepare the PDF file |
| 456 | - require_once($SETTINGS['cpassman_dir'] . '/includes/libraries/Pdf/tcpdf/config/tcpdf_config.php'); |
|
| 457 | - include $SETTINGS['cpassman_dir'] . '/includes/libraries/Pdf/tcpdf/tcpdf.php'; |
|
| 456 | + require_once($SETTINGS['cpassman_dir'].'/includes/libraries/Pdf/tcpdf/config/tcpdf_config.php'); |
|
| 457 | + include $SETTINGS['cpassman_dir'].'/includes/libraries/Pdf/tcpdf/tcpdf.php'; |
|
| 458 | 458 | |
| 459 | 459 | $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); |
| 460 | 460 | $pdf->SetProtection(array('print'), $dataReceived['pdf_password'], null); |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | |
| 467 | 467 | // set default header data |
| 468 | 468 | $pdf->SetHeaderData( |
| 469 | - $SETTINGS['cpassman_dir'] . '/includes/images/teampass-logo2-home.png', |
|
| 469 | + $SETTINGS['cpassman_dir'].'/includes/images/teampass-logo2-home.png', |
|
| 470 | 470 | PDF_HEADER_LOGO_WIDTH, |
| 471 | 471 | 'Teampass export', |
| 472 | 472 | $_SESSION['lastname']." ".$_SESSION['name'].' @ '.date($SETTINGS['date_format']." ".$SETTINGS['time_format'], time()) |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | logEvents($SETTINGS, 'pdf_export', '', $_SESSION['user_id'], $_SESSION['login']); |
| 571 | 571 | |
| 572 | 572 | //clean table |
| 573 | - DB::query('TRUNCATE TABLE ' . prefixTable('export')); |
|
| 573 | + DB::query('TRUNCATE TABLE '.prefixTable('export')); |
|
| 574 | 574 | |
| 575 | 575 | // Send back the file in Blob |
| 576 | 576 | echo $pdf->Output(null, 'I'); |
@@ -582,8 +582,8 @@ discard block |
||
| 582 | 582 | // step 1: |
| 583 | 583 | // - prepare export file |
| 584 | 584 | // - get full list of objects id to export |
| 585 | - include $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 586 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 585 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 586 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 587 | 587 | $idsList = array(); |
| 588 | 588 | $objNumber = 0; |
| 589 | 589 | |
@@ -596,9 +596,9 @@ discard block |
||
| 596 | 596 | // count elements to display |
| 597 | 597 | $result = DB::query( |
| 598 | 598 | 'SELECT i.id AS id, i.label AS label, i.restricted_to AS restricted_to, i.perso AS perso |
| 599 | - FROM ' . prefixTable('items') . ' as i |
|
| 600 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 601 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 599 | + FROM ' . prefixTable('items').' as i |
|
| 600 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 601 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 602 | 602 | WHERE i.inactif = %i |
| 603 | 603 | AND i.id_tree= %i |
| 604 | 604 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -627,9 +627,9 @@ discard block |
||
| 627 | 627 | |
| 628 | 628 | // prepare export file |
| 629 | 629 | //save the file |
| 630 | - $html_file = '/teampass_export_' . time() . '_' . generateKey() . '.html'; |
|
| 630 | + $html_file = '/teampass_export_'.time().'_'.generateKey().'.html'; |
|
| 631 | 631 | //print_r($full_listing); |
| 632 | - $outstream = fopen($SETTINGS['path_to_files_folder'] . $html_file, 'w'); |
|
| 632 | + $outstream = fopen($SETTINGS['path_to_files_folder'].$html_file, 'w'); |
|
| 633 | 633 | if ($outstream === false) { |
| 634 | 634 | echo '[{"error":"true"}]'; |
| 635 | 635 | break; |
@@ -653,12 +653,12 @@ discard block |
||
| 653 | 653 | </style> |
| 654 | 654 | </head> |
| 655 | 655 | <body> |
| 656 | - <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $post_pdf_password) . '" /> |
|
| 656 | + <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $post_pdf_password).'" /> |
|
| 657 | 657 | <div id="header"> |
| 658 | - ' . TP_TOOL_NAME . ' - Off Line mode |
|
| 658 | + ' . TP_TOOL_NAME.' - Off Line mode |
|
| 659 | 659 | </div> |
| 660 | 660 | <div style="margin:10px; font-size:9px;"> |
| 661 | - <i>This page was generated by <b>' . $_SESSION['name'] . ' ' . $_SESSION['lastname'] . '</b>, the ' . date('Y/m/d H:i:s') . '.</i> |
|
| 661 | + <i>This page was generated by <b>' . $_SESSION['name'].' '.$_SESSION['lastname'].'</b>, the '.date('Y/m/d H:i:s').'.</i> |
|
| 662 | 662 | <span id="info_page" style="margin-left:20px; font-weight:bold; font-size: 14px; color:red;"></span> |
| 663 | 663 | </div> |
| 664 | 664 | <div id="information"></div> |
@@ -669,11 +669,11 @@ discard block |
||
| 669 | 669 | <div> |
| 670 | 670 | <table id="itemsTable"> |
| 671 | 671 | <thead><tr> |
| 672 | - <th style="width:15%;">' . $LANG['label'] . '</th> |
|
| 673 | - <th style="width:10%;">' . $LANG['pw'] . '</th> |
|
| 674 | - <th style="width:30%;">' . $LANG['description'] . '</th> |
|
| 675 | - <th style="width:5%;">' . $LANG['user_login'] . '</th> |
|
| 676 | - <th style="width:20%;">' . $LANG['url'] . '</th> |
|
| 672 | + <th style="width:15%;">' . $LANG['label'].'</th> |
|
| 673 | + <th style="width:10%;">' . $LANG['pw'].'</th> |
|
| 674 | + <th style="width:30%;">' . $LANG['description'].'</th> |
|
| 675 | + <th style="width:5%;">' . $LANG['user_login'].'</th> |
|
| 676 | + <th style="width:20%;">' . $LANG['url'].'</th> |
|
| 677 | 677 | </tr></thead> |
| 678 | 678 | <tbody id="itemsTable_tbody">' |
| 679 | 679 | ); |
@@ -698,22 +698,22 @@ discard block |
||
| 698 | 698 | || in_array($post_idTree, $_SESSION['groupes_visibles']) === false |
| 699 | 699 | || (in_array($post_idTree, $_SESSION['no_access_folders']) === true) |
| 700 | 700 | ) { |
| 701 | - echo '[{"loop":"true", "number":"' . $post_number . '", "cpt":"' . $post_cpt . '", "file":"' . $post_file . '", "idsList":"' . $post_idsList . '" , "file_link":"' . $post_file_link . '"}]'; |
|
| 701 | + echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]'; |
|
| 702 | 702 | break; |
| 703 | 703 | } |
| 704 | 704 | |
| 705 | 705 | $full_listing = array(); |
| 706 | 706 | $items_id_list = array(); |
| 707 | - include $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 708 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 707 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 708 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 709 | 709 | |
| 710 | 710 | $rows = DB::query( |
| 711 | 711 | 'SELECT i.id as id, i.url as url, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.id_tree as id_tree, |
| 712 | 712 | l.date as date, i.pw_iv as pw_iv, |
| 713 | 713 | n.renewal_period as renewal_period |
| 714 | - FROM ' . prefixTable('items') . ' as i |
|
| 715 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 716 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 714 | + FROM ' . prefixTable('items').' as i |
|
| 715 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 716 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 717 | 717 | WHERE i.inactif = %i |
| 718 | 718 | AND i.id_tree= %i |
| 719 | 719 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -774,7 +774,7 @@ discard block |
||
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | //save in export file |
| 777 | - $outstream = fopen($post_file . '.txt', 'a'); |
|
| 777 | + $outstream = fopen($post_file.'.txt', 'a'); |
|
| 778 | 778 | if ($outstream === false) { |
| 779 | 779 | echo '[{"error":"true"}]'; |
| 780 | 780 | break; |
@@ -812,13 +812,13 @@ discard block |
||
| 812 | 812 | if (empty($arboHtml)) { |
| 813 | 813 | $arboHtml = $arboHtml_tmp; |
| 814 | 814 | } else { |
| 815 | - $arboHtml .= ' » ' . $arboHtml_tmp; |
|
| 815 | + $arboHtml .= ' » '.$arboHtml_tmp; |
|
| 816 | 816 | } |
| 817 | 817 | } |
| 818 | 818 | fputs( |
| 819 | 819 | $outstream, |
| 820 | 820 | ' |
| 821 | - <tr class="path"><td colspan="5">' . $arboHtml . '</td></tr>' |
|
| 821 | + <tr class="path"><td colspan="5">' . $arboHtml.'</td></tr>' |
|
| 822 | 822 | ); |
| 823 | 823 | $idTree = $elem['id_tree']; |
| 824 | 824 | } |
@@ -827,12 +827,12 @@ discard block |
||
| 827 | 827 | fputs( |
| 828 | 828 | $outstream, |
| 829 | 829 | ' |
| 830 | - <tr class="' . $lineType . '"> |
|
| 831 | - <td>' . addslashes($elem['label']) . '</td> |
|
| 832 | - <td align="center"><span class="span_pw" id="span_' . $elem['id'] . '"><a href="#" onclick="decryptme(' . $elem['id'] . ', \'' . $encPw . '\');return false;">Decrypt </a></span><input type="hidden" id="hide_' . $elem['id'] . '" value="' . $encPw . '" /></td> |
|
| 833 | - <td>' . $desc . '</td> |
|
| 834 | - <td align="center">' . $login . '</td> |
|
| 835 | - <td align="center">' . $url . '</td> |
|
| 830 | + <tr class="' . $lineType.'"> |
|
| 831 | + <td>' . addslashes($elem['label']).'</td> |
|
| 832 | + <td align="center"><span class="span_pw" id="span_' . $elem['id'].'"><a href="#" onclick="decryptme('.$elem['id'].', \''.$encPw.'\');return false;">Decrypt </a></span><input type="hidden" id="hide_'.$elem['id'].'" value="'.$encPw.'" /></td> |
|
| 833 | + <td>' . $desc.'</td> |
|
| 834 | + <td align="center">' . $login.'</td> |
|
| 835 | + <td align="center">' . $url.'</td> |
|
| 836 | 836 | </tr>' |
| 837 | 837 | ); |
| 838 | 838 | } |
@@ -840,29 +840,29 @@ discard block |
||
| 840 | 840 | fclose($outstream); |
| 841 | 841 | |
| 842 | 842 | // send back and continue |
| 843 | - echo '[{"loop":"true", "number":"' . $post_number . '", "cpt":"' . $post_cpt . '", "file":"' . $post_file . '", "idsList":"' . $post_idsList . '" , "file_link":"' . $post_file_link . '"}]'; |
|
| 843 | + echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]'; |
|
| 844 | 844 | break; |
| 845 | 845 | |
| 846 | 846 | //CASE export in HTML format - Iteration loop |
| 847 | 847 | case 'export_to_html_format_finalize': |
| 848 | 848 | // Load includes |
| 849 | - include $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 850 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 849 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 850 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 851 | 851 | |
| 852 | 852 | // read the content of the temporary file |
| 853 | - $handle = fopen($post_file . '.txt', 'r'); |
|
| 853 | + $handle = fopen($post_file.'.txt', 'r'); |
|
| 854 | 854 | if ($handle === false) { |
| 855 | 855 | echo '[{"error":"true"}]'; |
| 856 | 856 | break; |
| 857 | 857 | } |
| 858 | - $contents = fread($handle, filesize($post_file . '.txt')); |
|
| 858 | + $contents = fread($handle, filesize($post_file.'.txt')); |
|
| 859 | 859 | if ($contents === false) { |
| 860 | 860 | echo '[{"error":"true"}]'; |
| 861 | 861 | break; |
| 862 | 862 | } |
| 863 | 863 | fclose($handle); |
| 864 | - if (is_file($post_file . '.txt')) { |
|
| 865 | - unlink($post_file . '.txt'); |
|
| 864 | + if (is_file($post_file.'.txt')) { |
|
| 865 | + unlink($post_file.'.txt'); |
|
| 866 | 866 | } |
| 867 | 867 | |
| 868 | 868 | // Encrypt its content |
@@ -873,7 +873,7 @@ discard block |
||
| 873 | 873 | if (empty($encrypted_text) === true) { |
| 874 | 874 | $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password); |
| 875 | 875 | } else { |
| 876 | - $encrypted_text .= '|#|#|' . GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password); |
|
| 876 | + $encrypted_text .= '|#|#|'.GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password); |
|
| 877 | 877 | } |
| 878 | 878 | } |
| 879 | 879 | |
@@ -890,9 +890,9 @@ discard block |
||
| 890 | 890 | </table></div> |
| 891 | 891 | <input type="button" value="Hide all" onclick="hideAll()" /> |
| 892 | 892 | <div id="footer" style="text-align:center;"> |
| 893 | - <a href="https://teampass.net/about/" target="_blank" style="">' . TP_TOOL_NAME . ' ' . TP_VERSION_FULL . ' ' . TP_COPYRIGHT . '</a> |
|
| 893 | + <a href="https://teampass.net/about/" target="_blank" style="">' . TP_TOOL_NAME.' '.TP_VERSION_FULL.' '.TP_COPYRIGHT.'</a> |
|
| 894 | 894 | </div> |
| 895 | - <div id="enc_html" style="display:none;">' . $encrypted_text . '</div> |
|
| 895 | + <div id="enc_html" style="display:none;">' . $encrypted_text.'</div> |
|
| 896 | 896 | </body> |
| 897 | 897 | </html> |
| 898 | 898 | <script type="text/javascript"> |
@@ -998,9 +998,9 @@ discard block |
||
| 998 | 998 | |
| 999 | 999 | fclose($outstream); |
| 1000 | 1000 | |
| 1001 | - echo '[{"text":"<a href=\'' . |
|
| 1002 | - $post_file_link . |
|
| 1003 | - '\' target=\'_blank\'>' . $LANG['pdf_download'] . '</a>"}]'; |
|
| 1001 | + echo '[{"text":"<a href=\''. |
|
| 1002 | + $post_file_link. |
|
| 1003 | + '\' target=\'_blank\'>'.$LANG['pdf_download'].'</a>"}]'; |
|
| 1004 | 1004 | break; |
| 1005 | 1005 | } |
| 1006 | 1006 | } |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // DO CHECKS |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 47 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 47 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 48 | 48 | $post_type = filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING); |
| 49 | 49 | if ( |
| 50 | 50 | isset($post_type) === true |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | && checkUser($_SESSION['user_id'], $_SESSION['key'], 'home', $SETTINGS) === false |
| 61 | 61 | ) { |
| 62 | 62 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page |
| 63 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 63 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 64 | 64 | exit(); |
| 65 | 65 | } elseif ((isset($_SESSION['user_id']) === true |
| 66 | 66 | && isset($_SESSION['key'])) === true |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | mainQuery($SETTINGS); |
| 72 | 72 | } else { |
| 73 | 73 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page |
| 74 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 74 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 75 | 75 | exit(); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -102,15 +102,15 @@ discard block |
||
| 102 | 102 | date_default_timezone_set('UTC'); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 106 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 105 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 106 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 107 | 107 | |
| 108 | 108 | // Includes |
| 109 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 110 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 109 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 110 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 111 | 111 | |
| 112 | 112 | // Connect to mysql server |
| 113 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 113 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 114 | 114 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 115 | 115 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 116 | 116 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | DB::$encoding = DB_ENCODING; |
| 123 | 123 | |
| 124 | 124 | // User's language loading |
| 125 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 125 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 126 | 126 | |
| 127 | 127 | // Prepare post variables |
| 128 | 128 | $post_key = filter_input(INPUT_POST, 'key', FILTER_SANITIZE_STRING); |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | echo prepareExchangedData( |
| 192 | 192 | array( |
| 193 | 193 | 'error' => true, |
| 194 | - 'message' => '<div style="margin:10px 0 10px 15px;">' . langHdl('error_not_allowed_to') . '</div>', |
|
| 194 | + 'message' => '<div style="margin:10px 0 10px 15px;">'.langHdl('error_not_allowed_to').'</div>', |
|
| 195 | 195 | ), |
| 196 | 196 | 'encode' |
| 197 | 197 | ); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | // check if expected security level is reached |
| 202 | 202 | $dataUser = DB::queryfirstrow( |
| 203 | 203 | 'SELECT * |
| 204 | - FROM ' . prefixTable('users') . ' |
|
| 204 | + FROM ' . prefixTable('users').' |
|
| 205 | 205 | WHERE id = %i', |
| 206 | 206 | $post_user_id |
| 207 | 207 | ); |
@@ -223,8 +223,8 @@ discard block |
||
| 223 | 223 | if (empty($dataUser['fonction_id']) === false) { |
| 224 | 224 | $data = DB::queryFirstRow( |
| 225 | 225 | 'SELECT complexity |
| 226 | - FROM ' . prefixTable('roles_title') . ' |
|
| 227 | - WHERE id IN (' . $dataUser['fonction_id'] . ') |
|
| 226 | + FROM ' . prefixTable('roles_title').' |
|
| 227 | + WHERE id IN (' . $dataUser['fonction_id'].') |
|
| 228 | 228 | ORDER BY complexity DESC' |
| 229 | 229 | ); |
| 230 | 230 | } else { |
@@ -237,8 +237,8 @@ discard block |
||
| 237 | 237 | echo prepareExchangedData( |
| 238 | 238 | array( |
| 239 | 239 | 'error' => true, |
| 240 | - 'message' => '<div style="margin:10px 0 10px 15px;">' . langHdl('complexity_level_not_reached') . '.<br>' . |
|
| 241 | - langHdl('expected_complexity_level') . ': <b>' . TP_PW_COMPLEXITY[$data['complexity']][1] . '</b></div>', |
|
| 240 | + 'message' => '<div style="margin:10px 0 10px 15px;">'.langHdl('complexity_level_not_reached').'.<br>'. |
|
| 241 | + langHdl('expected_complexity_level').': <b>'.TP_PW_COMPLEXITY[$data['complexity']][1].'</b></div>', |
|
| 242 | 242 | ), |
| 243 | 243 | 'encode' |
| 244 | 244 | ); |
@@ -439,14 +439,14 @@ discard block |
||
| 439 | 439 | // Get data about user |
| 440 | 440 | $data = DB::queryfirstrow( |
| 441 | 441 | 'SELECT id, email, pw |
| 442 | - FROM ' . prefixTable('users') . ' |
|
| 442 | + FROM ' . prefixTable('users').' |
|
| 443 | 443 | WHERE login = %s', |
| 444 | 444 | $post_login |
| 445 | 445 | ); |
| 446 | 446 | } else { |
| 447 | 447 | $data = DB::queryfirstrow( |
| 448 | 448 | 'SELECT id, login, email, pw |
| 449 | - FROM ' . prefixTable('users') . ' |
|
| 449 | + FROM ' . prefixTable('users').' |
|
| 450 | 450 | WHERE id = %i', |
| 451 | 451 | $post_id |
| 452 | 452 | ); |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | $counter = DB::count(); |
| 458 | 458 | |
| 459 | 459 | // load passwordLib library |
| 460 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 460 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 461 | 461 | $pwdlib->register(); |
| 462 | 462 | $pwdlib = new PasswordLib\PasswordLib(); |
| 463 | 463 | |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | ); |
| 504 | 504 | } else { |
| 505 | 505 | // generate new GA user code |
| 506 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 506 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 507 | 507 | $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']); |
| 508 | 508 | $gaSecretKey = $tfa->createSecret(); |
| 509 | 509 | $gaTemporaryCode = GenerateCryptKey(12, false, true, true, false, true, $SETTINGS); |
@@ -598,7 +598,7 @@ discard block |
||
| 598 | 598 | 'email' => $data['email'], |
| 599 | 599 | 'email_result' => str_replace( |
| 600 | 600 | '#email#', |
| 601 | - '<b>' . obfuscateEmail($data['email']) . '</b>', |
|
| 601 | + '<b>'.obfuscateEmail($data['email']).'</b>', |
|
| 602 | 602 | addslashes(langHdl('admin_email_result_ok')) |
| 603 | 603 | ), |
| 604 | 604 | ), |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | 'email' => $data['email'], |
| 614 | 614 | 'email_result' => str_replace( |
| 615 | 615 | '#email#', |
| 616 | - '<b>' . obfuscateEmail($data['email']) . '</b>', |
|
| 616 | + '<b>'.obfuscateEmail($data['email']).'</b>', |
|
| 617 | 617 | addslashes(langHdl('admin_email_result_ok')) |
| 618 | 618 | ), |
| 619 | 619 | ), |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | $_SESSION['user_id'] |
| 642 | 642 | ); |
| 643 | 643 | // Return data |
| 644 | - echo '[{"new_value":"' . $_SESSION['sessionDuration'] . '"}]'; |
|
| 644 | + echo '[{"new_value":"'.$_SESSION['sessionDuration'].'"}]'; |
|
| 645 | 645 | } else { |
| 646 | 646 | echo '[{"new_value":"expired"}]'; |
| 647 | 647 | } |
@@ -666,26 +666,26 @@ discard block |
||
| 666 | 666 | // Get account and pw associated to email |
| 667 | 667 | DB::query( |
| 668 | 668 | 'SELECT * |
| 669 | - FROM ' . prefixTable('users') . ' |
|
| 669 | + FROM ' . prefixTable('users').' |
|
| 670 | 670 | WHERE login = %s', |
| 671 | 671 | $post_login |
| 672 | 672 | ); |
| 673 | 673 | $counter = DB::count(); |
| 674 | 674 | if ($counter != 0) { |
| 675 | 675 | $data = DB::queryFirstRow( |
| 676 | - 'SELECT login, pw, email FROM ' . prefixTable('users') . ' WHERE login = %s', |
|
| 676 | + 'SELECT login, pw, email FROM '.prefixTable('users').' WHERE login = %s', |
|
| 677 | 677 | $post_login |
| 678 | 678 | ); |
| 679 | - $textMail = langHdl('forgot_pw_email_body_1') . ' <a href="' . |
|
| 680 | - $SETTINGS['cpassman_url'] . '/index.php?action=password_recovery&key=' . $key . |
|
| 681 | - '&login=' . $post_login . '">' . $SETTINGS['cpassman_url'] . |
|
| 682 | - '/index.php?action=password_recovery&key=' . $key . '&login=' . $post_login . '</a>.<br><br>' . langHdl('thku'); |
|
| 683 | - $textMailAlt = langHdl('forgot_pw_email_altbody_1') . ' ' . langHdl('at_login') . ' : ' . $post_login . ' - ' . |
|
| 684 | - langHdl('index_password') . ' : ' . md5($data['pw']); |
|
| 679 | + $textMail = langHdl('forgot_pw_email_body_1').' <a href="'. |
|
| 680 | + $SETTINGS['cpassman_url'].'/index.php?action=password_recovery&key='.$key. |
|
| 681 | + '&login='.$post_login.'">'.$SETTINGS['cpassman_url']. |
|
| 682 | + '/index.php?action=password_recovery&key='.$key.'&login='.$post_login.'</a>.<br><br>'.langHdl('thku'); |
|
| 683 | + $textMailAlt = langHdl('forgot_pw_email_altbody_1').' '.langHdl('at_login').' : '.$post_login.' - '. |
|
| 684 | + langHdl('index_password').' : '.md5($data['pw']); |
|
| 685 | 685 | |
| 686 | 686 | // Check if email has already a key in DB |
| 687 | 687 | DB::query( |
| 688 | - 'SELECT * FROM ' . prefixTable('misc') . ' WHERE intitule = %s AND type = %s', |
|
| 688 | + 'SELECT * FROM '.prefixTable('misc').' WHERE intitule = %s AND type = %s', |
|
| 689 | 689 | $post_login, |
| 690 | 690 | 'password_recovery' |
| 691 | 691 | ); |
@@ -723,10 +723,10 @@ discard block |
||
| 723 | 723 | true |
| 724 | 724 | ); |
| 725 | 725 | |
| 726 | - echo '[{"error":"' . $ret['error'] . '" , "message":"' . $ret['message'] . '"}]'; |
|
| 726 | + echo '[{"error":"'.$ret['error'].'" , "message":"'.$ret['message'].'"}]'; |
|
| 727 | 727 | } else { |
| 728 | 728 | // no one has this email ... alert |
| 729 | - echo '[{"error":"error_email" , "message":"' . langHdl('forgot_my_pw_error_email_not_exist') . '"}]'; |
|
| 729 | + echo '[{"error":"error_email" , "message":"'.langHdl('forgot_my_pw_error_email_not_exist').'"}]'; |
|
| 730 | 730 | } |
| 731 | 731 | break; |
| 732 | 732 | |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | // check if key is okay |
| 746 | 746 | $data = DB::queryFirstRow( |
| 747 | 747 | 'SELECT valeur |
| 748 | - FROM ' . prefixTable('misc') . ' |
|
| 748 | + FROM ' . prefixTable('misc').' |
|
| 749 | 749 | WHERE intitule = %s AND type = %s', |
| 750 | 750 | $login, |
| 751 | 751 | 'password_recovery' |
@@ -781,7 +781,7 @@ discard block |
||
| 781 | 781 | ); |
| 782 | 782 | // Get email |
| 783 | 783 | $dataUser = DB::queryFirstRow( |
| 784 | - 'SELECT email FROM ' . prefixTable('users') . ' WHERE login = %s', |
|
| 784 | + 'SELECT email FROM '.prefixTable('users').' WHERE login = %s', |
|
| 785 | 785 | $login |
| 786 | 786 | ); |
| 787 | 787 | |
@@ -790,10 +790,10 @@ discard block |
||
| 790 | 790 | $ret = json_decode( |
| 791 | 791 | sendEmail( |
| 792 | 792 | langHdl('forgot_pw_email_subject_confirm'), |
| 793 | - langHdl('forgot_pw_email_body') . ' ' . $newPwNotCrypted, |
|
| 793 | + langHdl('forgot_pw_email_body').' '.$newPwNotCrypted, |
|
| 794 | 794 | $dataUser['email'], |
| 795 | 795 | $SETTINGS, |
| 796 | - strip_tags(langHdl('forgot_pw_email_body')) . ' ' . $newPwNotCrypted |
|
| 796 | + strip_tags(langHdl('forgot_pw_email_body')).' '.$newPwNotCrypted |
|
| 797 | 797 | ), |
| 798 | 798 | true |
| 799 | 799 | ); |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | // Store PSK |
| 903 | 903 | $_SESSION['user']['session_psk'] = $user_key_encoded; |
| 904 | 904 | setcookie( |
| 905 | - 'TeamPass_PFSK_' . md5($_SESSION['user_id']), |
|
| 905 | + 'TeamPass_PFSK_'.md5($_SESSION['user_id']), |
|
| 906 | 906 | $user_key_encoded, |
| 907 | 907 | (!isset($SETTINGS['personal_saltkey_cookie_duration']) || $SETTINGS['personal_saltkey_cookie_duration'] == 0) ? time() + 60 * 60 * 24 : time() + 60 * 60 * 24 * $SETTINGS['personal_saltkey_cookie_duration'], |
| 908 | 908 | '/' |
@@ -950,7 +950,7 @@ discard block |
||
| 950 | 950 | // Get key from user |
| 951 | 951 | $userInfo = DB::queryfirstrow( |
| 952 | 952 | 'SELECT encrypted_psk |
| 953 | - FROM ' . prefixTable('users') . ' |
|
| 953 | + FROM ' . prefixTable('users').' |
|
| 954 | 954 | WHERE id = %i', |
| 955 | 955 | $_SESSION['user_id'] |
| 956 | 956 | ); |
@@ -1045,8 +1045,8 @@ discard block |
||
| 1045 | 1045 | // Build list of items to be re-encrypted |
| 1046 | 1046 | $rows = DB::query( |
| 1047 | 1047 | 'SELECT i.id as id, i.pw as pw |
| 1048 | - FROM ' . prefixTable('items') . ' as i |
|
| 1049 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id=l.id_item) |
|
| 1048 | + FROM ' . prefixTable('items').' as i |
|
| 1049 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id=l.id_item) |
|
| 1050 | 1050 | WHERE i.perso = %i AND l.id_user= %i AND l.action = %s', |
| 1051 | 1051 | '1', |
| 1052 | 1052 | $_SESSION['user_id'], |
@@ -1058,14 +1058,14 @@ discard block |
||
| 1058 | 1058 | if (empty($list)) { |
| 1059 | 1059 | $list = $record['id']; |
| 1060 | 1060 | } else { |
| 1061 | - $list .= ',' . $record['id']; |
|
| 1061 | + $list .= ','.$record['id']; |
|
| 1062 | 1062 | } |
| 1063 | 1063 | } |
| 1064 | 1064 | } |
| 1065 | 1065 | |
| 1066 | 1066 | // change salt |
| 1067 | 1067 | setcookie( |
| 1068 | - 'TeamPass_PFSK_' . md5($_SESSION['user_id']), |
|
| 1068 | + 'TeamPass_PFSK_'.md5($_SESSION['user_id']), |
|
| 1069 | 1069 | $_SESSION['user']['session_psk'], |
| 1070 | 1070 | time() + 60 * 60 * 24 * $SETTINGS['personal_saltkey_cookie_duration'], |
| 1071 | 1071 | '/' |
@@ -1112,8 +1112,8 @@ discard block |
||
| 1112 | 1112 | // delete all previous items of this user |
| 1113 | 1113 | $rows = DB::query( |
| 1114 | 1114 | 'SELECT i.id as id |
| 1115 | - FROM ' . prefixTable('items') . ' as i |
|
| 1116 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id=l.id_item) |
|
| 1115 | + FROM ' . prefixTable('items').' as i |
|
| 1116 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id=l.id_item) |
|
| 1117 | 1117 | WHERE i.perso = %i AND l.id_user= %i AND l.action = %s', |
| 1118 | 1118 | '1', |
| 1119 | 1119 | $_SESSION['user_id'], |
@@ -1158,7 +1158,7 @@ discard block |
||
| 1158 | 1158 | |
| 1159 | 1159 | // change salt |
| 1160 | 1160 | setcookie( |
| 1161 | - 'TeamPass_PFSK_' . md5($_SESSION['user_id']), |
|
| 1161 | + 'TeamPass_PFSK_'.md5($_SESSION['user_id']), |
|
| 1162 | 1162 | $_SESSION['user']['session_psk'], |
| 1163 | 1163 | time() + 60 * 60 * 24 * $SETTINGS['personal_saltkey_cookie_duration'], |
| 1164 | 1164 | '/' |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | && $SETTINGS['enable_send_email_on_user_login'] === '1' |
| 1212 | 1212 | ) { |
| 1213 | 1213 | $row = DB::queryFirstRow( |
| 1214 | - 'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', |
|
| 1214 | + 'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', |
|
| 1215 | 1215 | 'cron', |
| 1216 | 1216 | 'sending_emails' |
| 1217 | 1217 | ); |
@@ -1219,12 +1219,12 @@ discard block |
||
| 1219 | 1219 | if ((int) (time() - $row['valeur']) >= 300 || (int) $row['valeur'] === 0) { |
| 1220 | 1220 | $rows = DB::query( |
| 1221 | 1221 | 'SELECT * |
| 1222 | - FROM ' . prefixTable('emails') . |
|
| 1222 | + FROM ' . prefixTable('emails'). |
|
| 1223 | 1223 | ' WHERE status != %s', |
| 1224 | 1224 | 'sent' |
| 1225 | 1225 | ); |
| 1226 | 1226 | foreach ($rows as $record) { |
| 1227 | - echo $record['increment_id'] . " >> "; |
|
| 1227 | + echo $record['increment_id']." >> "; |
|
| 1228 | 1228 | // Send email |
| 1229 | 1229 | $ret = json_decode( |
| 1230 | 1230 | sendEmail( |
@@ -1342,7 +1342,7 @@ discard block |
||
| 1342 | 1342 | */ |
| 1343 | 1343 | case 'check_login_exists': |
| 1344 | 1344 | $data = DB::query( |
| 1345 | - 'SELECT login, psk FROM ' . prefixTable('users') . ' |
|
| 1345 | + 'SELECT login, psk FROM '.prefixTable('users').' |
|
| 1346 | 1346 | WHERE login = %i', |
| 1347 | 1347 | stripslashes(filter_input(INPUT_POST, 'userId', FILTER_SANITIZE_NUMBER_INT)) |
| 1348 | 1348 | ); |
@@ -1352,7 +1352,7 @@ discard block |
||
| 1352 | 1352 | $userOk = true; |
| 1353 | 1353 | } |
| 1354 | 1354 | |
| 1355 | - echo '[{"login" : "' . $userOk . '", "psk":"0"}]'; |
|
| 1355 | + echo '[{"login" : "'.$userOk.'", "psk":"0"}]'; |
|
| 1356 | 1356 | break; |
| 1357 | 1357 | /* |
| 1358 | 1358 | * Make statistics on item |
@@ -1363,7 +1363,7 @@ discard block |
||
| 1363 | 1363 | && filter_input(INPUT_POST, 'scope', FILTER_SANITIZE_STRING) === 'item' |
| 1364 | 1364 | ) { |
| 1365 | 1365 | $data = DB::queryfirstrow( |
| 1366 | - 'SELECT view FROM ' . prefixTable('statistics') . ' WHERE scope = %s AND item_id = %i', |
|
| 1366 | + 'SELECT view FROM '.prefixTable('statistics').' WHERE scope = %s AND item_id = %i', |
|
| 1367 | 1367 | 'item', |
| 1368 | 1368 | filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT) |
| 1369 | 1369 | ); |
@@ -1404,8 +1404,8 @@ discard block |
||
| 1404 | 1404 | $arr_html = array(); |
| 1405 | 1405 | $rows = DB::query( |
| 1406 | 1406 | 'SELECT i.id AS id, i.label AS label, i.id_tree AS id_tree, l.date, i.perso AS perso, i.restricted_to AS restricted |
| 1407 | - FROM ' . prefixTable('log_items') . ' AS l |
|
| 1408 | - RIGHT JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id) |
|
| 1407 | + FROM ' . prefixTable('log_items').' AS l |
|
| 1408 | + RIGHT JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id) |
|
| 1409 | 1409 | WHERE l.action = %s AND l.id_user = %i |
| 1410 | 1410 | ORDER BY l.date DESC |
| 1411 | 1411 | LIMIT 0, 100', |
@@ -1438,7 +1438,7 @@ discard block |
||
| 1438 | 1438 | isset($SETTINGS['enable_suggestion']) && $SETTINGS['enable_suggestion'] == 1 |
| 1439 | 1439 | && ($_SESSION['user_admin'] == 1 || $_SESSION['user_manager'] == 1) |
| 1440 | 1440 | ) { |
| 1441 | - DB::query('SELECT * FROM ' . prefixTable('suggestion')); |
|
| 1441 | + DB::query('SELECT * FROM '.prefixTable('suggestion')); |
|
| 1442 | 1442 | $nb_suggestions_waiting = DB::count(); |
| 1443 | 1443 | } |
| 1444 | 1444 | |
@@ -1462,7 +1462,7 @@ discard block |
||
| 1462 | 1462 | $pwdlib = new PasswordLib\PasswordLib(); |
| 1463 | 1463 | // generate key |
| 1464 | 1464 | $key = $pwdlib->getRandomToken(filter_input(INPUT_POST, 'size', FILTER_SANITIZE_NUMBER_INT)); |
| 1465 | - echo '[{"key" : "' . htmlentities($key, ENT_QUOTES) . '"}]'; |
|
| 1465 | + echo '[{"key" : "'.htmlentities($key, ENT_QUOTES).'"}]'; |
|
| 1466 | 1466 | break; |
| 1467 | 1467 | |
| 1468 | 1468 | /* |
@@ -1491,7 +1491,7 @@ discard block |
||
| 1491 | 1491 | ) |
| 1492 | 1492 | ); |
| 1493 | 1493 | |
| 1494 | - echo '[{"token" : "' . $token . '"}]'; |
|
| 1494 | + echo '[{"token" : "'.$token.'"}]'; |
|
| 1495 | 1495 | break; |
| 1496 | 1496 | |
| 1497 | 1497 | |
@@ -1506,14 +1506,14 @@ discard block |
||
| 1506 | 1506 | |
| 1507 | 1507 | if ($_SESSION['user_manager'] === '1' || $_SESSION['is_admin'] === '1') { |
| 1508 | 1508 | $count = 0; |
| 1509 | - DB::query('SELECT * FROM ' . prefixTable('items_change')); |
|
| 1509 | + DB::query('SELECT * FROM '.prefixTable('items_change')); |
|
| 1510 | 1510 | $count += DB::count(); |
| 1511 | - DB::query('SELECT * FROM ' . prefixTable('suggestion')); |
|
| 1511 | + DB::query('SELECT * FROM '.prefixTable('suggestion')); |
|
| 1512 | 1512 | $count += DB::count(); |
| 1513 | 1513 | |
| 1514 | - echo '[ { "error" : "" , "count" : "' . $count . '" , "show_sug_in_menu" : "0"} ]'; |
|
| 1514 | + echo '[ { "error" : "" , "count" : "'.$count.'" , "show_sug_in_menu" : "0"} ]'; |
|
| 1515 | 1515 | } elseif (isset($_SESSION['nb_item_change_proposals']) && $_SESSION['nb_item_change_proposals'] > 0) { |
| 1516 | - echo '[ { "error" : "" , "count" : "' . $_SESSION['nb_item_change_proposals'] . '" , "show_sug_in_menu" : "1"} ]'; |
|
| 1516 | + echo '[ { "error" : "" , "count" : "'.$_SESSION['nb_item_change_proposals'].'" , "show_sug_in_menu" : "1"} ]'; |
|
| 1517 | 1517 | } else { |
| 1518 | 1518 | echo '[ { "error" : "" , "count" : "" , "show_sug_in_menu" : "0"} ]'; |
| 1519 | 1519 | } |
@@ -1548,9 +1548,9 @@ discard block |
||
| 1548 | 1548 | $tmp = ''; |
| 1549 | 1549 | foreach ($stats_data[$data] as $key => $value) { |
| 1550 | 1550 | if (empty($tmp)) { |
| 1551 | - $tmp = $key . '-' . $value; |
|
| 1551 | + $tmp = $key.'-'.$value; |
|
| 1552 | 1552 | } else { |
| 1553 | - $tmp .= ',' . $key . '-' . $value; |
|
| 1553 | + $tmp .= ','.$key.'-'.$value; |
|
| 1554 | 1554 | } |
| 1555 | 1555 | } |
| 1556 | 1556 | $statsToSend[$data] = $tmp; |
@@ -1558,9 +1558,9 @@ discard block |
||
| 1558 | 1558 | $tmp = ''; |
| 1559 | 1559 | foreach ($stats_data[$data] as $key => $value) { |
| 1560 | 1560 | if (empty($tmp)) { |
| 1561 | - $tmp = $key . '-' . $value; |
|
| 1561 | + $tmp = $key.'-'.$value; |
|
| 1562 | 1562 | } else { |
| 1563 | - $tmp .= ',' . $key . '-' . $value; |
|
| 1563 | + $tmp .= ','.$key.'-'.$value; |
|
| 1564 | 1564 | } |
| 1565 | 1565 | } |
| 1566 | 1566 | $statsToSend[$data] = $tmp; |
@@ -1657,8 +1657,8 @@ discard block |
||
| 1657 | 1657 | if (strpos($line, 'cpassman_url') > 0 && empty($url_found) === true) { |
| 1658 | 1658 | $url_found = substr($line, 19, strlen($line) - 22); |
| 1659 | 1659 | $tmp = parse_url($url_found); |
| 1660 | - $anonym_url = $tmp['scheme'] . '://<anonym_url>' . $tmp['path']; |
|
| 1661 | - $line = "'cpassman_url' => '" . $anonym_url . "\n"; |
|
| 1660 | + $anonym_url = $tmp['scheme'].'://<anonym_url>'.$tmp['path']; |
|
| 1661 | + $line = "'cpassman_url' => '".$anonym_url."\n"; |
|
| 1662 | 1662 | } |
| 1663 | 1663 | |
| 1664 | 1664 | // Anonymize all urls |
@@ -1686,7 +1686,7 @@ discard block |
||
| 1686 | 1686 | $teampass_errors = ''; |
| 1687 | 1687 | $rows = DB::query( |
| 1688 | 1688 | 'SELECT label, date AS error_date |
| 1689 | - FROM ' . prefixTable('log_system') . " |
|
| 1689 | + FROM ' . prefixTable('log_system')." |
|
| 1690 | 1690 | WHERE `type` LIKE 'error' |
| 1691 | 1691 | ORDER BY `date` DESC |
| 1692 | 1692 | LIMIT 0, 10" |
@@ -1694,10 +1694,10 @@ discard block |
||
| 1694 | 1694 | if (DB::count() > 0) { |
| 1695 | 1695 | foreach ($rows as $record) { |
| 1696 | 1696 | if (empty($teampass_errors) === true) { |
| 1697 | - $teampass_errors = ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $record['error_date']) . ' - ' . $record['label']; |
|
| 1697 | + $teampass_errors = ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $record['error_date']).' - '.$record['label']; |
|
| 1698 | 1698 | } else { |
| 1699 | 1699 | $teampass_errors .= ' |
| 1700 | - * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $record['error_date']) . ' - ' . $record['label']; |
|
| 1700 | + * ' . date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $record['error_date']).' - '.$record['label']; |
|
| 1701 | 1701 | } |
| 1702 | 1702 | } |
| 1703 | 1703 | } |
@@ -1706,7 +1706,7 @@ discard block |
||
| 1706 | 1706 | |
| 1707 | 1707 | // Now prepare text |
| 1708 | 1708 | $txt = '### Page on which it happened |
| 1709 | -' . $post_data['current_page'] . ' |
|
| 1709 | +' . $post_data['current_page'].' |
|
| 1710 | 1710 | |
| 1711 | 1711 | ### Steps to reproduce |
| 1712 | 1712 | 1. |
@@ -1721,39 +1721,39 @@ discard block |
||
| 1721 | 1721 | Tell us what happens instead |
| 1722 | 1722 | |
| 1723 | 1723 | ### Server configuration |
| 1724 | -**Operating system**: ' . php_uname() . ' |
|
| 1724 | +**Operating system**: ' . php_uname().' |
|
| 1725 | 1725 | |
| 1726 | -**Web server:** ' . $_SERVER['SERVER_SOFTWARE'] . ' |
|
| 1726 | +**Web server:** ' . $_SERVER['SERVER_SOFTWARE'].' |
|
| 1727 | 1727 | |
| 1728 | -**Database:** ' . ($link === false ? langHdl('undefined') : mysqli_get_server_info($link)) . ' |
|
| 1728 | +**Database:** ' . ($link === false ? langHdl('undefined') : mysqli_get_server_info($link)).' |
|
| 1729 | 1729 | |
| 1730 | -**PHP version:** ' . PHP_VERSION . ' |
|
| 1730 | +**PHP version:** ' . PHP_VERSION.' |
|
| 1731 | 1731 | |
| 1732 | -**Teampass version:** ' . TP_VERSION_FULL . ' |
|
| 1732 | +**Teampass version:** ' . TP_VERSION_FULL.' |
|
| 1733 | 1733 | |
| 1734 | 1734 | **Teampass configuration file:** |
| 1735 | 1735 | ``` |
| 1736 | -' . $list_of_options . ' |
|
| 1736 | +' . $list_of_options.' |
|
| 1737 | 1737 | ``` |
| 1738 | 1738 | |
| 1739 | 1739 | **Updated from an older Teampass or fresh install:** |
| 1740 | 1740 | |
| 1741 | 1741 | ### Client configuration |
| 1742 | 1742 | |
| 1743 | -**Browser:** ' . $post_data['browser_name'] . ' - ' . $post_data['browser_version'] . ' |
|
| 1743 | +**Browser:** ' . $post_data['browser_name'].' - '.$post_data['browser_version'].' |
|
| 1744 | 1744 | |
| 1745 | -**Operating system:** ' . $post_data['os'] . ' - ' . $post_data['os_archi'] . 'bits |
|
| 1745 | +**Operating system:** ' . $post_data['os'].' - '.$post_data['os_archi'].'bits |
|
| 1746 | 1746 | |
| 1747 | 1747 | ### Logs |
| 1748 | 1748 | |
| 1749 | 1749 | #### Web server error log |
| 1750 | 1750 | ``` |
| 1751 | -' . $err['message'] . ' - ' . $err['file'] . ' (' . $err['line'] . ') |
|
| 1751 | +' . $err['message'].' - '.$err['file'].' ('.$err['line'].') |
|
| 1752 | 1752 | ``` |
| 1753 | 1753 | |
| 1754 | 1754 | #### Teampass 10 last system errors |
| 1755 | 1755 | ``` |
| 1756 | -' . $teampass_errors . ' |
|
| 1756 | +' . $teampass_errors.' |
|
| 1757 | 1757 | ``` |
| 1758 | 1758 | |
| 1759 | 1759 | #### Log from the web-browser developer console (CTRL + SHIFT + i) |
@@ -1858,7 +1858,7 @@ discard block |
||
| 1858 | 1858 | // Check if user exists |
| 1859 | 1859 | $userInfo = DB::queryFirstRow( |
| 1860 | 1860 | 'SELECT public_key, private_key, pw |
| 1861 | - FROM ' . prefixTable('users') . ' |
|
| 1861 | + FROM ' . prefixTable('users').' |
|
| 1862 | 1862 | WHERE id = %i', |
| 1863 | 1863 | $post_user_id |
| 1864 | 1864 | ); |
@@ -1866,14 +1866,14 @@ discard block |
||
| 1866 | 1866 | // Get one item |
| 1867 | 1867 | $record = DB::queryFirstRow( |
| 1868 | 1868 | 'SELECT id, pw |
| 1869 | - FROM ' . prefixTable('items') . ' |
|
| 1869 | + FROM ' . prefixTable('items').' |
|
| 1870 | 1870 | WHERE perso = 0' |
| 1871 | 1871 | ); |
| 1872 | 1872 | |
| 1873 | 1873 | // Get itemKey from current user |
| 1874 | 1874 | $currentUserKey = DB::queryFirstRow( |
| 1875 | 1875 | 'SELECT share_key, increment_id |
| 1876 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 1876 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 1877 | 1877 | WHERE object_id = %i AND user_id = %i', |
| 1878 | 1878 | $record['id'], |
| 1879 | 1879 | $post_user_id |
@@ -1902,7 +1902,7 @@ discard block |
||
| 1902 | 1902 | } else { |
| 1903 | 1903 | // Use the password check |
| 1904 | 1904 | // load passwordLib library |
| 1905 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1905 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1906 | 1906 | $pwdlib->register(); |
| 1907 | 1907 | $pwdlib = new PasswordLib\PasswordLib(); |
| 1908 | 1908 | |
@@ -2083,7 +2083,7 @@ discard block |
||
| 2083 | 2083 | // Get user info |
| 2084 | 2084 | $userData = DB::queryFirstRow( |
| 2085 | 2085 | 'SELECT private_key |
| 2086 | - FROM ' . prefixTable('users') . ' |
|
| 2086 | + FROM ' . prefixTable('users').' |
|
| 2087 | 2087 | WHERE id = %i', |
| 2088 | 2088 | $post_user_id |
| 2089 | 2089 | ); |
@@ -2104,7 +2104,7 @@ discard block |
||
| 2104 | 2104 | ); |
| 2105 | 2105 | |
| 2106 | 2106 | // Load superGlobals |
| 2107 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2107 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2108 | 2108 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 2109 | 2109 | |
| 2110 | 2110 | $superGlobal->put('private_key', $privateKey, 'SESSION', 'user'); |
@@ -2166,7 +2166,7 @@ discard block |
||
| 2166 | 2166 | // Get user info |
| 2167 | 2167 | $userData = DB::queryFirstRow( |
| 2168 | 2168 | 'SELECT email, auth_type, login |
| 2169 | - FROM ' . prefixTable('users') . ' |
|
| 2169 | + FROM ' . prefixTable('users').' |
|
| 2170 | 2170 | WHERE id = %i', |
| 2171 | 2171 | $post_user_id |
| 2172 | 2172 | ); |
@@ -2234,7 +2234,7 @@ discard block |
||
| 2234 | 2234 | array( |
| 2235 | 2235 | 'error' => false, |
| 2236 | 2236 | 'message' => '', |
| 2237 | - 'debug' => $post_user_password. ' - Email was sent', |
|
| 2237 | + 'debug' => $post_user_password.' - Email was sent', |
|
| 2238 | 2238 | ), |
| 2239 | 2239 | 'encode' |
| 2240 | 2240 | ); |
@@ -2368,7 +2368,7 @@ discard block |
||
| 2368 | 2368 | // Get user info |
| 2369 | 2369 | $userData = DB::queryFirstRow( |
| 2370 | 2370 | 'SELECT email, auth_type, login |
| 2371 | - FROM ' . prefixTable('users') . ' |
|
| 2371 | + FROM ' . prefixTable('users').' |
|
| 2372 | 2372 | WHERE id = %i', |
| 2373 | 2373 | $post_user_id |
| 2374 | 2374 | ); |
@@ -2437,13 +2437,13 @@ discard block |
||
| 2437 | 2437 | // Check if user exists |
| 2438 | 2438 | DB::queryFirstRow( |
| 2439 | 2439 | 'SELECT * |
| 2440 | - FROM ' . prefixTable('users') . ' |
|
| 2440 | + FROM ' . prefixTable('users').' |
|
| 2441 | 2441 | WHERE id = %i', |
| 2442 | 2442 | $post_user_id |
| 2443 | 2443 | ); |
| 2444 | 2444 | if (DB::count() > 0) { |
| 2445 | 2445 | // Include libraries |
| 2446 | - include_once $SETTINGS['cpassman_dir'] . '/sources/aes.functions.php'; |
|
| 2446 | + include_once $SETTINGS['cpassman_dir'].'/sources/aes.functions.php'; |
|
| 2447 | 2447 | |
| 2448 | 2448 | // CLear old sharekeys |
| 2449 | 2449 | if ($post_self_change === false) { |
@@ -2512,13 +2512,13 @@ discard block |
||
| 2512 | 2512 | // Check if user exists |
| 2513 | 2513 | $userInfo = DB::queryFirstRow( |
| 2514 | 2514 | 'SELECT public_key |
| 2515 | - FROM ' . prefixTable('users') . ' |
|
| 2515 | + FROM ' . prefixTable('users').' |
|
| 2516 | 2516 | WHERE id = %i', |
| 2517 | 2517 | $post_user_id |
| 2518 | 2518 | ); |
| 2519 | 2519 | if (DB::count() > 0) { |
| 2520 | 2520 | // Include libraries |
| 2521 | - include_once $SETTINGS['cpassman_dir'] . '/sources/aes.functions.php'; |
|
| 2521 | + include_once $SETTINGS['cpassman_dir'].'/sources/aes.functions.php'; |
|
| 2522 | 2522 | |
| 2523 | 2523 | // WHAT STEP TO PERFORM? |
| 2524 | 2524 | if ($post_action === 'step0') { |
@@ -2534,15 +2534,15 @@ discard block |
||
| 2534 | 2534 | // Loop on items |
| 2535 | 2535 | $rows = DB::query( |
| 2536 | 2536 | 'SELECT id, pw |
| 2537 | - FROM ' . prefixTable('items') . ' |
|
| 2537 | + FROM ' . prefixTable('items').' |
|
| 2538 | 2538 | WHERE perso = 0 |
| 2539 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 2539 | + LIMIT ' . $post_start.', '.$post_length |
|
| 2540 | 2540 | ); |
| 2541 | 2541 | foreach ($rows as $record) { |
| 2542 | 2542 | // Get itemKey from current user |
| 2543 | 2543 | $currentUserKey = DB::queryFirstRow( |
| 2544 | 2544 | 'SELECT share_key, increment_id |
| 2545 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2545 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2546 | 2546 | WHERE object_id = %i AND user_id = %i', |
| 2547 | 2547 | $record['id'], |
| 2548 | 2548 | $_SESSION['user_id'] |
@@ -2569,7 +2569,7 @@ discard block |
||
| 2569 | 2569 | if ((int) $post_user_id !== (int) $_SESSION['user_id']) { |
| 2570 | 2570 | $currentUserKey = DB::queryFirstRow( |
| 2571 | 2571 | 'SELECT increment_id |
| 2572 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2572 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2573 | 2573 | WHERE object_id = %i AND user_id = %i', |
| 2574 | 2574 | $record['id'], |
| 2575 | 2575 | $post_user_id |
@@ -2602,7 +2602,7 @@ discard block |
||
| 2602 | 2602 | // SHould we change step? |
| 2603 | 2603 | DB::query( |
| 2604 | 2604 | 'SELECT * |
| 2605 | - FROM ' . prefixTable('items') . ' |
|
| 2605 | + FROM ' . prefixTable('items').' |
|
| 2606 | 2606 | WHERE perso = 0' |
| 2607 | 2607 | ); |
| 2608 | 2608 | $next_start = (int) $post_start + (int) $post_length; |
@@ -2618,15 +2618,15 @@ discard block |
||
| 2618 | 2618 | // Loop on logs |
| 2619 | 2619 | $rows = DB::query( |
| 2620 | 2620 | 'SELECT increment_id |
| 2621 | - FROM ' . prefixTable('log_items') . ' |
|
| 2621 | + FROM ' . prefixTable('log_items').' |
|
| 2622 | 2622 | WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes" |
| 2623 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 2623 | + LIMIT ' . $post_start.', '.$post_length |
|
| 2624 | 2624 | ); |
| 2625 | 2625 | foreach ($rows as $record) { |
| 2626 | 2626 | // Get itemKey from current user |
| 2627 | 2627 | $currentUserKey = DB::queryFirstRow( |
| 2628 | 2628 | 'SELECT share_key |
| 2629 | - FROM ' . prefixTable('sharekeys_logs') . ' |
|
| 2629 | + FROM ' . prefixTable('sharekeys_logs').' |
|
| 2630 | 2630 | WHERE object_id = %i AND user_id = %i', |
| 2631 | 2631 | $record['increment_id'], |
| 2632 | 2632 | $_SESSION['user_id'] |
@@ -2653,7 +2653,7 @@ discard block |
||
| 2653 | 2653 | if ((int) $post_user_id !== (int) $_SESSION['user_id']) { |
| 2654 | 2654 | $currentUserKey = DB::queryFirstRow( |
| 2655 | 2655 | 'SELECT increment_id |
| 2656 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2656 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2657 | 2657 | WHERE object_id = %i AND user_id = %i', |
| 2658 | 2658 | $record['id'], |
| 2659 | 2659 | $post_user_id |
@@ -2675,7 +2675,7 @@ discard block |
||
| 2675 | 2675 | // SHould we change step? |
| 2676 | 2676 | DB::query( |
| 2677 | 2677 | 'SELECT increment_id |
| 2678 | - FROM ' . prefixTable('log_items') . ' |
|
| 2678 | + FROM ' . prefixTable('log_items').' |
|
| 2679 | 2679 | WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"' |
| 2680 | 2680 | ); |
| 2681 | 2681 | $next_start = (int) $post_start + (int) $post_length; |
@@ -2691,15 +2691,15 @@ discard block |
||
| 2691 | 2691 | // Loop on fields |
| 2692 | 2692 | $rows = DB::query( |
| 2693 | 2693 | 'SELECT id |
| 2694 | - FROM ' . prefixTable('categories_items') . ' |
|
| 2694 | + FROM ' . prefixTable('categories_items').' |
|
| 2695 | 2695 | WHERE encryption_type = "teampass_aes" |
| 2696 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 2696 | + LIMIT ' . $post_start.', '.$post_length |
|
| 2697 | 2697 | ); |
| 2698 | 2698 | foreach ($rows as $record) { |
| 2699 | 2699 | // Get itemKey from current user |
| 2700 | 2700 | $currentUserKey = DB::queryFirstRow( |
| 2701 | 2701 | 'SELECT share_key |
| 2702 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 2702 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 2703 | 2703 | WHERE object_id = %i AND user_id = %i', |
| 2704 | 2704 | $record['id'], |
| 2705 | 2705 | $_SESSION['user_id'] |
@@ -2726,7 +2726,7 @@ discard block |
||
| 2726 | 2726 | if ((int) $post_user_id !== (int) $_SESSION['user_id']) { |
| 2727 | 2727 | $currentUserKey = DB::queryFirstRow( |
| 2728 | 2728 | 'SELECT increment_id |
| 2729 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2729 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2730 | 2730 | WHERE object_id = %i AND user_id = %i', |
| 2731 | 2731 | $record['id'], |
| 2732 | 2732 | $post_user_id |
@@ -2748,7 +2748,7 @@ discard block |
||
| 2748 | 2748 | // SHould we change step? |
| 2749 | 2749 | DB::query( |
| 2750 | 2750 | 'SELECT * |
| 2751 | - FROM ' . prefixTable('categories_items') . ' |
|
| 2751 | + FROM ' . prefixTable('categories_items').' |
|
| 2752 | 2752 | WHERE encryption_type = "teampass_aes"' |
| 2753 | 2753 | ); |
| 2754 | 2754 | $next_start = (int) $post_start + (int) $post_length; |
@@ -2764,14 +2764,14 @@ discard block |
||
| 2764 | 2764 | // Loop on suggestions |
| 2765 | 2765 | $rows = DB::query( |
| 2766 | 2766 | 'SELECT id |
| 2767 | - FROM ' . prefixTable('suggestion') . ' |
|
| 2768 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 2767 | + FROM ' . prefixTable('suggestion').' |
|
| 2768 | + LIMIT ' . $post_start.', '.$post_length |
|
| 2769 | 2769 | ); |
| 2770 | 2770 | foreach ($rows as $record) { |
| 2771 | 2771 | // Get itemKey from current user |
| 2772 | 2772 | $currentUserKey = DB::queryFirstRow( |
| 2773 | 2773 | 'SELECT share_key |
| 2774 | - FROM ' . prefixTable('sharekeys_suggestions') . ' |
|
| 2774 | + FROM ' . prefixTable('sharekeys_suggestions').' |
|
| 2775 | 2775 | WHERE object_id = %i AND user_id = %i', |
| 2776 | 2776 | $record['id'], |
| 2777 | 2777 | $_SESSION['user_id'] |
@@ -2798,7 +2798,7 @@ discard block |
||
| 2798 | 2798 | if ((int) $post_user_id !== (int) $_SESSION['user_id']) { |
| 2799 | 2799 | $currentUserKey = DB::queryFirstRow( |
| 2800 | 2800 | 'SELECT increment_id |
| 2801 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2801 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2802 | 2802 | WHERE object_id = %i AND user_id = %i', |
| 2803 | 2803 | $record['id'], |
| 2804 | 2804 | $post_user_id |
@@ -2835,15 +2835,15 @@ discard block |
||
| 2835 | 2835 | // Loop on files |
| 2836 | 2836 | $rows = DB::query( |
| 2837 | 2837 | 'SELECT id |
| 2838 | - FROM ' . prefixTable('files') . ' |
|
| 2839 | - WHERE status = "' . TP_ENCRYPTION_NAME . '" |
|
| 2840 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 2838 | + FROM ' . prefixTable('files').' |
|
| 2839 | + WHERE status = "' . TP_ENCRYPTION_NAME.'" |
|
| 2840 | + LIMIT ' . $post_start.', '.$post_length |
|
| 2841 | 2841 | ); //aes_encryption |
| 2842 | 2842 | foreach ($rows as $record) { |
| 2843 | 2843 | // Get itemKey from current user |
| 2844 | 2844 | $currentUserKey = DB::queryFirstRow( |
| 2845 | 2845 | 'SELECT share_key |
| 2846 | - FROM ' . prefixTable('sharekeys_files') . ' |
|
| 2846 | + FROM ' . prefixTable('sharekeys_files').' |
|
| 2847 | 2847 | WHERE object_id = %i AND user_id = %i', |
| 2848 | 2848 | $record['id'], |
| 2849 | 2849 | $_SESSION['user_id'] |
@@ -2870,7 +2870,7 @@ discard block |
||
| 2870 | 2870 | if ((int) $post_user_id !== (int) $_SESSION['user_id']) { |
| 2871 | 2871 | $currentUserKey = DB::queryFirstRow( |
| 2872 | 2872 | 'SELECT increment_id |
| 2873 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2873 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2874 | 2874 | WHERE object_id = %i AND user_id = %i', |
| 2875 | 2875 | $record['id'], |
| 2876 | 2876 | $post_user_id |
@@ -2892,8 +2892,8 @@ discard block |
||
| 2892 | 2892 | // SHould we change step? |
| 2893 | 2893 | DB::query( |
| 2894 | 2894 | 'SELECT * |
| 2895 | - FROM ' . prefixTable('files') . ' |
|
| 2896 | - WHERE status = "' . TP_ENCRYPTION_NAME . '"' |
|
| 2895 | + FROM ' . prefixTable('files').' |
|
| 2896 | + WHERE status = "' . TP_ENCRYPTION_NAME.'"' |
|
| 2897 | 2897 | ); |
| 2898 | 2898 | $next_start = (int) $post_start + (int) $post_length; |
| 2899 | 2899 | if ($next_start > DB::count()) { |
@@ -2913,16 +2913,16 @@ discard block |
||
| 2913 | 2913 | if (count($_SESSION['personal_folders']) > 0) { |
| 2914 | 2914 | $rows = DB::query( |
| 2915 | 2915 | 'SELECT id, pw |
| 2916 | - FROM ' . prefixTable('items') . ' |
|
| 2916 | + FROM ' . prefixTable('items').' |
|
| 2917 | 2917 | WHERE perso = 1 AND id_tree IN %ls |
| 2918 | - LIMIT ' . $post_start . ', ' . $post_length, |
|
| 2918 | + LIMIT ' . $post_start.', '.$post_length, |
|
| 2919 | 2919 | $_SESSION['personal_folders'] |
| 2920 | 2920 | ); |
| 2921 | 2921 | foreach ($rows as $record) { |
| 2922 | 2922 | // Get itemKey from current user |
| 2923 | 2923 | $currentUserKey = DB::queryFirstRow( |
| 2924 | 2924 | 'SELECT share_key, increment_id |
| 2925 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2925 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2926 | 2926 | WHERE object_id = %i AND user_id = %i', |
| 2927 | 2927 | $record['id'], |
| 2928 | 2928 | $_SESSION['user_id'] |
@@ -2949,7 +2949,7 @@ discard block |
||
| 2949 | 2949 | if ((int) $post_user_id !== (int) $_SESSION['user_id']) { |
| 2950 | 2950 | $currentUserKey = DB::queryFirstRow( |
| 2951 | 2951 | 'SELECT increment_id |
| 2952 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2952 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2953 | 2953 | WHERE object_id = %i AND user_id = %i', |
| 2954 | 2954 | $record['id'], |
| 2955 | 2955 | $post_user_id |
@@ -2972,7 +2972,7 @@ discard block |
||
| 2972 | 2972 | // SHould we change step? |
| 2973 | 2973 | DB::query( |
| 2974 | 2974 | 'SELECT * |
| 2975 | - FROM ' . prefixTable('items') . ' |
|
| 2975 | + FROM ' . prefixTable('items').' |
|
| 2976 | 2976 | WHERE perso = 0' |
| 2977 | 2977 | ); |
| 2978 | 2978 | $next_start = (int) $post_start + (int) $post_length; |
@@ -3059,7 +3059,7 @@ discard block |
||
| 3059 | 3059 | // Check if user exists |
| 3060 | 3060 | $userInfo = DB::queryFirstRow( |
| 3061 | 3061 | 'SELECT public_key, encrypted_psk |
| 3062 | - FROM ' . prefixTable('users') . ' |
|
| 3062 | + FROM ' . prefixTable('users').' |
|
| 3063 | 3063 | WHERE id = %i', |
| 3064 | 3064 | $post_user_id |
| 3065 | 3065 | ); |
@@ -3084,9 +3084,9 @@ discard block |
||
| 3084 | 3084 | // Loop on persoanl items |
| 3085 | 3085 | $rows = DB::query( |
| 3086 | 3086 | 'SELECT id, pw |
| 3087 | - FROM ' . prefixTable('items') . ' |
|
| 3087 | + FROM ' . prefixTable('items').' |
|
| 3088 | 3088 | WHERE perso = 1 AND id_tree IN %ls |
| 3089 | - LIMIT ' . $post_start . ', ' . $post_length, |
|
| 3089 | + LIMIT ' . $post_start.', '.$post_length, |
|
| 3090 | 3090 | $_SESSION['personal_folders'] |
| 3091 | 3091 | ); |
| 3092 | 3092 | $countUserPersonalItems = DB::count(); |
@@ -3129,7 +3129,7 @@ discard block |
||
| 3129 | 3129 | // Loop on files |
| 3130 | 3130 | $rows = DB::query( |
| 3131 | 3131 | 'SELECT id, file |
| 3132 | - FROM ' . prefixTable('files') . ' |
|
| 3132 | + FROM ' . prefixTable('files').' |
|
| 3133 | 3133 | WHERE status != %s |
| 3134 | 3134 | AND id_item = %i', |
| 3135 | 3135 | TP_ENCRYPTION_NAME, |
@@ -3140,13 +3140,13 @@ discard block |
||
| 3140 | 3140 | // Now decrypt the file |
| 3141 | 3141 | prepareFileWithDefuse( |
| 3142 | 3142 | 'decrypt', |
| 3143 | - $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'], |
|
| 3144 | - $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'] . '.delete', |
|
| 3143 | + $SETTINGS['path_to_upload_folder'].'/'.$record2['file'], |
|
| 3144 | + $SETTINGS['path_to_upload_folder'].'/'.$record2['file'].'.delete', |
|
| 3145 | 3145 | $dataReceived['userPsk'] |
| 3146 | 3146 | ); |
| 3147 | 3147 | |
| 3148 | 3148 | // Encrypt the file |
| 3149 | - $encryptedFile = encryptFile($record2['file'] . '.delete', $SETTINGS['path_to_upload_folder']); |
|
| 3149 | + $encryptedFile = encryptFile($record2['file'].'.delete', $SETTINGS['path_to_upload_folder']); |
|
| 3150 | 3150 | |
| 3151 | 3151 | DB::update( |
| 3152 | 3152 | prefixTable('files'), |
@@ -3169,7 +3169,7 @@ discard block |
||
| 3169 | 3169 | ); |
| 3170 | 3170 | |
| 3171 | 3171 | // Unlink original file |
| 3172 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record2['file']); |
|
| 3172 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record2['file']); |
|
| 3173 | 3173 | } |
| 3174 | 3174 | } |
| 3175 | 3175 | } |
@@ -3262,7 +3262,7 @@ discard block |
||
| 3262 | 3262 | // Get user info |
| 3263 | 3263 | $userData = DB::queryFirstRow( |
| 3264 | 3264 | 'SELECT '.$post_fields.' |
| 3265 | - FROM ' . prefixTable('users') . ' |
|
| 3265 | + FROM ' . prefixTable('users').' |
|
| 3266 | 3266 | WHERE id = %i', |
| 3267 | 3267 | $post_user_id |
| 3268 | 3268 | ); |
@@ -3322,7 +3322,7 @@ discard block |
||
| 3322 | 3322 | // Get user info |
| 3323 | 3323 | $userData = DB::queryFirstRow( |
| 3324 | 3324 | 'SELECT auth_type, login, private_key |
| 3325 | - FROM ' . prefixTable('users') . ' |
|
| 3325 | + FROM ' . prefixTable('users').' |
|
| 3326 | 3326 | WHERE id = %i', |
| 3327 | 3327 | $post_user_id |
| 3328 | 3328 | ); |
@@ -3333,7 +3333,7 @@ discard block |
||
| 3333 | 3333 | $privateKey = decryptPrivateKey($post_current_pwd, $userData['private_key']); |
| 3334 | 3334 | |
| 3335 | 3335 | // Load superGlobals |
| 3336 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 3336 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 3337 | 3337 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 3338 | 3338 | |
| 3339 | 3339 | if ($superGlobal->get('private_key', 'SESSION', 'user') === $privateKey) { |
@@ -3366,7 +3366,7 @@ discard block |
||
| 3366 | 3366 | echo prepareExchangedData( |
| 3367 | 3367 | array( |
| 3368 | 3368 | 'error' => false, |
| 3369 | - 'message' => langHdl('done'),'', |
|
| 3369 | + 'message' => langHdl('done'), '', |
|
| 3370 | 3370 | ), |
| 3371 | 3371 | 'encode' |
| 3372 | 3372 | ); |
@@ -3428,7 +3428,7 @@ discard block |
||
| 3428 | 3428 | // Get user info |
| 3429 | 3429 | $userData = DB::queryFirstRow( |
| 3430 | 3430 | 'SELECT auth_type, login, private_key, special |
| 3431 | - FROM ' . prefixTable('users') . ' |
|
| 3431 | + FROM ' . prefixTable('users').' |
|
| 3432 | 3432 | WHERE id = %i', |
| 3433 | 3433 | $post_user_id |
| 3434 | 3434 | ); |
@@ -3462,14 +3462,14 @@ discard block |
||
| 3462 | 3462 | // Get one item |
| 3463 | 3463 | $record = DB::queryFirstRow( |
| 3464 | 3464 | 'SELECT id, pw |
| 3465 | - FROM ' . prefixTable('items') . ' |
|
| 3465 | + FROM ' . prefixTable('items').' |
|
| 3466 | 3466 | WHERE perso = 0' |
| 3467 | 3467 | ); |
| 3468 | 3468 | |
| 3469 | 3469 | // Get itemKey from current user |
| 3470 | 3470 | $currentUserKey = DB::queryFirstRow( |
| 3471 | 3471 | 'SELECT share_key, increment_id |
| 3472 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 3472 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 3473 | 3473 | WHERE object_id = %i AND user_id = %i', |
| 3474 | 3474 | $record['id'], |
| 3475 | 3475 | $post_user_id |
@@ -3502,7 +3502,7 @@ discard block |
||
| 3502 | 3502 | ); |
| 3503 | 3503 | |
| 3504 | 3504 | // Load superGlobals |
| 3505 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 3505 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 3506 | 3506 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 3507 | 3507 | $superGlobal->put('private_key', $privateKey, 'SESSION', 'user'); |
| 3508 | 3508 | |