@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | // SQL where clause with folders list |
| 56 | 56 | if (isset($arrQueryStringParams['folders']) === true) { |
| 57 | 57 | // convert the folders to an array |
| 58 | - $arrQueryStringParams['folders'] = explode(',', str_replace( array('[',']') , '' , $arrQueryStringParams['folders'])); |
|
| 58 | + $arrQueryStringParams['folders'] = explode(',', str_replace(array('[', ']'), '', $arrQueryStringParams['folders'])); |
|
| 59 | 59 | |
| 60 | 60 | // ensure to only use the intersection |
| 61 | 61 | $foldersList = implode(',', array_intersect($arrQueryStringParams['folders'], $userData['folders_list'])); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | } else { |
| 217 | 217 | // Gérer le cas où les paramètres ne sont pas un tableau |
| 218 | 218 | $strErrorDesc = 'Data not consistent'; |
| 219 | - $strErrorHeader = 'Expected array, received ' . gettype($arrQueryStringParams); |
|
| 219 | + $strErrorHeader = 'Expected array, received '.gettype($arrQueryStringParams); |
|
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | } else { |
@@ -263,10 +263,10 @@ discard block |
||
| 263 | 263 | // SQL where clause with item id |
| 264 | 264 | if (isset($arrQueryStringParams['id']) === true) { |
| 265 | 265 | // build sql where clause by ID |
| 266 | - $sqlExtra = ' WHERE i.id = '.$arrQueryStringParams['id'] . $sql_constraint; |
|
| 266 | + $sqlExtra = ' WHERE i.id = '.$arrQueryStringParams['id'].$sql_constraint; |
|
| 267 | 267 | } else if (isset($arrQueryStringParams['label']) === true) { |
| 268 | 268 | // build sql where clause by LABEL |
| 269 | - $sqlExtra = ' WHERE i.label '.(isset($arrQueryStringParams['like']) === true && (int) $arrQueryStringParams['like'] === 1 ? ' LIKE '.$arrQueryStringParams['label'] : ' = '.$arrQueryStringParams['label']) . $sql_constraint; |
|
| 269 | + $sqlExtra = ' WHERE i.label '.(isset($arrQueryStringParams['like']) === true && (int) $arrQueryStringParams['like'] === 1 ? ' LIKE '.$arrQueryStringParams['label'] : ' = '.$arrQueryStringParams['label']).$sql_constraint; |
|
| 270 | 270 | } else if (isset($arrQueryStringParams['description']) === true) { |
| 271 | 271 | // build sql where clause by LABEL |
| 272 | 272 | $sqlExtra = ' WHERE i.description '.(isset($arrQueryStringParams['like']) === true && (int) $arrQueryStringParams['like'] === 1 ? ' LIKE '.$arrQueryStringParams['description'] : ' = '.$arrQueryStringParams['description']).$sql_constraint; |
@@ -37,45 +37,45 @@ discard block |
||
| 37 | 37 | * @return boolean |
| 38 | 38 | */ |
| 39 | 39 | function is_jwt_valid($jwt) { |
| 40 | - try { |
|
| 41 | - $decoded = (array) JWT::decode($jwt, new Key(DB_PASSWD, 'HS256')); |
|
| 40 | + try { |
|
| 41 | + $decoded = (array) JWT::decode($jwt, new Key(DB_PASSWD, 'HS256')); |
|
| 42 | 42 | |
| 43 | - // Check if expiration is reached |
|
| 44 | - if ($decoded['exp'] - time() < 0) { |
|
| 45 | - return false; |
|
| 46 | - } |
|
| 43 | + // Check if expiration is reached |
|
| 44 | + if ($decoded['exp'] - time() < 0) { |
|
| 45 | + return false; |
|
| 46 | + } |
|
| 47 | 47 | /* |
| 48 | 48 | $decoded1 = JWT::decode($jwt, new Key(DB_PASSWD, 'HS256'), $headers = new stdClass()); |
| 49 | 49 | print_r($headers); |
| 50 | 50 | */ |
| 51 | 51 | |
| 52 | - return true; |
|
| 53 | - } catch (InvalidArgumentException $e) { |
|
| 54 | - // provided key/key-array is empty or malformed. |
|
| 55 | - return false; |
|
| 56 | - } catch (DomainException $e) { |
|
| 57 | - // provided algorithm is unsupported OR |
|
| 58 | - // provided key is invalid OR |
|
| 59 | - // unknown error thrown in openSSL or libsodium OR |
|
| 60 | - // libsodium is required but not available. |
|
| 61 | - return false; |
|
| 62 | - } catch (SignatureInvalidException $e) { |
|
| 63 | - // provided JWT signature verification failed. |
|
| 64 | - return false; |
|
| 65 | - } catch (BeforeValidException $e) { |
|
| 66 | - // provided JWT is trying to be used before "nbf" claim OR |
|
| 67 | - // provided JWT is trying to be used before "iat" claim. |
|
| 68 | - return false; |
|
| 69 | - } catch (ExpiredException $e) { |
|
| 70 | - // provided JWT is trying to be used after "exp" claim. |
|
| 71 | - return false; |
|
| 72 | - } catch (UnexpectedValueException $e) { |
|
| 73 | - // provided JWT is malformed OR |
|
| 74 | - // provided JWT is missing an algorithm / using an unsupported algorithm OR |
|
| 75 | - // provided JWT algorithm does not match provided key OR |
|
| 76 | - // provided key ID in key/key-array is empty or invalid. |
|
| 77 | - return false; |
|
| 78 | - } |
|
| 52 | + return true; |
|
| 53 | + } catch (InvalidArgumentException $e) { |
|
| 54 | + // provided key/key-array is empty or malformed. |
|
| 55 | + return false; |
|
| 56 | + } catch (DomainException $e) { |
|
| 57 | + // provided algorithm is unsupported OR |
|
| 58 | + // provided key is invalid OR |
|
| 59 | + // unknown error thrown in openSSL or libsodium OR |
|
| 60 | + // libsodium is required but not available. |
|
| 61 | + return false; |
|
| 62 | + } catch (SignatureInvalidException $e) { |
|
| 63 | + // provided JWT signature verification failed. |
|
| 64 | + return false; |
|
| 65 | + } catch (BeforeValidException $e) { |
|
| 66 | + // provided JWT is trying to be used before "nbf" claim OR |
|
| 67 | + // provided JWT is trying to be used before "iat" claim. |
|
| 68 | + return false; |
|
| 69 | + } catch (ExpiredException $e) { |
|
| 70 | + // provided JWT is trying to be used after "exp" claim. |
|
| 71 | + return false; |
|
| 72 | + } catch (UnexpectedValueException $e) { |
|
| 73 | + // provided JWT is malformed OR |
|
| 74 | + // provided JWT is missing an algorithm / using an unsupported algorithm OR |
|
| 75 | + // provided JWT algorithm does not match provided key OR |
|
| 76 | + // provided key ID in key/key-array is empty or invalid. |
|
| 77 | + return false; |
|
| 78 | + } |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | function base64url_encode($data) { |
@@ -84,24 +84,24 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | function get_authorization_header() |
| 86 | 86 | { |
| 87 | - $request = symfonyRequest::createFromGlobals(); |
|
| 88 | - $authorizationHeader = $request->headers->get('Authorization'); |
|
| 89 | - $headers = null; |
|
| 87 | + $request = symfonyRequest::createFromGlobals(); |
|
| 88 | + $authorizationHeader = $request->headers->get('Authorization'); |
|
| 89 | + $headers = null; |
|
| 90 | 90 | |
| 91 | - // Check if the authorization header is not empty |
|
| 92 | - if (!empty($authorizationHeader)) { |
|
| 93 | - $headers = trim($authorizationHeader); |
|
| 94 | - } else if (function_exists('apache_request_headers') === true) { |
|
| 95 | - $requestHeaders = (array) apache_request_headers(); |
|
| 96 | - // Server-side fix for bug in old Android versions (a nice side-effect of this fix means we don't care about capitalization for Authorization) |
|
| 97 | - $requestHeaders = array_combine(array_map('ucwords', array_keys($requestHeaders)), array_values($requestHeaders)); |
|
| 98 | - //print_r($requestHeaders); |
|
| 99 | - if (isset($requestHeaders['Authorization']) === true) { |
|
| 100 | - $headers = trim($requestHeaders['Authorization']); |
|
| 101 | - } |
|
| 102 | - } |
|
| 91 | + // Check if the authorization header is not empty |
|
| 92 | + if (!empty($authorizationHeader)) { |
|
| 93 | + $headers = trim($authorizationHeader); |
|
| 94 | + } else if (function_exists('apache_request_headers') === true) { |
|
| 95 | + $requestHeaders = (array) apache_request_headers(); |
|
| 96 | + // Server-side fix for bug in old Android versions (a nice side-effect of this fix means we don't care about capitalization for Authorization) |
|
| 97 | + $requestHeaders = array_combine(array_map('ucwords', array_keys($requestHeaders)), array_values($requestHeaders)); |
|
| 98 | + //print_r($requestHeaders); |
|
| 99 | + if (isset($requestHeaders['Authorization']) === true) { |
|
| 100 | + $headers = trim($requestHeaders['Authorization']); |
|
| 101 | + } |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - return $headers; |
|
| 104 | + return $headers; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | function get_bearer_token() { |
@@ -118,8 +118,8 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | function get_bearer_data($jwt) { |
| 120 | 120 | // split the jwt |
| 121 | - $tokenParts = explode('.', $jwt); |
|
| 122 | - $payload = base64_decode($tokenParts[1]); |
|
| 121 | + $tokenParts = explode('.', $jwt); |
|
| 122 | + $payload = base64_decode($tokenParts[1]); |
|
| 123 | 123 | |
| 124 | 124 | // HEADER: Get the access token from the header |
| 125 | 125 | if (empty($payload) === false) { |
@@ -39,13 +39,13 @@ discard block |
||
| 39 | 39 | header("Access-Control-Allow-Methods: POST, GET"); |
| 40 | 40 | header("Access-Control-Max-Age: 3600"); |
| 41 | 41 | header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With"); |
| 42 | -require __DIR__ . "/inc/bootstrap.php"; |
|
| 42 | +require __DIR__."/inc/bootstrap.php"; |
|
| 43 | 43 | |
| 44 | 44 | // sanitize url segments |
| 45 | 45 | $base = new BaseController(); |
| 46 | 46 | $uri = $base->getUriSegments(); |
| 47 | 47 | if (!is_array($uri)) { |
| 48 | - $uri = [$uri]; // ensure $uril is table |
|
| 48 | + $uri = [$uri]; // ensure $uril is table |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | // Prepare DB password |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | if ($uri[0] === 'authorize') { |
| 62 | 62 | // Is API enabled in Teampass settings |
| 63 | 63 | if ($apiStatus['error'] === false) { |
| 64 | - require API_ROOT_PATH . "/Controller/Api/AuthController.php"; |
|
| 64 | + require API_ROOT_PATH."/Controller/Api/AuthController.php"; |
|
| 65 | 65 | $objFeedController = new AuthController(); |
| 66 | - $strMethodName = $uri[0] . 'Action'; |
|
| 66 | + $strMethodName = $uri[0].'Action'; |
|
| 67 | 67 | $objFeedController->{$strMethodName}(); |
| 68 | 68 | } else { |
| 69 | 69 | // Error management |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | // action related to USER |
| 91 | 91 | } elseif ($controller === 'user') { |
| 92 | - require API_ROOT_PATH . "/Controller/Api/UserController.php"; |
|
| 92 | + require API_ROOT_PATH."/Controller/Api/UserController.php"; |
|
| 93 | 93 | $objFeedController = new UserController(); |
| 94 | - $strMethodName = (string) $action . 'Action'; |
|
| 94 | + $strMethodName = (string) $action.'Action'; |
|
| 95 | 95 | $objFeedController->{$strMethodName}(); |
| 96 | 96 | |
| 97 | 97 | // action related to ITEM |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | ) { |
| 81 | 81 | // Not allowed page |
| 82 | 82 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 83 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 83 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 84 | 84 | exit; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $openLdapExtra = new OpenLdapExtra(); |
| 155 | 155 | break; |
| 156 | 156 | default: |
| 157 | - throw new Exception("Unsupported LDAP type: " . $SETTINGS['ldap_type']); |
|
| 157 | + throw new Exception("Unsupported LDAP type: ".$SETTINGS['ldap_type']); |
|
| 158 | 158 | } |
| 159 | 159 | } catch (Exception $e) { |
| 160 | 160 | if (defined('LOG_TO_SERVER') && LOG_TO_SERVER === true) { |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | // 2- Get user info from AD |
| 174 | 174 | // We want to isolate attribute ldap_user_attribute or mostly samAccountName |
| 175 | 175 | $userADInfos = $ldapConnection->query() |
| 176 | - ->where((isset($SETTINGS['ldap_user_attribute']) ===true && empty($SETTINGS['ldap_user_attribute']) === false) ? $SETTINGS['ldap_user_attribute'] : 'samaccountname', '=', $post_username) |
|
| 176 | + ->where((isset($SETTINGS['ldap_user_attribute']) === true && empty($SETTINGS['ldap_user_attribute']) === false) ? $SETTINGS['ldap_user_attribute'] : 'samaccountname', '=', $post_username) |
|
| 177 | 177 | ->firstOrFail(); |
| 178 | 178 | |
| 179 | 179 | // Is user enabled? Only ActiveDirectory |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | } catch (\LdapRecord\Query\ObjectNotFoundException $e) { |
| 195 | 195 | $error = $e->getDetailedError(); |
| 196 | 196 | if ($error && defined('LOG_TO_SERVER') && LOG_TO_SERVER === true) { |
| 197 | - error_log('TEAMPASS Error - LDAP - '.$error->getErrorCode()." - ".$error->getErrorMessage(). " - ".$error->getDiagnosticMessage()); |
|
| 197 | + error_log('TEAMPASS Error - LDAP - '.$error->getErrorCode()." - ".$error->getErrorMessage()." - ".$error->getDiagnosticMessage()); |
|
| 198 | 198 | } |
| 199 | 199 | // deepcode ignore ServerLeak: No important data is sent and is encrypted before being sent |
| 200 | 200 | echo prepareExchangedData( |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | // For OpenLDAP and others, we use attribute dn |
| 214 | 214 | $userAuthAttempt = $ldapConnection->auth()->attempt( |
| 215 | 215 | $SETTINGS['ldap_type'] === 'ActiveDirectory' ? |
| 216 | - $userADInfos['userprincipalname'][0] : // refering to https://ldaprecord.com/docs/core/v2/authentication#basic-authentication |
|
| 216 | + $userADInfos['userprincipalname'][0] : // refering to https://ldaprecord.com/docs/core/v2/authentication#basic-authentication |
|
| 217 | 217 | $userADInfos['dn'], |
| 218 | 218 | $post_password |
| 219 | 219 | ); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | } catch (\LdapRecord\Query\ObjectNotFoundException $e) { |
| 233 | 233 | $error = $e->getDetailedError(); |
| 234 | 234 | if ($error && defined('LOG_TO_SERVER') && LOG_TO_SERVER === true) { |
| 235 | - error_log('TEAMPASS Error - LDAP - '.$error->getErrorCode()." - ".$error->getErrorMessage(). " - ".$error->getDiagnosticMessage()); |
|
| 235 | + error_log('TEAMPASS Error - LDAP - '.$error->getErrorCode()." - ".$error->getErrorMessage()." - ".$error->getDiagnosticMessage()); |
|
| 236 | 236 | } |
| 237 | 237 | // deepcode ignore ServerLeak: No important data is sent and is encrypted before being sent |
| 238 | 238 | echo prepareExchangedData( |
@@ -102,11 +102,11 @@ discard block |
||
| 102 | 102 | function provideLog(string $message, array $SETTINGS) |
| 103 | 103 | { |
| 104 | 104 | if (defined('LOG_TO_SERVER') && LOG_TO_SERVER === true) { |
| 105 | - error_log((string) date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time()) . ' - '.$message); |
|
| 105 | + error_log((string) date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time()).' - '.$message); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | -function performVisibleFoldersHtmlUpdate (int $user_id) |
|
| 109 | +function performVisibleFoldersHtmlUpdate(int $user_id) |
|
| 110 | 110 | { |
| 111 | 111 | $html = []; |
| 112 | 112 | |
@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | // get current folders visible for user |
| 118 | 118 | $cache_tree = DB::queryFirstRow( |
| 119 | - 'SELECT increment_id, data FROM ' . prefixTable('cache_tree') . ' WHERE user_id = %i', |
|
| 119 | + 'SELECT increment_id, data FROM '.prefixTable('cache_tree').' WHERE user_id = %i', |
|
| 120 | 120 | $user_id |
| 121 | 121 | ); |
| 122 | - $folders = json_decode($cache_tree['data'], true);//print_r($folders); |
|
| 122 | + $folders = json_decode($cache_tree['data'], true); //print_r($folders); |
|
| 123 | 123 | foreach ($folders as $folder) { |
| 124 | 124 | $idFolder = (int) explode("li_", $folder['id'])[1]; |
| 125 | 125 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | // get folder info |
| 134 | 134 | $folder = DB::queryFirstRow( |
| 135 | - 'SELECT title, parent_id, personal_folder FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', |
|
| 135 | + 'SELECT title, parent_id, personal_folder FROM '.prefixTable('nested_tree').' WHERE id = %i', |
|
| 136 | 136 | $idFolder |
| 137 | 137 | ); |
| 138 | 138 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | function subTaskStatus($taskId) |
| 168 | 168 | { |
| 169 | 169 | $subTasks = DB::query( |
| 170 | - 'SELECT * FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i', |
|
| 170 | + 'SELECT * FROM '.prefixTable('background_subtasks').' WHERE task_id = %i', |
|
| 171 | 171 | $taskId |
| 172 | 172 | ); |
| 173 | 173 | |
@@ -149,8 +149,7 @@ |
||
| 149 | 149 | </div> |
| 150 | 150 | <?php |
| 151 | 151 | } |
| 152 | -} |
|
| 153 | -catch (Exception $e) { |
|
| 152 | +} catch (Exception $e) { |
|
| 154 | 153 | if (defined('LOG_TO_SERVER') && LOG_TO_SERVER === true) { |
| 155 | 154 | error_log('TEAMPASS Error - tasks page - '.$e->getMessage()); |
| 156 | 155 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('tasks') === false) { |
| 65 | 65 | // Not allowed page |
| 66 | 66 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 67 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 67 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 68 | 68 | exit; |
| 69 | 69 | } |
| 70 | 70 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | // Get last cron execution timestamp |
| 127 | 127 | $queryResults = DB::query( |
| 128 | 128 | 'SELECT valeur |
| 129 | - FROM ' . prefixTable('misc') . ' |
|
| 129 | + FROM ' . prefixTable('misc').' |
|
| 130 | 130 | WHERE type = %s AND intitule = %s and valeur >= %d', |
| 131 | 131 | 'admin', |
| 132 | 132 | 'last_cron_exec', |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $task = isset($SETTINGS['users_personal_folder_task']) === true ? explode(";", $SETTINGS['users_personal_folder_task']) : []; |
| 235 | 235 | ?> |
| 236 | 236 | <input type='text' disabled class='form-control form-control-sm' id='users_personal_folder_task_parameter' value='<?php echo isset($task[0]) === true && empty($task[0]) === false ? $lang->get($task[0])." ".(isset($task[2]) === true ? strtolower($lang->get('day')).' '.$task[2].' ' : '').$lang->get('at')." ".(isset($task[1]) === true ? $task[1] : '') : $lang->get('not_defined') ?>'> |
| 237 | - <input type='hidden' disabled class='form-control form-control-sm' id='users_personal_folder_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : '';?>'> |
|
| 237 | + <input type='hidden' disabled class='form-control form-control-sm' id='users_personal_folder_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : ''; ?>'> |
|
| 238 | 238 | </div> |
| 239 | 239 | <div class='col-2'> |
| 240 | 240 | <button class="btn btn-primary task-define" data-task="users_personal_folder_task"> |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $task = isset($SETTINGS['clean_orphan_objects_task']) === true ? explode(";", $SETTINGS['clean_orphan_objects_task']) : []; |
| 257 | 257 | ?> |
| 258 | 258 | <input type='text' disabled class='form-control form-control-sm' id='clean_orphan_objects_task_parameter' value='<?php echo isset($task[0]) === true && empty($task[0]) === false ? $lang->get($task[0])." ".(isset($task[2]) === true ? strtolower($lang->get('day')).' '.$task[2].' ' : '').$lang->get('at')." ".(isset($task[1]) === true ? $task[1] : '') : $lang->get('not_defined') ?>'> |
| 259 | - <input type='hidden' disabled class='form-control form-control-sm' id='clean_orphan_objects_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : '';?>'> |
|
| 259 | + <input type='hidden' disabled class='form-control form-control-sm' id='clean_orphan_objects_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : ''; ?>'> |
|
| 260 | 260 | </div> |
| 261 | 261 | <div class='col-2'> |
| 262 | 262 | <button class="btn btn-primary task-define" data-task="clean_orphan_objects_task"> |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $task = isset($SETTINGS['purge_temporary_files_task']) === true ? explode(";", $SETTINGS['purge_temporary_files_task']) : []; |
| 279 | 279 | ?> |
| 280 | 280 | <input type='text' disabled class='form-control form-control-sm' id='purge_temporary_files_task_parameter' value='<?php echo isset($task[0]) === true && empty($task[0]) === false ? $lang->get($task[0])." ".(isset($task[2]) === true ? strtolower($lang->get('day')).' '.$task[2].' ' : '').$lang->get('at')." ".(isset($task[1]) === true ? $task[1] : '') : $lang->get('not_defined') ?>'> |
| 281 | - <input type='hidden' disabled class='form-control form-control-sm' id='purge_temporary_files_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : '';?>'> |
|
| 281 | + <input type='hidden' disabled class='form-control form-control-sm' id='purge_temporary_files_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : ''; ?>'> |
|
| 282 | 282 | </div> |
| 283 | 283 | <div class='col-2'> |
| 284 | 284 | <button class="btn btn-primary task-define" data-task="purge_temporary_files_task"> |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | $task = isset($SETTINGS['reload_cache_table_task']) === true ? explode(";", $SETTINGS['reload_cache_table_task']) : []; |
| 301 | 301 | ?> |
| 302 | 302 | <input type='text' disabled class='form-control form-control-sm' id='reload_cache_table_task_parameter' value='<?php echo isset($task[0]) === true && empty($task[0]) === false ? $lang->get($task[0])." ".(isset($task[2]) === true ? strtolower($lang->get('day')).' '.$task[2].' ' : '').$lang->get('at')." ".(isset($task[1]) === true ? $task[1] : '') : $lang->get('not_defined') ?>'> |
| 303 | - <input type='hidden' disabled class='form-control form-control-sm' id='reload_cache_table_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : '';?>'> |
|
| 303 | + <input type='hidden' disabled class='form-control form-control-sm' id='reload_cache_table_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : ''; ?>'> |
|
| 304 | 304 | </div> |
| 305 | 305 | <div class='col-2'> |
| 306 | 306 | <button class="btn btn-primary task-define" data-task="reload_cache_table_task"> |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | <h5><?php echo $lang->get('day_of_month'); ?></h5> |
| 518 | 518 | <select class='form-control form-control-sm no-save' id='task-define-modal-parameter-monthly-value' style="width:100%;"> |
| 519 | 519 | <?php |
| 520 | - for ($i=1; $i<=31; $i++) { |
|
| 520 | + for ($i = 1; $i <= 31; $i++) { |
|
| 521 | 521 | echo '<option value="'.$i.'">'.$lang->get('day').' '.$i.'</option>'; |
| 522 | 522 | } |
| 523 | 523 | ?> |
@@ -222,8 +222,7 @@ |
||
| 222 | 222 | </div> |
| 223 | 223 | <?php |
| 224 | 224 | } |
| 225 | -} |
|
| 226 | -catch (Exception $e) { |
|
| 225 | +} catch (Exception $e) { |
|
| 227 | 226 | if (defined('LOG_TO_SERVER') && LOG_TO_SERVER === true) { |
| 228 | 227 | error_log('TEAMPASS Error - admin page - '.$e->getMessage()); |
| 229 | 228 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('admin') === false) { |
| 69 | 69 | // Not allowed page |
| 70 | 70 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 71 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 71 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 72 | 72 | exit; |
| 73 | 73 | } |
| 74 | 74 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | // Get last cron execution timestamp |
| 200 | 200 | DB::query( |
| 201 | 201 | 'SELECT valeur |
| 202 | - FROM ' . prefixTable('misc') . ' |
|
| 202 | + FROM ' . prefixTable('misc').' |
|
| 203 | 203 | WHERE type = %s AND intitule = %s and valeur >= %d', |
| 204 | 204 | 'admin', |
| 205 | 205 | 'last_cron_exec', |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | <div class="card-body"> |
| 271 | 271 | <?php |
| 272 | 272 | // Display information about server |
| 273 | - $dbSize = DB::queryFirstRow("SELECT ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS 'size' FROM information_schema.TABLES WHERE table_schema = '" . DB_NAME . "'"); |
|
| 273 | + $dbSize = DB::queryFirstRow("SELECT ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS 'size' FROM information_schema.TABLES WHERE table_schema = '".DB_NAME."'"); |
|
| 274 | 274 | |
| 275 | 275 | // Get OS |
| 276 | 276 | $uname = php_uname('s'); |
@@ -326,17 +326,17 @@ discard block |
||
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | echo |
| 329 | - '<p>' . $os. |
|
| 329 | + '<p>'.$os. |
|
| 330 | 330 | '<br><span class="ml-4"></span>'. |
| 331 | 331 | '</p>'. |
| 332 | 332 | $internetAccess. |
| 333 | - '<p><i class="fa-brands fa-php mr-2"></i>PHP version: ' . phpversion(). |
|
| 333 | + '<p><i class="fa-brands fa-php mr-2"></i>PHP version: '.phpversion(). |
|
| 334 | 334 | '<br><span class="ml-4">Memory limit: '.(ini_get('memory_limit')).'</span>'. |
| 335 | 335 | '<br><span class="ml-4">Memory usage: '.formatSizeUnits(memory_get_usage()).'</span>'. |
| 336 | 336 | '<br><span class="ml-4">Maximum time execution: '.ini_get('max_execution_time').'</span>'. |
| 337 | 337 | '<br><span class="ml-4">Maximum file size upload: '.ini_get('upload_max_filesize').'</span>'. |
| 338 | 338 | '</p>'. |
| 339 | - '<p><i class="fa-solid fa-server mr-2"></i>Server version: ' . DB::serverVersion(). |
|
| 339 | + '<p><i class="fa-solid fa-server mr-2"></i>Server version: '.DB::serverVersion(). |
|
| 340 | 340 | '<br><span class="ml-4">Database size: '.($dbSize['size']).'MB</span>'. |
| 341 | 341 | '</p>'; |
| 342 | 342 | |
@@ -344,11 +344,11 @@ discard block |
||
| 344 | 344 | $serverTime = localtime(time(), true); |
| 345 | 345 | echo '<div class="row">'. |
| 346 | 346 | '<div class="col-6"><i class="fa-solid fa-clock mr-2"></i>Server time:</div>'. |
| 347 | - '<div class="col-6"><span class="badge badge-info">' . |
|
| 348 | - str_pad(strval($serverTime['tm_hour']), 2, "0", STR_PAD_LEFT) . ':' . |
|
| 349 | - str_pad(strval($serverTime['tm_min']), 2, "0", STR_PAD_LEFT) . ':' . |
|
| 350 | - str_pad(strval($serverTime['tm_sec']), 2, "0", STR_PAD_LEFT) . |
|
| 351 | - '</span></div>' . |
|
| 347 | + '<div class="col-6"><span class="badge badge-info">'. |
|
| 348 | + str_pad(strval($serverTime['tm_hour']), 2, "0", STR_PAD_LEFT).':'. |
|
| 349 | + str_pad(strval($serverTime['tm_min']), 2, "0", STR_PAD_LEFT).':'. |
|
| 350 | + str_pad(strval($serverTime['tm_sec']), 2, "0", STR_PAD_LEFT). |
|
| 351 | + '</span></div>'. |
|
| 352 | 352 | '</div>'. |
| 353 | 353 | '<div class="row">'. |
| 354 | 354 | '<div class="col-6"><span class="ml-4">Timezone:</span></div>'. |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | use TeampassClasses\OAuth2Controller\OAuth2Controller; |
| 3 | 3 | use TeampassClasses\SessionManager\SessionManager; |
| 4 | 4 | |
| 5 | -require_once __DIR__. '/../includes/config/include.php'; |
|
| 5 | +require_once __DIR__.'/../includes/config/include.php'; |
|
| 6 | 6 | require_once __DIR__.'/../sources/main.functions.php'; |
| 7 | 7 | |
| 8 | 8 | // init |
@@ -830,7 +830,7 @@ |
||
| 830 | 830 | 'encode' |
| 831 | 831 | ); |
| 832 | 832 | |
| 833 | - /* |
|
| 833 | + /* |
|
| 834 | 834 | * Generate BUG report |
| 835 | 835 | */ |
| 836 | 836 | case 'generate_bug_report'://action_system |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | ) { |
| 82 | 82 | // Not allowed page |
| 83 | 83 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 84 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 84 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 85 | 85 | exit; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | |
| 270 | 270 | // Get current user hash |
| 271 | 271 | $userHash = DB::queryFirstRow( |
| 272 | - "SELECT pw FROM " . prefixtable('users') . " WHERE id = %d;", |
|
| 272 | + "SELECT pw FROM ".prefixtable('users')." WHERE id = %d;", |
|
| 273 | 273 | $session->get('user-id') |
| 274 | 274 | )['pw']; |
| 275 | 275 | |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | * @param string $post_key |
| 325 | 325 | * @return string |
| 326 | 326 | */ |
| 327 | -function userHandler(string $post_type, array|null|string $dataReceived, array $SETTINGS, string $post_key): string |
|
| 327 | +function userHandler(string $post_type, array | null | string $dataReceived, array $SETTINGS, string $post_key): string |
|
| 328 | 328 | { |
| 329 | 329 | $session = SessionManager::getSession(); |
| 330 | 330 | |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | if (isset($dataReceived['user_id'])) { |
| 360 | 360 | // Get info about user to modify |
| 361 | 361 | $targetUserInfos = DB::queryFirstRow( |
| 362 | - 'SELECT admin, gestionnaire, can_manage_all_users, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 362 | + 'SELECT admin, gestionnaire, can_manage_all_users, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 363 | 363 | WHERE id = %i', |
| 364 | 364 | $dataReceived['user_id'] |
| 365 | 365 | ); |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | case 'mail_me'://action_mail |
| 509 | 509 | // Get info about user to send email |
| 510 | 510 | $data_user = DB::queryFirstRow( |
| 511 | - 'SELECT admin, gestionnaire, can_manage_all_users, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 511 | + 'SELECT admin, gestionnaire, can_manage_all_users, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 512 | 512 | WHERE email = %s', |
| 513 | 513 | filter_var($dataReceived['receipt'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) |
| 514 | 514 | ); |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | if (isset($dataReceived['user_id'])) { |
| 622 | 622 | // Get info about user to modify |
| 623 | 623 | $targetUserInfos = DB::queryFirstRow( |
| 624 | - 'SELECT admin, gestionnaire, can_manage_all_users, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 624 | + 'SELECT admin, gestionnaire, can_manage_all_users, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 625 | 625 | WHERE id = %i', |
| 626 | 626 | $dataReceived['user_id'] |
| 627 | 627 | ); |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | |
| 701 | 701 | // Get current user hash |
| 702 | 702 | $userHash = DB::queryFirstRow( |
| 703 | - "SELECT pw FROM " . prefixtable('users') . " WHERE id = %d;", |
|
| 703 | + "SELECT pw FROM ".prefixtable('users')." WHERE id = %d;", |
|
| 704 | 704 | $session->get('user-id') |
| 705 | 705 | )['pw']; |
| 706 | 706 | |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | |
| 739 | 739 | // Get current user hash |
| 740 | 740 | $userHash = DB::queryFirstRow( |
| 741 | - "SELECT pw FROM " . prefixtable('users') . " WHERE id = %d;", |
|
| 741 | + "SELECT pw FROM ".prefixtable('users')." WHERE id = %d;", |
|
| 742 | 742 | $session->get('user-id') |
| 743 | 743 | )['pw']; |
| 744 | 744 | |
@@ -782,7 +782,7 @@ discard block |
||
| 782 | 782 | |
| 783 | 783 | // Get current user hash |
| 784 | 784 | $userHash = DB::queryFirstRow( |
| 785 | - "SELECT pw FROM " . prefixtable('users') . " WHERE id = %i;", |
|
| 785 | + "SELECT pw FROM ".prefixtable('users')." WHERE id = %i;", |
|
| 786 | 786 | $session->get('user-id') |
| 787 | 787 | )['pw']; |
| 788 | 788 | |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | * @param array $SETTINGS |
| 827 | 827 | * @return string |
| 828 | 828 | */ |
| 829 | -function systemHandler(string $post_type, array|null|string $dataReceived, array $SETTINGS): string |
|
| 829 | +function systemHandler(string $post_type, array | null | string $dataReceived, array $SETTINGS): string |
|
| 830 | 830 | { |
| 831 | 831 | $session = SessionManager::getSession(); |
| 832 | 832 | switch ($post_type) { |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | ) |
| 928 | 928 | ); |
| 929 | 929 | |
| 930 | - return '[{"token" : "' . $token . '"}]'; |
|
| 930 | + return '[{"token" : "'.$token.'"}]'; |
|
| 931 | 931 | |
| 932 | 932 | /* |
| 933 | 933 | * Default case |
@@ -943,7 +943,7 @@ discard block |
||
| 943 | 943 | } |
| 944 | 944 | |
| 945 | 945 | |
| 946 | -function utilsHandler(string $post_type, array|null|string $dataReceived, array $SETTINGS): string |
|
| 946 | +function utilsHandler(string $post_type, array | null | string $dataReceived, array $SETTINGS): string |
|
| 947 | 947 | { |
| 948 | 948 | switch ($post_type) { |
| 949 | 949 | /* |
@@ -1012,7 +1012,7 @@ discard block |
||
| 1012 | 1012 | array( |
| 1013 | 1013 | 'error' => false, |
| 1014 | 1014 | 'timestamp' => $session->get('user-session_duration'), |
| 1015 | - 'max_time_to_add' => intdiv((($maximum_session_expiration_time*60) - ((int) $session->get('user-session_duration') - time())), 60), |
|
| 1015 | + 'max_time_to_add' => intdiv((($maximum_session_expiration_time * 60) - ((int) $session->get('user-session_duration') - time())), 60), |
|
| 1016 | 1016 | 'max_session_duration' => $maximum_session_expiration_time, |
| 1017 | 1017 | ), |
| 1018 | 1018 | 'encode' |
@@ -1064,7 +1064,7 @@ discard block |
||
| 1064 | 1064 | // get number of items |
| 1065 | 1065 | DB::queryFirstRow( |
| 1066 | 1066 | 'SELECT increment_id |
| 1067 | - FROM ' . prefixTable('sharekeys_items') . |
|
| 1067 | + FROM ' . prefixTable('sharekeys_items'). |
|
| 1068 | 1068 | ' WHERE user_id = %i', |
| 1069 | 1069 | $userId |
| 1070 | 1070 | ); |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | // check if expected security level is reached |
| 1120 | 1120 | $dataUser = DB::queryFirstRow( |
| 1121 | 1121 | 'SELECT * |
| 1122 | - FROM ' . prefixTable('users') . ' WHERE id = %i', |
|
| 1122 | + FROM ' . prefixTable('users').' WHERE id = %i', |
|
| 1123 | 1123 | $post_user_id |
| 1124 | 1124 | ); |
| 1125 | 1125 | |
@@ -1140,8 +1140,8 @@ discard block |
||
| 1140 | 1140 | if (empty($dataUser['fonction_id']) === false) { |
| 1141 | 1141 | $data = DB::queryFirstRow( |
| 1142 | 1142 | 'SELECT complexity |
| 1143 | - FROM ' . prefixTable('roles_title') . ' |
|
| 1144 | - WHERE id IN (' . $dataUser['fonction_id'] . ') |
|
| 1143 | + FROM ' . prefixTable('roles_title').' |
|
| 1144 | + WHERE id IN (' . $dataUser['fonction_id'].') |
|
| 1145 | 1145 | ORDER BY complexity DESC' |
| 1146 | 1146 | ); |
| 1147 | 1147 | } else { |
@@ -1154,8 +1154,8 @@ discard block |
||
| 1154 | 1154 | return prepareExchangedData( |
| 1155 | 1155 | array( |
| 1156 | 1156 | 'error' => true, |
| 1157 | - 'message' => '<div style="margin:10px 0 10px 15px;">' . $lang->get('complexity_level_not_reached') . '.<br>' . |
|
| 1158 | - $lang->get('expected_complexity_level') . ': <b>' . TP_PW_COMPLEXITY[$data['complexity']][1] . '</b></div>', |
|
| 1157 | + 'message' => '<div style="margin:10px 0 10px 15px;">'.$lang->get('complexity_level_not_reached').'.<br>'. |
|
| 1158 | + $lang->get('expected_complexity_level').': <b>'.TP_PW_COMPLEXITY[$data['complexity']][1].'</b></div>', |
|
| 1159 | 1159 | ), |
| 1160 | 1160 | 'encode' |
| 1161 | 1161 | ); |
@@ -1259,14 +1259,14 @@ discard block |
||
| 1259 | 1259 | // Get data about user |
| 1260 | 1260 | $dataUser = DB::queryFirstRow( |
| 1261 | 1261 | 'SELECT id, email, pw |
| 1262 | - FROM ' . prefixTable('users') . ' |
|
| 1262 | + FROM ' . prefixTable('users').' |
|
| 1263 | 1263 | WHERE login = %s', |
| 1264 | 1264 | $post_login |
| 1265 | 1265 | ); |
| 1266 | 1266 | } else { |
| 1267 | 1267 | $dataUser = DB::queryFirstRow( |
| 1268 | 1268 | 'SELECT id, login, email, pw |
| 1269 | - FROM ' . prefixTable('users') . ' |
|
| 1269 | + FROM ' . prefixTable('users').' |
|
| 1270 | 1270 | WHERE id = %i', |
| 1271 | 1271 | $post_id |
| 1272 | 1272 | ); |
@@ -1320,7 +1320,7 @@ discard block |
||
| 1320 | 1320 | // Check if token already used |
| 1321 | 1321 | $dataToken = DB::queryFirstRow( |
| 1322 | 1322 | 'SELECT end_timestamp, reason |
| 1323 | - FROM ' . prefixTable('tokens') . ' |
|
| 1323 | + FROM ' . prefixTable('tokens').' |
|
| 1324 | 1324 | WHERE token = %s AND user_id = %i', |
| 1325 | 1325 | $post_token, |
| 1326 | 1326 | $dataUser['id'] |
@@ -1331,11 +1331,11 @@ discard block |
||
| 1331 | 1331 | return prepareExchangedData( |
| 1332 | 1332 | array( |
| 1333 | 1333 | 'error' => true, |
| 1334 | - 'message' => 'TOKEN already used',//$lang->get('no_email_set'), |
|
| 1334 | + 'message' => 'TOKEN already used', //$lang->get('no_email_set'), |
|
| 1335 | 1335 | ), |
| 1336 | 1336 | 'encode' |
| 1337 | 1337 | ); |
| 1338 | - } elseif(DB::count() === 0) { |
|
| 1338 | + } elseif (DB::count() === 0) { |
|
| 1339 | 1339 | // Store token for this action |
| 1340 | 1340 | DB::insert( |
| 1341 | 1341 | prefixTable('tokens'), |
@@ -1397,7 +1397,7 @@ discard block |
||
| 1397 | 1397 | 'email' => $dataUser['email'], |
| 1398 | 1398 | 'email_result' => str_replace( |
| 1399 | 1399 | '#email#', |
| 1400 | - '<b>' . obfuscateEmail($dataUser['email']) . '</b>', |
|
| 1400 | + '<b>'.obfuscateEmail($dataUser['email']).'</b>', |
|
| 1401 | 1401 | addslashes($lang->get('admin_email_result_ok')) |
| 1402 | 1402 | ), |
| 1403 | 1403 | ), |
@@ -1413,7 +1413,7 @@ discard block |
||
| 1413 | 1413 | 'email' => $dataUser['email'], |
| 1414 | 1414 | 'email_result' => str_replace( |
| 1415 | 1415 | '#email#', |
| 1416 | - '<b>' . obfuscateEmail($dataUser['email']) . '</b>', |
|
| 1416 | + '<b>'.obfuscateEmail($dataUser['email']).'</b>', |
|
| 1417 | 1417 | addslashes($lang->get('admin_email_result_ok')) |
| 1418 | 1418 | ), |
| 1419 | 1419 | ), |
@@ -1430,7 +1430,7 @@ discard block |
||
| 1430 | 1430 | |
| 1431 | 1431 | if (isKeyExistingAndEqual('enable_send_email_on_user_login', 1, $SETTINGS) === true) { |
| 1432 | 1432 | $row = DB::queryFirstRow( |
| 1433 | - 'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', |
|
| 1433 | + 'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', |
|
| 1434 | 1434 | 'cron', |
| 1435 | 1435 | 'sending_emails' |
| 1436 | 1436 | ); |
@@ -1438,7 +1438,7 @@ discard block |
||
| 1438 | 1438 | if ((int) (time() - $row['valeur']) >= 300 || (int) $row['valeur'] === 0) { |
| 1439 | 1439 | $rows = DB::query( |
| 1440 | 1440 | 'SELECT * |
| 1441 | - FROM ' . prefixTable('emails') . |
|
| 1441 | + FROM ' . prefixTable('emails'). |
|
| 1442 | 1442 | ' WHERE status != %s', |
| 1443 | 1443 | 'sent' |
| 1444 | 1444 | ); |
@@ -1490,8 +1490,8 @@ discard block |
||
| 1490 | 1490 | $arr_html = array(); |
| 1491 | 1491 | $rows = DB::query( |
| 1492 | 1492 | '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 |
| 1493 | - FROM ' . prefixTable('log_items') . ' AS l |
|
| 1494 | - RIGHT JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id) |
|
| 1493 | + FROM ' . prefixTable('log_items').' AS l |
|
| 1494 | + RIGHT JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id) |
|
| 1495 | 1495 | WHERE l.action = %s AND l.id_user = %i |
| 1496 | 1496 | ORDER BY l.date DESC |
| 1497 | 1497 | LIMIT 0, 100', |
@@ -1523,7 +1523,7 @@ discard block |
||
| 1523 | 1523 | if (isKeyExistingAndEqual('enable_suggestion', 1, $SETTINGS) === true |
| 1524 | 1524 | && ((int) $session->get('user-admin') === 1 || (int) $session->get('user-manager') === 1) |
| 1525 | 1525 | ) { |
| 1526 | - DB::query('SELECT * FROM ' . prefixTable('suggestion')); |
|
| 1526 | + DB::query('SELECT * FROM '.prefixTable('suggestion')); |
|
| 1527 | 1527 | $nb_suggestions_waiting = DB::count(); |
| 1528 | 1528 | } |
| 1529 | 1529 | |
@@ -1558,13 +1558,13 @@ discard block |
||
| 1558 | 1558 | if ($data === 'stat_languages') { |
| 1559 | 1559 | $tmp = ''; |
| 1560 | 1560 | foreach ($stats_data[$data] as $key => $value) { |
| 1561 | - $tmp .= $tmp === '' ? $key . '-' . $value : ',' . $key . '-' . $value; |
|
| 1561 | + $tmp .= $tmp === '' ? $key.'-'.$value : ','.$key.'-'.$value; |
|
| 1562 | 1562 | } |
| 1563 | 1563 | $statsToSend[$data] = $tmp; |
| 1564 | 1564 | } elseif ($data === 'stat_country') { |
| 1565 | 1565 | $tmp = ''; |
| 1566 | 1566 | foreach ($stats_data[$data] as $key => $value) { |
| 1567 | - $tmp .= $tmp === '' ? $key . '-' . $value : ',' . $key . '-' . $value; |
|
| 1567 | + $tmp .= $tmp === '' ? $key.'-'.$value : ','.$key.'-'.$value; |
|
| 1568 | 1568 | } |
| 1569 | 1569 | $statsToSend[$data] = $tmp; |
| 1570 | 1570 | } else { |
@@ -1651,7 +1651,7 @@ discard block |
||
| 1651 | 1651 | $url_found = $value; |
| 1652 | 1652 | if (empty($url_found) === false) { |
| 1653 | 1653 | $tmp = parse_url($url_found); |
| 1654 | - $anonym_url = $tmp['scheme'] . '://<anonym_url>' . (isset($tmp['path']) === true ? $tmp['path'] : ''); |
|
| 1654 | + $anonym_url = $tmp['scheme'].'://<anonym_url>'.(isset($tmp['path']) === true ? $tmp['path'] : ''); |
|
| 1655 | 1655 | $value = $anonym_url; |
| 1656 | 1656 | } else { |
| 1657 | 1657 | $value = ''; |
@@ -1681,7 +1681,7 @@ discard block |
||
| 1681 | 1681 | $teampass_errors = ''; |
| 1682 | 1682 | $rows = DB::query( |
| 1683 | 1683 | 'SELECT label, date AS error_date |
| 1684 | - FROM ' . prefixTable('log_system') . " |
|
| 1684 | + FROM ' . prefixTable('log_system')." |
|
| 1685 | 1685 | WHERE `type` LIKE 'error' |
| 1686 | 1686 | ORDER BY `date` DESC |
| 1687 | 1687 | LIMIT 0, 10" |
@@ -1689,9 +1689,9 @@ discard block |
||
| 1689 | 1689 | if (DB::count() > 0) { |
| 1690 | 1690 | foreach ($rows as $record) { |
| 1691 | 1691 | if (empty($teampass_errors) === true) { |
| 1692 | - $teampass_errors = ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['error_date']) . ' - ' . $record['label']; |
|
| 1692 | + $teampass_errors = ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['error_date']).' - '.$record['label']; |
|
| 1693 | 1693 | } else { |
| 1694 | - $teampass_errors .= ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['error_date']) . ' - ' . $record['label']; |
|
| 1694 | + $teampass_errors .= ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['error_date']).' - '.$record['label']; |
|
| 1695 | 1695 | } |
| 1696 | 1696 | } |
| 1697 | 1697 | } |
@@ -1703,7 +1703,7 @@ discard block |
||
| 1703 | 1703 | |
| 1704 | 1704 | // Now prepare text |
| 1705 | 1705 | $txt = '### Page on which it happened |
| 1706 | -' . $data['current_page'] . ' |
|
| 1706 | +' . $data['current_page'].' |
|
| 1707 | 1707 | |
| 1708 | 1708 | ### Steps to reproduce |
| 1709 | 1709 | 1. |
@@ -1718,39 +1718,39 @@ discard block |
||
| 1718 | 1718 | Tell us what happens instead |
| 1719 | 1719 | |
| 1720 | 1720 | ### Server configuration |
| 1721 | -**Operating system**: ' . php_uname() . ' |
|
| 1721 | +**Operating system**: ' . php_uname().' |
|
| 1722 | 1722 | |
| 1723 | -**Web server:** ' . $_SERVER['SERVER_SOFTWARE'] . ' |
|
| 1723 | +**Web server:** ' . $_SERVER['SERVER_SOFTWARE'].' |
|
| 1724 | 1724 | |
| 1725 | -**Database:** ' . ($link === false ? $lang->get('undefined') : mysqli_get_server_info($link)) . ' |
|
| 1725 | +**Database:** ' . ($link === false ? $lang->get('undefined') : mysqli_get_server_info($link)).' |
|
| 1726 | 1726 | |
| 1727 | -**PHP version:** ' . PHP_VERSION . ' |
|
| 1727 | +**PHP version:** ' . PHP_VERSION.' |
|
| 1728 | 1728 | |
| 1729 | -**Teampass version:** ' . TP_VERSION . '.' . TP_VERSION_MINOR . ' |
|
| 1729 | +**Teampass version:** ' . TP_VERSION.'.'.TP_VERSION_MINOR.' |
|
| 1730 | 1730 | |
| 1731 | 1731 | **Teampass configuration variables:** |
| 1732 | 1732 | ``` |
| 1733 | -' . $list_of_options . ' |
|
| 1733 | +' . $list_of_options.' |
|
| 1734 | 1734 | ``` |
| 1735 | 1735 | |
| 1736 | 1736 | **Updated from an older Teampass or fresh install:** |
| 1737 | 1737 | |
| 1738 | 1738 | ### Client configuration |
| 1739 | 1739 | |
| 1740 | -**Browser:** ' . $data['browser_name'] . ' - ' . $data['browser_version'] . ' |
|
| 1740 | +**Browser:** ' . $data['browser_name'].' - '.$data['browser_version'].' |
|
| 1741 | 1741 | |
| 1742 | -**Operating system:** ' . $data['os'] . ' - ' . $data['os_archi'] . 'bits |
|
| 1742 | +**Operating system:** ' . $data['os'].' - '.$data['os_archi'].'bits |
|
| 1743 | 1743 | |
| 1744 | 1744 | ### Logs |
| 1745 | 1745 | |
| 1746 | 1746 | #### Web server error log |
| 1747 | 1747 | ``` |
| 1748 | -' . $err['message'] . ' - ' . $err['file'] . ' (' . $err['line'] . ') |
|
| 1748 | +' . $err['message'].' - '.$err['file'].' ('.$err['line'].') |
|
| 1749 | 1749 | ``` |
| 1750 | 1750 | |
| 1751 | 1751 | #### Teampass 10 last system errors |
| 1752 | 1752 | ``` |
| 1753 | -' . $teampass_errors . ' |
|
| 1753 | +' . $teampass_errors.' |
|
| 1754 | 1754 | ``` |
| 1755 | 1755 | |
| 1756 | 1756 | #### Log from the web-browser developer console (CTRL + SHIFT + i) |
@@ -1790,7 +1790,7 @@ discard block |
||
| 1790 | 1790 | // Check if user exists |
| 1791 | 1791 | $userInfo = DB::queryFirstRow( |
| 1792 | 1792 | 'SELECT public_key, private_key, pw, auth_type |
| 1793 | - FROM ' . prefixTable('users') . ' |
|
| 1793 | + FROM ' . prefixTable('users').' |
|
| 1794 | 1794 | WHERE id = %i', |
| 1795 | 1795 | $post_user_id |
| 1796 | 1796 | ); |
@@ -1799,9 +1799,9 @@ discard block |
||
| 1799 | 1799 | // Get one item |
| 1800 | 1800 | $currentUserKey = DB::queryFirstRow( |
| 1801 | 1801 | 'SELECT object_id, share_key, increment_id |
| 1802 | - FROM ' . prefixTable('sharekeys_items') . ' AS si |
|
| 1803 | - INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = si.object_id) |
|
| 1804 | - INNER JOIN ' . prefixTable('nested_tree') . ' AS nt ON (i.id_tree = nt.id) |
|
| 1802 | + FROM ' . prefixTable('sharekeys_items').' AS si |
|
| 1803 | + INNER JOIN ' . prefixTable('items').' AS i ON (i.id = si.object_id) |
|
| 1804 | + INNER JOIN ' . prefixTable('nested_tree').' AS nt ON (i.id_tree = nt.id) |
|
| 1805 | 1805 | WHERE user_id = %i AND nt.personal_folder = %i', |
| 1806 | 1806 | $post_user_id, |
| 1807 | 1807 | 0 |
@@ -1895,7 +1895,7 @@ discard block |
||
| 1895 | 1895 | // Get user info |
| 1896 | 1896 | $userData = DB::queryFirstRow( |
| 1897 | 1897 | 'SELECT private_key |
| 1898 | - FROM ' . prefixTable('users') . ' |
|
| 1898 | + FROM ' . prefixTable('users').' |
|
| 1899 | 1899 | WHERE id = %i', |
| 1900 | 1900 | $post_user_id |
| 1901 | 1901 | ); |
@@ -1976,7 +1976,7 @@ discard block |
||
| 1976 | 1976 | // Get user info |
| 1977 | 1977 | $userData = DB::queryFirstRow( |
| 1978 | 1978 | 'SELECT email, auth_type, login |
| 1979 | - FROM ' . prefixTable('users') . ' |
|
| 1979 | + FROM ' . prefixTable('users').' |
|
| 1980 | 1980 | WHERE id = %i', |
| 1981 | 1981 | $post_user_id |
| 1982 | 1982 | ); |
@@ -2074,7 +2074,7 @@ discard block |
||
| 2074 | 2074 | // Get user info |
| 2075 | 2075 | $userData = DB::queryFirstRow( |
| 2076 | 2076 | 'SELECT email, auth_type, login |
| 2077 | - FROM ' . prefixTable('users') . ' |
|
| 2077 | + FROM ' . prefixTable('users').' |
|
| 2078 | 2078 | WHERE id = %i', |
| 2079 | 2079 | $post_user_id |
| 2080 | 2080 | ); |
@@ -2140,7 +2140,7 @@ discard block |
||
| 2140 | 2140 | // Check if user exists |
| 2141 | 2141 | DB::queryFirstRow( |
| 2142 | 2142 | 'SELECT * |
| 2143 | - FROM ' . prefixTable('users') . ' |
|
| 2143 | + FROM ' . prefixTable('users').' |
|
| 2144 | 2144 | WHERE id = %i', |
| 2145 | 2145 | $post_user_id |
| 2146 | 2146 | ); |
@@ -2210,7 +2210,7 @@ discard block |
||
| 2210 | 2210 | // Check if user exists |
| 2211 | 2211 | $userInfo = DB::queryFirstRow( |
| 2212 | 2212 | 'SELECT public_key |
| 2213 | - FROM ' . prefixTable('users') . ' |
|
| 2213 | + FROM ' . prefixTable('users').' |
|
| 2214 | 2214 | WHERE id = %i', |
| 2215 | 2215 | $post_user_id |
| 2216 | 2216 | ); |
@@ -2358,15 +2358,15 @@ discard block |
||
| 2358 | 2358 | // Loop on items |
| 2359 | 2359 | $rows = DB::query( |
| 2360 | 2360 | 'SELECT id, pw |
| 2361 | - FROM ' . prefixTable('items') . ' |
|
| 2361 | + FROM ' . prefixTable('items').' |
|
| 2362 | 2362 | WHERE perso = 0 |
| 2363 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 2363 | + LIMIT ' . $post_start.', '.$post_length |
|
| 2364 | 2364 | ); |
| 2365 | 2365 | foreach ($rows as $record) { |
| 2366 | 2366 | // Get itemKey from current user |
| 2367 | 2367 | $currentUserKey = DB::queryFirstRow( |
| 2368 | 2368 | 'SELECT share_key, increment_id |
| 2369 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2369 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2370 | 2370 | WHERE object_id = %i AND user_id = %i', |
| 2371 | 2371 | $record['id'], |
| 2372 | 2372 | $session->get('user-id') |
@@ -2398,7 +2398,7 @@ discard block |
||
| 2398 | 2398 | if ((int) $post_user_id !== (int) $session->get('user-id')) { |
| 2399 | 2399 | $currentUserKey = DB::queryFirstRow( |
| 2400 | 2400 | 'SELECT increment_id |
| 2401 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2401 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2402 | 2402 | WHERE object_id = %i AND user_id = %i', |
| 2403 | 2403 | $record['id'], |
| 2404 | 2404 | $post_user_id |
@@ -2431,7 +2431,7 @@ discard block |
||
| 2431 | 2431 | // SHould we change step? |
| 2432 | 2432 | DB::query( |
| 2433 | 2433 | 'SELECT * |
| 2434 | - FROM ' . prefixTable('items') . ' |
|
| 2434 | + FROM ' . prefixTable('items').' |
|
| 2435 | 2435 | WHERE perso = 0' |
| 2436 | 2436 | ); |
| 2437 | 2437 | |
@@ -2456,15 +2456,15 @@ discard block |
||
| 2456 | 2456 | // Loop on logs |
| 2457 | 2457 | $rows = DB::query( |
| 2458 | 2458 | 'SELECT increment_id |
| 2459 | - FROM ' . prefixTable('log_items') . ' |
|
| 2459 | + FROM ' . prefixTable('log_items').' |
|
| 2460 | 2460 | WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes" |
| 2461 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 2461 | + LIMIT ' . $post_start.', '.$post_length |
|
| 2462 | 2462 | ); |
| 2463 | 2463 | foreach ($rows as $record) { |
| 2464 | 2464 | // Get itemKey from current user |
| 2465 | 2465 | $currentUserKey = DB::queryFirstRow( |
| 2466 | 2466 | 'SELECT share_key |
| 2467 | - FROM ' . prefixTable('sharekeys_logs') . ' |
|
| 2467 | + FROM ' . prefixTable('sharekeys_logs').' |
|
| 2468 | 2468 | WHERE object_id = %i AND user_id = %i', |
| 2469 | 2469 | $record['increment_id'], |
| 2470 | 2470 | $session->get('user-id') |
@@ -2496,7 +2496,7 @@ discard block |
||
| 2496 | 2496 | if ((int) $post_user_id !== (int) $session->get('user-id')) { |
| 2497 | 2497 | $currentUserKey = DB::queryFirstRow( |
| 2498 | 2498 | 'SELECT increment_id |
| 2499 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2499 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2500 | 2500 | WHERE object_id = %i AND user_id = %i', |
| 2501 | 2501 | $record['id'], |
| 2502 | 2502 | $post_user_id |
@@ -2518,7 +2518,7 @@ discard block |
||
| 2518 | 2518 | // SHould we change step? |
| 2519 | 2519 | DB::query( |
| 2520 | 2520 | 'SELECT increment_id |
| 2521 | - FROM ' . prefixTable('log_items') . ' |
|
| 2521 | + FROM ' . prefixTable('log_items').' |
|
| 2522 | 2522 | WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"' |
| 2523 | 2523 | ); |
| 2524 | 2524 | |
@@ -2543,15 +2543,15 @@ discard block |
||
| 2543 | 2543 | // Loop on fields |
| 2544 | 2544 | $rows = DB::query( |
| 2545 | 2545 | 'SELECT id |
| 2546 | - FROM ' . prefixTable('categories_items') . ' |
|
| 2546 | + FROM ' . prefixTable('categories_items').' |
|
| 2547 | 2547 | WHERE encryption_type = "teampass_aes" |
| 2548 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 2548 | + LIMIT ' . $post_start.', '.$post_length |
|
| 2549 | 2549 | ); |
| 2550 | 2550 | foreach ($rows as $record) { |
| 2551 | 2551 | // Get itemKey from current user |
| 2552 | 2552 | $currentUserKey = DB::queryFirstRow( |
| 2553 | 2553 | 'SELECT share_key |
| 2554 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 2554 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 2555 | 2555 | WHERE object_id = %i AND user_id = %i', |
| 2556 | 2556 | $record['id'], |
| 2557 | 2557 | $session->get('user-id') |
@@ -2583,7 +2583,7 @@ discard block |
||
| 2583 | 2583 | if ((int) $post_user_id !== (int) $session->get('user-id')) { |
| 2584 | 2584 | $currentUserKey = DB::queryFirstRow( |
| 2585 | 2585 | 'SELECT increment_id |
| 2586 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2586 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2587 | 2587 | WHERE object_id = %i AND user_id = %i', |
| 2588 | 2588 | $record['id'], |
| 2589 | 2589 | $post_user_id |
@@ -2605,7 +2605,7 @@ discard block |
||
| 2605 | 2605 | // SHould we change step? |
| 2606 | 2606 | DB::query( |
| 2607 | 2607 | 'SELECT * |
| 2608 | - FROM ' . prefixTable('categories_items') . ' |
|
| 2608 | + FROM ' . prefixTable('categories_items').' |
|
| 2609 | 2609 | WHERE encryption_type = "teampass_aes"' |
| 2610 | 2610 | ); |
| 2611 | 2611 | |
@@ -2630,14 +2630,14 @@ discard block |
||
| 2630 | 2630 | // Loop on suggestions |
| 2631 | 2631 | $rows = DB::query( |
| 2632 | 2632 | 'SELECT id |
| 2633 | - FROM ' . prefixTable('suggestion') . ' |
|
| 2634 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 2633 | + FROM ' . prefixTable('suggestion').' |
|
| 2634 | + LIMIT ' . $post_start.', '.$post_length |
|
| 2635 | 2635 | ); |
| 2636 | 2636 | foreach ($rows as $record) { |
| 2637 | 2637 | // Get itemKey from current user |
| 2638 | 2638 | $currentUserKey = DB::queryFirstRow( |
| 2639 | 2639 | 'SELECT share_key |
| 2640 | - FROM ' . prefixTable('sharekeys_suggestions') . ' |
|
| 2640 | + FROM ' . prefixTable('sharekeys_suggestions').' |
|
| 2641 | 2641 | WHERE object_id = %i AND user_id = %i', |
| 2642 | 2642 | $record['id'], |
| 2643 | 2643 | $session->get('user-id') |
@@ -2669,7 +2669,7 @@ discard block |
||
| 2669 | 2669 | if ((int) $post_user_id !== (int) $session->get('user-id')) { |
| 2670 | 2670 | $currentUserKey = DB::queryFirstRow( |
| 2671 | 2671 | 'SELECT increment_id |
| 2672 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2672 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2673 | 2673 | WHERE object_id = %i AND user_id = %i', |
| 2674 | 2674 | $record['id'], |
| 2675 | 2675 | $post_user_id |
@@ -2715,15 +2715,15 @@ discard block |
||
| 2715 | 2715 | // Loop on files |
| 2716 | 2716 | $rows = DB::query( |
| 2717 | 2717 | 'SELECT id |
| 2718 | - FROM ' . prefixTable('files') . ' |
|
| 2719 | - WHERE status = "' . TP_ENCRYPTION_NAME . '" |
|
| 2720 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 2718 | + FROM ' . prefixTable('files').' |
|
| 2719 | + WHERE status = "' . TP_ENCRYPTION_NAME.'" |
|
| 2720 | + LIMIT ' . $post_start.', '.$post_length |
|
| 2721 | 2721 | ); //aes_encryption |
| 2722 | 2722 | foreach ($rows as $record) { |
| 2723 | 2723 | // Get itemKey from current user |
| 2724 | 2724 | $currentUserKey = DB::queryFirstRow( |
| 2725 | 2725 | 'SELECT share_key |
| 2726 | - FROM ' . prefixTable('sharekeys_files') . ' |
|
| 2726 | + FROM ' . prefixTable('sharekeys_files').' |
|
| 2727 | 2727 | WHERE object_id = %i AND user_id = %i', |
| 2728 | 2728 | $record['id'], |
| 2729 | 2729 | $session->get('user-id') |
@@ -2755,7 +2755,7 @@ discard block |
||
| 2755 | 2755 | if ((int) $post_user_id !== (int) $session->get('user-id')) { |
| 2756 | 2756 | $currentUserKey = DB::queryFirstRow( |
| 2757 | 2757 | 'SELECT increment_id |
| 2758 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2758 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2759 | 2759 | WHERE object_id = %i AND user_id = %i', |
| 2760 | 2760 | $record['id'], |
| 2761 | 2761 | $post_user_id |
@@ -2777,8 +2777,8 @@ discard block |
||
| 2777 | 2777 | // SHould we change step? |
| 2778 | 2778 | DB::query( |
| 2779 | 2779 | 'SELECT * |
| 2780 | - FROM ' . prefixTable('files') . ' |
|
| 2781 | - WHERE status = "' . TP_ENCRYPTION_NAME . '"' |
|
| 2780 | + FROM ' . prefixTable('files').' |
|
| 2781 | + WHERE status = "' . TP_ENCRYPTION_NAME.'"' |
|
| 2782 | 2782 | ); |
| 2783 | 2783 | |
| 2784 | 2784 | $next_start = (int) $post_start + (int) $post_length; |
@@ -2811,9 +2811,9 @@ discard block |
||
| 2811 | 2811 | if (count($session->get('user-personal_folders')) > 0) { |
| 2812 | 2812 | $rows = DB::query( |
| 2813 | 2813 | 'SELECT id, pw |
| 2814 | - FROM ' . prefixTable('items') . ' |
|
| 2814 | + FROM ' . prefixTable('items').' |
|
| 2815 | 2815 | WHERE perso = 1 AND id_tree IN %ls AND encryption_type = %s |
| 2816 | - LIMIT ' . $post_start . ', ' . $post_length, |
|
| 2816 | + LIMIT ' . $post_start.', '.$post_length, |
|
| 2817 | 2817 | $session->get('user-personal_folders'), |
| 2818 | 2818 | "defuse" |
| 2819 | 2819 | ); |
@@ -2821,7 +2821,7 @@ discard block |
||
| 2821 | 2821 | // Get itemKey from current user |
| 2822 | 2822 | $currentUserKey = DB::queryFirstRow( |
| 2823 | 2823 | 'SELECT share_key, increment_id |
| 2824 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2824 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2825 | 2825 | WHERE object_id = %i AND user_id = %i', |
| 2826 | 2826 | $record['id'], |
| 2827 | 2827 | $session->get('user-id') |
@@ -2848,7 +2848,7 @@ discard block |
||
| 2848 | 2848 | if ((int) $post_user_id !== (int) $session->get('user-id')) { |
| 2849 | 2849 | $currentUserKey = DB::queryFirstRow( |
| 2850 | 2850 | 'SELECT increment_id |
| 2851 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2851 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2852 | 2852 | WHERE object_id = %i AND user_id = %i', |
| 2853 | 2853 | $record['id'], |
| 2854 | 2854 | $post_user_id |
@@ -2871,7 +2871,7 @@ discard block |
||
| 2871 | 2871 | // SHould we change step? |
| 2872 | 2872 | DB::query( |
| 2873 | 2873 | 'SELECT * |
| 2874 | - FROM ' . prefixTable('items') . ' |
|
| 2874 | + FROM ' . prefixTable('items').' |
|
| 2875 | 2875 | WHERE perso = 0' |
| 2876 | 2876 | ); |
| 2877 | 2877 | |
@@ -2899,7 +2899,7 @@ discard block |
||
| 2899 | 2899 | // Check if user exists |
| 2900 | 2900 | $userInfo = DB::queryFirstRow( |
| 2901 | 2901 | 'SELECT public_key, encrypted_psk |
| 2902 | - FROM ' . prefixTable('users') . ' |
|
| 2902 | + FROM ' . prefixTable('users').' |
|
| 2903 | 2903 | WHERE id = %i', |
| 2904 | 2904 | $post_user_id |
| 2905 | 2905 | ); |
@@ -2925,7 +2925,7 @@ discard block |
||
| 2925 | 2925 | if ($post_counterItemsToTreat === -1) { |
| 2926 | 2926 | DB::query( |
| 2927 | 2927 | 'SELECT id |
| 2928 | - FROM ' . prefixTable('items') . ' |
|
| 2928 | + FROM ' . prefixTable('items').' |
|
| 2929 | 2929 | WHERE perso = 1 AND id_tree IN %ls AND encryption_type != %s', |
| 2930 | 2930 | $session->get('user-personal_folders'), |
| 2931 | 2931 | 'teampass_aes' |
@@ -2938,7 +2938,7 @@ discard block |
||
| 2938 | 2938 | // Loop on persoanl items |
| 2939 | 2939 | $rows = DB::query( |
| 2940 | 2940 | 'SELECT id, pw |
| 2941 | - FROM ' . prefixTable('items') . ' |
|
| 2941 | + FROM ' . prefixTable('items').' |
|
| 2942 | 2942 | WHERE perso = 1 AND id_tree IN %ls AND encryption_type != %s |
| 2943 | 2943 | LIMIT ' . $post_length, |
| 2944 | 2944 | $session->get('user-personal_folders'), |
@@ -2982,7 +2982,7 @@ discard block |
||
| 2982 | 2982 | // Loop on files |
| 2983 | 2983 | $rows = DB::query( |
| 2984 | 2984 | 'SELECT id, file |
| 2985 | - FROM ' . prefixTable('files') . ' |
|
| 2985 | + FROM ' . prefixTable('files').' |
|
| 2986 | 2986 | WHERE status != %s |
| 2987 | 2987 | AND id_item = %i', |
| 2988 | 2988 | TP_ENCRYPTION_NAME, |
@@ -2993,13 +2993,13 @@ discard block |
||
| 2993 | 2993 | // Now decrypt the file |
| 2994 | 2994 | prepareFileWithDefuse( |
| 2995 | 2995 | 'decrypt', |
| 2996 | - $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'], |
|
| 2997 | - $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'] . '.delete', |
|
| 2996 | + $SETTINGS['path_to_upload_folder'].'/'.$record2['file'], |
|
| 2997 | + $SETTINGS['path_to_upload_folder'].'/'.$record2['file'].'.delete', |
|
| 2998 | 2998 | $post_user_psk |
| 2999 | 2999 | ); |
| 3000 | 3000 | |
| 3001 | 3001 | // Encrypt the file |
| 3002 | - $encryptedFile = encryptFile($record2['file'] . '.delete', $SETTINGS['path_to_upload_folder']); |
|
| 3002 | + $encryptedFile = encryptFile($record2['file'].'.delete', $SETTINGS['path_to_upload_folder']); |
|
| 3003 | 3003 | |
| 3004 | 3004 | DB::update( |
| 3005 | 3005 | prefixTable('files'), |
@@ -3022,7 +3022,7 @@ discard block |
||
| 3022 | 3022 | ); |
| 3023 | 3023 | |
| 3024 | 3024 | // Unlink original file |
| 3025 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record2['file']); |
|
| 3025 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record2['file']); |
|
| 3026 | 3026 | } |
| 3027 | 3027 | } |
| 3028 | 3028 | |
@@ -3030,7 +3030,7 @@ discard block |
||
| 3030 | 3030 | $next_start = (int) $post_start + (int) $post_length; |
| 3031 | 3031 | DB::query( |
| 3032 | 3032 | 'SELECT id |
| 3033 | - FROM ' . prefixTable('items') . ' |
|
| 3033 | + FROM ' . prefixTable('items').' |
|
| 3034 | 3034 | WHERE perso = 1 AND id_tree IN %ls AND encryption_type != %s', |
| 3035 | 3035 | $session->get('user-personal_folders'), |
| 3036 | 3036 | 'teampass_aes' |
@@ -3100,7 +3100,7 @@ discard block |
||
| 3100 | 3100 | // Get user info |
| 3101 | 3101 | $userData = DB::queryFirstRow( |
| 3102 | 3102 | 'SELECT special, auth_type, is_ready_for_usage, ongoing_process_id, otp_provided, keys_recovery_time |
| 3103 | - FROM ' . prefixTable('users') . ' |
|
| 3103 | + FROM ' . prefixTable('users').' |
|
| 3104 | 3104 | WHERE id = %i', |
| 3105 | 3105 | $post_user_id |
| 3106 | 3106 | ); |
@@ -3147,7 +3147,7 @@ discard block |
||
| 3147 | 3147 | // Get user info |
| 3148 | 3148 | $userData = DB::queryFirstRow( |
| 3149 | 3149 | 'SELECT auth_type, login, private_key |
| 3150 | - FROM ' . prefixTable('users') . ' |
|
| 3150 | + FROM ' . prefixTable('users').' |
|
| 3151 | 3151 | WHERE id = %i', |
| 3152 | 3152 | $post_user_id |
| 3153 | 3153 | ); |
@@ -3197,7 +3197,7 @@ discard block |
||
| 3197 | 3197 | return prepareExchangedData( |
| 3198 | 3198 | array( |
| 3199 | 3199 | 'error' => false, |
| 3200 | - 'message' => $lang->get('done'),'', |
|
| 3200 | + 'message' => $lang->get('done'), '', |
|
| 3201 | 3201 | ), |
| 3202 | 3202 | 'encode' |
| 3203 | 3203 | ); |
@@ -3245,7 +3245,7 @@ discard block |
||
| 3245 | 3245 | // Get user info |
| 3246 | 3246 | $userData = DB::queryFirstRow( |
| 3247 | 3247 | 'SELECT auth_type, login, private_key, special |
| 3248 | - FROM ' . prefixTable('users') . ' |
|
| 3248 | + FROM ' . prefixTable('users').' |
|
| 3249 | 3249 | WHERE id = %i', |
| 3250 | 3250 | $post_user_id |
| 3251 | 3251 | ); |
@@ -3279,7 +3279,7 @@ discard block |
||
| 3279 | 3279 | return prepareExchangedData( |
| 3280 | 3280 | array( |
| 3281 | 3281 | 'error' => false, |
| 3282 | - 'message' => $lang->get('done'),'', |
|
| 3282 | + 'message' => $lang->get('done'), '', |
|
| 3283 | 3283 | ), |
| 3284 | 3284 | 'encode' |
| 3285 | 3285 | ); |
@@ -3301,8 +3301,8 @@ discard block |
||
| 3301 | 3301 | // Get one itemKey from current user |
| 3302 | 3302 | $currentUserKey = DB::queryFirstRow( |
| 3303 | 3303 | 'SELECT ski.share_key, ski.increment_id, l.id_user |
| 3304 | - FROM ' . prefixTable('sharekeys_items') . ' AS ski |
|
| 3305 | - INNER JOIN ' . prefixTable('log_items') . ' AS l ON ski.object_id = l.id_item |
|
| 3304 | + FROM ' . prefixTable('sharekeys_items').' AS ski |
|
| 3305 | + INNER JOIN ' . prefixTable('log_items').' AS l ON ski.object_id = l.id_item |
|
| 3306 | 3306 | WHERE ski.user_id = %i |
| 3307 | 3307 | ORDER BY RAND() |
| 3308 | 3308 | LIMIT 1', |
@@ -3392,7 +3392,7 @@ discard block |
||
| 3392 | 3392 | $session->get('user-id') |
| 3393 | 3393 | ); |
| 3394 | 3394 | // Return data |
| 3395 | - return '[{"new_value":"' . $session->get('user-session_duration') . '"}]'; |
|
| 3395 | + return '[{"new_value":"'.$session->get('user-session_duration').'"}]'; |
|
| 3396 | 3396 | } |
| 3397 | 3397 | |
| 3398 | 3398 | return '[{"new_value":"expired"}]'; |