@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | ) { |
68 | 68 | // Not allowed page |
69 | 69 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
70 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
70 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
71 | 71 | exit; |
72 | 72 | } |
73 | 73 | |
@@ -541,8 +541,7 @@ discard block |
||
541 | 541 | $post_masked = filter_var($dataReceived['masked'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
542 | 542 | $post_encrypted = filter_var($dataReceived['encrypted'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
543 | 543 | $post_roles = filter_var_array($dataReceived['roles'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
544 | - $post_fieldId = isset($dataReceived['fieldId']) === false ? '' : |
|
545 | - filter_var($dataReceived['fieldId'], FILTER_SANITIZE_NUMBER_INT); |
|
544 | + $post_fieldId = isset($dataReceived['fieldId']) === false ? '' : filter_var($dataReceived['fieldId'], FILTER_SANITIZE_NUMBER_INT); |
|
546 | 545 | |
547 | 546 | if (empty($post_fieldId) === false) { |
548 | 547 | // UPDATE FIELD |
@@ -558,7 +557,7 @@ discard block |
||
558 | 557 | 'encrypted_data' => $post_encrypted, |
559 | 558 | 'is_mandatory' => $post_mandatory, |
560 | 559 | 'masked' => $post_masked, |
561 | - 'role_visibility' => is_null($post_roles) === true || count($post_roles) ===0 ? '' : implode(',', $post_roles), |
|
560 | + 'role_visibility' => is_null($post_roles) === true || count($post_roles) === 0 ? '' : implode(',', $post_roles), |
|
562 | 561 | 'order' => calculateOrder($post_fieldId, $post_order), |
563 | 562 | ), |
564 | 563 | 'id = %i', |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | { |
46 | 46 | $superGlobal = new SuperGlobal(); |
47 | 47 | $uri = parse_url($superGlobal->get('REQUEST_URI', 'SERVER'), PHP_URL_PATH); |
48 | - $uri = explode( '/', $uri ); |
|
48 | + $uri = explode('/', $uri); |
|
49 | 49 | return $this->sanitizeUrl(array_slice($uri, ((int) array_search('index.php', $uri) + 1))); |
50 | 50 | } |
51 | 51 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | { |
72 | 72 | $filters = []; |
73 | 73 | $array_size = count($array); |
74 | - for ($i=0; $i < $array_size; $i++) { |
|
74 | + for ($i = 0; $i < $array_size; $i++) { |
|
75 | 75 | array_push($filters, 'trim|escape'); |
76 | 76 | } |
77 | 77 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @param mixed $data |
90 | 90 | * @param string $httpHeader |
91 | 91 | */ |
92 | - protected function sendOutput($data, $httpHeaders=array()): void |
|
92 | + protected function sendOutput($data, $httpHeaders = array()): void |
|
93 | 93 | { |
94 | 94 | header_remove('Set-Cookie'); |
95 | 95 |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | |
27 | 27 | Use TeampassClasses\SuperGlobal\SuperGlobal; |
28 | 28 | |
29 | -define("API_ROOT_PATH", __DIR__ . "/.."); |
|
29 | +define("API_ROOT_PATH", __DIR__."/.."); |
|
30 | 30 | |
31 | 31 | // include main configuration file |
32 | -require API_ROOT_PATH . '/../sources/main.functions.php'; |
|
32 | +require API_ROOT_PATH.'/../sources/main.functions.php'; |
|
33 | 33 | |
34 | 34 | // init |
35 | 35 | loadClasses('DB'); |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | $superGlobal = new SuperGlobal(); |
39 | 39 | |
40 | 40 | // include the base controller file |
41 | -require API_ROOT_PATH . "/Controller/Api/BaseController.php"; |
|
41 | +require API_ROOT_PATH."/Controller/Api/BaseController.php"; |
|
42 | 42 | |
43 | 43 | // include the use model file |
44 | -require API_ROOT_PATH . "/Model/UserModel.php"; |
|
45 | -require API_ROOT_PATH . "/Model/ItemModel.php"; |
|
46 | -require API_ROOT_PATH . "/Model/FolderModel.php"; |
|
44 | +require API_ROOT_PATH."/Model/UserModel.php"; |
|
45 | +require API_ROOT_PATH."/Model/ItemModel.php"; |
|
46 | +require API_ROOT_PATH."/Model/FolderModel.php"; |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Launch expected action for ITEM |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | */ |
55 | 55 | function itemAction(array $actions, array $userData) |
56 | 56 | { |
57 | - require API_ROOT_PATH . "/Controller/Api/ItemController.php"; |
|
57 | + require API_ROOT_PATH."/Controller/Api/ItemController.php"; |
|
58 | 58 | |
59 | 59 | $objFeedController = new ItemController(); |
60 | - $strMethodName = $actions[0] . 'Action'; |
|
60 | + $strMethodName = $actions[0].'Action'; |
|
61 | 61 | $objFeedController->{$strMethodName}($userData); |
62 | 62 | } |
63 | 63 | |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | */ |
71 | 71 | function folderAction(array $actions, array $userData) |
72 | 72 | { |
73 | - require API_ROOT_PATH . "/Controller/Api/FolderController.php"; |
|
73 | + require API_ROOT_PATH."/Controller/Api/FolderController.php"; |
|
74 | 74 | |
75 | 75 | $objFeedController = new FolderController(); |
76 | - $strMethodName = $actions[0] . 'Action'; |
|
76 | + $strMethodName = $actions[0].'Action'; |
|
77 | 77 | $objFeedController->{$strMethodName}($userData); |
78 | 78 | } |
79 | 79 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | function apiIsEnabled(): string |
86 | 86 | { |
87 | - require API_ROOT_PATH . '/../includes/config/tp.config.php'; |
|
87 | + require API_ROOT_PATH.'/../includes/config/tp.config.php'; |
|
88 | 88 | |
89 | 89 | if ((int) $SETTINGS['api'] === 1) { |
90 | 90 | return json_encode( |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | function verifyAuth(): string |
115 | 115 | { |
116 | - include_once API_ROOT_PATH . '/inc/jwt_utils.php'; |
|
116 | + include_once API_ROOT_PATH.'/inc/jwt_utils.php'; |
|
117 | 117 | $bearer_token = get_bearer_token(); |
118 | 118 | |
119 | 119 | if (empty($bearer_token) === false && is_jwt_valid($bearer_token) === true) { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | function getDataFromToken(): string |
145 | 145 | { |
146 | - include_once API_ROOT_PATH . '/inc/jwt_utils.php'; |
|
146 | + include_once API_ROOT_PATH.'/inc/jwt_utils.php'; |
|
147 | 147 | $bearer_token = get_bearer_token(); |
148 | 148 | |
149 | 149 | if (empty($bearer_token) === false) { |
@@ -26,43 +26,43 @@ discard block |
||
26 | 26 | Use TeampassClasses\SuperGlobal\SuperGlobal; |
27 | 27 | |
28 | 28 | function generate_jwt($headers, $payload) { |
29 | - $headers_encoded = base64url_encode(json_encode($headers)); |
|
29 | + $headers_encoded = base64url_encode(json_encode($headers)); |
|
30 | 30 | |
31 | - $payload_encoded = base64url_encode(json_encode($payload)); |
|
31 | + $payload_encoded = base64url_encode(json_encode($payload)); |
|
32 | 32 | |
33 | - $signature = hash_hmac('SHA256', "$headers_encoded.$payload_encoded", DB_PASSWD, true); |
|
34 | - $signature_encoded = base64url_encode($signature); |
|
33 | + $signature = hash_hmac('SHA256', "$headers_encoded.$payload_encoded", DB_PASSWD, true); |
|
34 | + $signature_encoded = base64url_encode($signature); |
|
35 | 35 | |
36 | - $jwt = "$headers_encoded.$payload_encoded.$signature_encoded"; |
|
36 | + $jwt = "$headers_encoded.$payload_encoded.$signature_encoded"; |
|
37 | 37 | |
38 | - return $jwt; |
|
38 | + return $jwt; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | function is_jwt_valid($jwt) { |
42 | - // split the jwt |
|
43 | - $tokenParts = explode('.', $jwt); |
|
44 | - $header = base64_decode($tokenParts[0]); |
|
45 | - $payload = base64_decode($tokenParts[1]); |
|
46 | - $signature_provided = $tokenParts[2]; |
|
42 | + // split the jwt |
|
43 | + $tokenParts = explode('.', $jwt); |
|
44 | + $header = base64_decode($tokenParts[0]); |
|
45 | + $payload = base64_decode($tokenParts[1]); |
|
46 | + $signature_provided = $tokenParts[2]; |
|
47 | 47 | |
48 | - // check the expiration time - note this will cause an error if there is no 'exp' claim in the jwt |
|
49 | - $expiration = json_decode($payload)->exp; |
|
50 | - $is_token_expired = ($expiration - time()) < 0; |
|
48 | + // check the expiration time - note this will cause an error if there is no 'exp' claim in the jwt |
|
49 | + $expiration = json_decode($payload)->exp; |
|
50 | + $is_token_expired = ($expiration - time()) < 0; |
|
51 | 51 | |
52 | - // build a signature based on the header and payload using the secret |
|
53 | - $base64_url_header = base64url_encode($header); |
|
54 | - $base64_url_payload = base64url_encode($payload); |
|
55 | - $signature = hash_hmac('SHA256', $base64_url_header . "." . $base64_url_payload, DB_PASSWD, true); |
|
56 | - $base64_url_signature = base64url_encode($signature); |
|
52 | + // build a signature based on the header and payload using the secret |
|
53 | + $base64_url_header = base64url_encode($header); |
|
54 | + $base64_url_payload = base64url_encode($payload); |
|
55 | + $signature = hash_hmac('SHA256', $base64_url_header . "." . $base64_url_payload, DB_PASSWD, true); |
|
56 | + $base64_url_signature = base64url_encode($signature); |
|
57 | 57 | |
58 | - // verify it matches the signature provided in the jwt |
|
59 | - $is_signature_valid = ($base64_url_signature === $signature_provided); |
|
58 | + // verify it matches the signature provided in the jwt |
|
59 | + $is_signature_valid = ($base64_url_signature === $signature_provided); |
|
60 | 60 | |
61 | - if ($is_token_expired || !$is_signature_valid) { |
|
62 | - return FALSE; |
|
63 | - } else { |
|
64 | - return TRUE; |
|
65 | - } |
|
61 | + if ($is_token_expired || !$is_signature_valid) { |
|
62 | + return FALSE; |
|
63 | + } else { |
|
64 | + return TRUE; |
|
65 | + } |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | function base64url_encode($data) { |
@@ -70,24 +70,24 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | function get_authorization_header(){ |
73 | - $superGlobal = new SuperGlobal(); |
|
74 | - $headers = null; |
|
73 | + $superGlobal = new SuperGlobal(); |
|
74 | + $headers = null; |
|
75 | 75 | |
76 | - if (null !== $superGlobal->get('Authorization', 'SERVER')) { |
|
77 | - $headers = trim($superGlobal->get('Authorization', 'SERVER')); |
|
78 | - } else if (null !== $superGlobal->get('HTTP_AUTHORIZATION', 'SERVER')) { //Nginx or fast CGI |
|
79 | - $headers = trim($superGlobal->get('HTTP_AUTHORIZATION', 'SERVER')); |
|
80 | - } else if (function_exists('apache_request_headers') === true) { |
|
81 | - $requestHeaders = (array) apache_request_headers(); |
|
82 | - // 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) |
|
83 | - $requestHeaders = array_combine(array_map('ucwords', array_keys($requestHeaders)), array_values($requestHeaders)); |
|
84 | - //print_r($requestHeaders); |
|
85 | - if (isset($requestHeaders['Authorization']) === true) { |
|
86 | - $headers = trim($requestHeaders['Authorization']); |
|
87 | - } |
|
88 | - } |
|
76 | + if (null !== $superGlobal->get('Authorization', 'SERVER')) { |
|
77 | + $headers = trim($superGlobal->get('Authorization', 'SERVER')); |
|
78 | + } else if (null !== $superGlobal->get('HTTP_AUTHORIZATION', 'SERVER')) { //Nginx or fast CGI |
|
79 | + $headers = trim($superGlobal->get('HTTP_AUTHORIZATION', 'SERVER')); |
|
80 | + } else if (function_exists('apache_request_headers') === true) { |
|
81 | + $requestHeaders = (array) apache_request_headers(); |
|
82 | + // 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) |
|
83 | + $requestHeaders = array_combine(array_map('ucwords', array_keys($requestHeaders)), array_values($requestHeaders)); |
|
84 | + //print_r($requestHeaders); |
|
85 | + if (isset($requestHeaders['Authorization']) === true) { |
|
86 | + $headers = trim($requestHeaders['Authorization']); |
|
87 | + } |
|
88 | + } |
|
89 | 89 | |
90 | - return $headers; |
|
90 | + return $headers; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | function get_bearer_token() { |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | |
105 | 105 | function get_bearer_data($jwt) { |
106 | 106 | // split the jwt |
107 | - $tokenParts = explode('.', $jwt); |
|
108 | - $payload = base64_decode($tokenParts[1]); |
|
107 | + $tokenParts = explode('.', $jwt); |
|
108 | + $payload = base64_decode($tokenParts[1]); |
|
109 | 109 | |
110 | 110 | // HEADER: Get the access token from the header |
111 | 111 | if (empty($payload) === false) { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | // build a signature based on the header and payload using the secret |
53 | 53 | $base64_url_header = base64url_encode($header); |
54 | 54 | $base64_url_payload = base64url_encode($payload); |
55 | - $signature = hash_hmac('SHA256', $base64_url_header . "." . $base64_url_payload, DB_PASSWD, true); |
|
55 | + $signature = hash_hmac('SHA256', $base64_url_header.".".$base64_url_payload, DB_PASSWD, true); |
|
56 | 56 | $base64_url_signature = base64url_encode($signature); |
57 | 57 | |
58 | 58 | // verify it matches the signature provided in the jwt |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); |
70 | 70 | } |
71 | 71 | |
72 | -function get_authorization_header(){ |
|
72 | +function get_authorization_header() { |
|
73 | 73 | $superGlobal = new SuperGlobal(); |
74 | 74 | $headers = null; |
75 | 75 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | Use TeampassClasses\NestedTree\NestedTree; |
26 | 26 | |
27 | -require_once API_ROOT_PATH . "/Model/Database.php"; |
|
27 | +require_once API_ROOT_PATH."/Model/Database.php"; |
|
28 | 28 | |
29 | 29 | class ItemModel extends Database |
30 | 30 | { |
@@ -46,15 +46,15 @@ discard block |
||
46 | 46 | "SELECT i.id, label, description, i.pw, i.url, i.id_tree, i.login, i.email, i.viewed_no, i.fa_icon, i.inactif, i.perso, t.title as folder_label |
47 | 47 | FROM ".prefixTable('items')." as i |
48 | 48 | LEFT JOIN ".prefixTable('nested_tree')." as t ON (t.id = i.id_tree) ". |
49 | - $sqlExtra . |
|
50 | - " ORDER BY i.id ASC" . |
|
51 | - ($limit > 0 ? " LIMIT ?". ["i", $limit] : '') |
|
49 | + $sqlExtra. |
|
50 | + " ORDER BY i.id ASC". |
|
51 | + ($limit > 0 ? " LIMIT ?".["i", $limit] : '') |
|
52 | 52 | ); |
53 | 53 | $ret = []; |
54 | 54 | foreach ($rows as $row) { |
55 | 55 | $userKey = $this->select( |
56 | 56 | 'SELECT share_key |
57 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
57 | + FROM ' . prefixTable('sharekeys_items').' |
|
58 | 58 | WHERE user_id = '.$userId.' AND object_id = '.$row['id'] |
59 | 59 | ); |
60 | 60 | if (count($userKey) === 0 || empty($row['pw']) === true) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | if (empty($path) === true) { |
89 | 89 | $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
90 | 90 | } else { |
91 | - $path .= '/' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
91 | + $path .= '/'.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | // Update table by deleting ID |
61 | 61 | if (isset($_SESSION['user_id'])) { |
62 | 62 | DB::update( |
63 | - DB_PREFIX . 'users', |
|
63 | + DB_PREFIX.'users', |
|
64 | 64 | [ |
65 | 65 | 'key_tempo' => '', |
66 | 66 | ], |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | // Load functions |
80 | -require_once __DIR__. '/includes/config/include.php'; |
|
80 | +require_once __DIR__.'/includes/config/include.php'; |
|
81 | 81 | require_once __DIR__.'/sources/main.functions.php'; |
82 | 82 | |
83 | 83 | // init |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | // Load Core library |
105 | -require_once $SETTINGS['cpassman_dir'] . '/sources/core.php'; |
|
105 | +require_once $SETTINGS['cpassman_dir'].'/sources/core.php'; |
|
106 | 106 | // Prepare POST variables |
107 | 107 | $post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
108 | 108 | // Prepare superGlobal variables |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | //get default language |
133 | 133 | $dataLanguage = DB::queryFirstRow( |
134 | 134 | 'SELECT m.valeur AS valeur, l.flag AS flag |
135 | - FROM ' . prefixTable('misc') . ' AS m |
|
136 | - INNER JOIN ' . prefixTable('languages') . ' AS l ON (m.valeur = l.name) |
|
135 | + FROM ' . prefixTable('misc').' AS m |
|
136 | + INNER JOIN ' . prefixTable('languages').' AS l ON (m.valeur = l.name) |
|
137 | 137 | WHERE m.type=%s_type AND m.intitule=%s_intitule', |
138 | 138 | [ |
139 | 139 | 'type' => 'admin', |
@@ -171,12 +171,12 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | // Load user languages files |
174 | -if (file_exists($SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php') === true) { |
|
175 | - $_SESSION['teampass']['lang'] = include $SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php'; |
|
174 | +if (file_exists($SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php') === true) { |
|
175 | + $_SESSION['teampass']['lang'] = include $SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php'; |
|
176 | 176 | } else { |
177 | 177 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
178 | 178 | //not allowed page |
179 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
179 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | // Some template adjust |
@@ -242,10 +242,10 @@ discard block |
||
242 | 242 | <!-- Toastr --> |
243 | 243 | <link rel="stylesheet" href="plugins/toastr/toastr.min.css" /> |
244 | 244 | <!-- favicon --> |
245 | - <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon'];?>"/> |
|
245 | + <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon']; ?>"/> |
|
246 | 246 | <!-- Custom style --> |
247 | 247 | <?php |
248 | - if (file_exists(__DIR__ . '/includes/css/custom.css') === true) {?> |
|
248 | + if (file_exists(__DIR__.'/includes/css/custom.css') === true) {?> |
|
249 | 249 | <link rel="stylesheet" href="includes/css/custom.css"> |
250 | 250 | <?php |
251 | 251 | } ?> |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | <div class="dropdown show"> |
316 | 316 | <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown"> |
317 | 317 | <?php |
318 | - echo $session_name . ' ' . $session_lastname; ?> |
|
318 | + echo $session_name.' '.$session_lastname; ?> |
|
319 | 319 | </a> |
320 | 320 | |
321 | 321 | <div class="dropdown-menu dropdown-menu-right"> |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | </a> |
340 | 340 | <?php |
341 | 341 | } ?> |
342 | - <a class="dropdown-item user-menu<?php echo (int) $session_user_admin === 1 ? ' hidden' : '';?>" href="#" data-name="generate-new_keys"> |
|
342 | + <a class="dropdown-item user-menu<?php echo (int) $session_user_admin === 1 ? ' hidden' : ''; ?>" href="#" data-name="generate-new_keys"> |
|
343 | 343 | <i class="fa-solid fa-spray-can-sparkles fa-fw mr-2"></i><?php echo langHdl('generate_new_keys'); ?> |
344 | 344 | </a> |
345 | 345 | <div class="dropdown-divider"></div> |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | <!-- Main Sidebar Container --> |
363 | 363 | <aside class="main-sidebar sidebar-dark-primary elevation-4"> |
364 | 364 | <!-- Brand Logo --> |
365 | - <a href="<?php echo $SETTINGS['cpassman_url'] . '/index.php?page=' . ((int) $session_user_admin === 1 ? 'admin' : 'items'); ?>" class="brand-link"> |
|
365 | + <a href="<?php echo $SETTINGS['cpassman_url'].'/index.php?page='.((int) $session_user_admin === 1 ? 'admin' : 'items'); ?>" class="brand-link"> |
|
366 | 366 | <img src="includes/images/teampass-logo2-home.png" alt="Teampass Logo" class="brand-image"> |
367 | 367 | <span class="brand-text font-weight-light"><?php echo TP_TOOL_NAME; ?></span> |
368 | 368 | </a> |
@@ -380,20 +380,20 @@ discard block |
||
380 | 380 | <a href="#" data-name="items" class="nav-link', $get['page'] === 'items' ? ' active' : '', '"> |
381 | 381 | <i class="nav-icon fa-solid fa-key"></i> |
382 | 382 | <p> |
383 | - ' . langHdl('pw') . ' |
|
383 | + ' . langHdl('pw').' |
|
384 | 384 | </p> |
385 | 385 | </a> |
386 | 386 | </li>'; |
387 | 387 | } |
388 | 388 | |
389 | 389 | // IMPORT menu |
390 | - if (isset($SETTINGS['allow_import']) === true && (int) $SETTINGS['allow_import'] === 1&& $session_user_admin === 0) { |
|
390 | + if (isset($SETTINGS['allow_import']) === true && (int) $SETTINGS['allow_import'] === 1 && $session_user_admin === 0) { |
|
391 | 391 | echo ' |
392 | 392 | <li class="nav-item"> |
393 | 393 | <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '"> |
394 | 394 | <i class="nav-icon fa-solid fa-file-import"></i> |
395 | 395 | <p> |
396 | - ' . langHdl('import') . ' |
|
396 | + ' . langHdl('import').' |
|
397 | 397 | </p> |
398 | 398 | </a> |
399 | 399 | </li>'; |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | <a href="#" data-name="export" class="nav-link', $get['page'] === 'export' ? ' active' : '', '"> |
415 | 415 | <i class="nav-icon fa-solid fa-file-export"></i> |
416 | 416 | <p> |
417 | - ' . langHdl('export') . ' |
|
417 | + ' . langHdl('export').' |
|
418 | 418 | </p> |
419 | 419 | </a> |
420 | 420 | </li>'; |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | <a href="#" data-name="search" class="nav-link', $get['page'] === 'search' ? ' active' : '', '"> |
442 | 442 | <i class="nav-icon fa-solid fa-search"></i> |
443 | 443 | <p> |
444 | - ' . langHdl('find') . ' |
|
444 | + ' . langHdl('find').' |
|
445 | 445 | </p> |
446 | 446 | </a> |
447 | 447 | </li>'; |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | <a href="#" data-name="favourites" class="nav-link', $get['page'] === 'admin' ? ' favourites' : '', '"> |
458 | 458 | <i class="nav-icon fa-solid fa-star"></i> |
459 | 459 | <p> |
460 | - ' . langHdl('favorites') . ' |
|
460 | + ' . langHdl('favorites').' |
|
461 | 461 | </p> |
462 | 462 | </a> |
463 | 463 | </li>'; |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | <a href="#" data-name="suggestion" class="nav-link', $get['page'] === 'suggestion' ? ' active' : '', '"> |
488 | 488 | <i class="nav-icon fa-solid fa-lightbulb"></i> |
489 | 489 | <p> |
490 | - ' . langHdl('suggestion_menu') . ' |
|
490 | + ' . langHdl('suggestion_menu').' |
|
491 | 491 | </p> |
492 | 492 | </a> |
493 | 493 | </li>'; |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | <a href="#" data-name="admin" class="nav-link', $get['page'] === 'admin' ? ' active' : '', '"> |
501 | 501 | <i class="nav-icon fa-solid fa-info"></i> |
502 | 502 | <p> |
503 | - ' . langHdl('admin_main') . ' |
|
503 | + ' . langHdl('admin_main').' |
|
504 | 504 | </p> |
505 | 505 | </a> |
506 | 506 | </li> |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | <a href="#" class="nav-link"> |
509 | 509 | <i class="nav-icon fa-solid fa-wrench"></i> |
510 | 510 | <p> |
511 | - ' . langHdl('admin_settings') . ' |
|
511 | + ' . langHdl('admin_settings').' |
|
512 | 512 | <i class="fa-solid fa-angle-left right"></i> |
513 | 513 | </p> |
514 | 514 | </a> |
@@ -516,55 +516,55 @@ discard block |
||
516 | 516 | <li class="nav-item"> |
517 | 517 | <a href="#" data-name="options" class="nav-link', $get['page'] === 'options' ? ' active' : '', '"> |
518 | 518 | <i class="fa-solid fa-check-double nav-icon"></i> |
519 | - <p>' . langHdl('options') . '</p> |
|
519 | + <p>' . langHdl('options').'</p> |
|
520 | 520 | </a> |
521 | 521 | </li> |
522 | 522 | <li class="nav-item"> |
523 | 523 | <a href="#" data-name="2fa" class="nav-link', $get['page'] === '2fa' ? ' active' : '', '"> |
524 | 524 | <i class="fa-solid fa-qrcode nav-icon"></i> |
525 | - <p>' . langHdl('mfa_short') . '</p> |
|
525 | + <p>' . langHdl('mfa_short').'</p> |
|
526 | 526 | </a> |
527 | 527 | </li> |
528 | 528 | <li class="nav-item"> |
529 | 529 | <a href="#" data-name="api" class="nav-link', $get['page'] === 'api' ? ' active' : '', '"> |
530 | 530 | <i class="fa-solid fa-cubes nav-icon"></i> |
531 | - <p>' . langHdl('api') . '</p> |
|
531 | + <p>' . langHdl('api').'</p> |
|
532 | 532 | </a> |
533 | 533 | </li> |
534 | 534 | <li class="nav-item"> |
535 | 535 | <a href="#" data-name="backups" class="nav-link', $get['page'] === 'backups' ? ' active' : '', '"> |
536 | 536 | <i class="fa-solid fa-database nav-icon"></i> |
537 | - <p>' . langHdl('backups') . '</p> |
|
537 | + <p>' . langHdl('backups').'</p> |
|
538 | 538 | </a> |
539 | 539 | </li> |
540 | 540 | <li class="nav-item"> |
541 | 541 | <a href="#" data-name="emails" class="nav-link', $get['page'] === 'emails' ? ' active' : '', '"> |
542 | 542 | <i class="fa-solid fa-envelope nav-icon"></i> |
543 | - <p>' . langHdl('emails') . '</p> |
|
543 | + <p>' . langHdl('emails').'</p> |
|
544 | 544 | </a> |
545 | 545 | </li> |
546 | 546 | <li class="nav-item"> |
547 | 547 | <a href="#" data-name="fields" class="nav-link', $get['page'] === 'fields' ? ' active' : '', '"> |
548 | 548 | <i class="fa-solid fa-keyboard nav-icon"></i> |
549 | - <p>' . langHdl('fields') . '</p> |
|
549 | + <p>' . langHdl('fields').'</p> |
|
550 | 550 | </a> |
551 | 551 | </li> |
552 | 552 | <li class="nav-item"> |
553 | 553 | <a href="#" data-name="ldap" class="nav-link', $get['page'] === 'ldap' ? ' active' : '', '"> |
554 | 554 | <i class="fa-solid fa-id-card nav-icon"></i> |
555 | - <p>' . langHdl('ldap') . '</p> |
|
555 | + <p>' . langHdl('ldap').'</p> |
|
556 | 556 | </a> |
557 | 557 | </li> |
558 | 558 | <li class="nav-item"> |
559 | 559 | <a href="#" data-name="uploads" class="nav-link', $get['page'] === 'uploads' ? ' active' : '', '"> |
560 | 560 | <i class="fa-solid fa-file-upload nav-icon"></i> |
561 | - <p>' . langHdl('uploads') . '</p> |
|
561 | + <p>' . langHdl('uploads').'</p> |
|
562 | 562 | </a> |
563 | 563 | </li> |
564 | 564 | <li class="nav-item"> |
565 | 565 | <a href="#" data-name="statistics" class="nav-link', $get['page'] === 'statistics' ? ' active' : '', '"> |
566 | 566 | <i class="fa-solid fa-chart-bar nav-icon"></i> |
567 | - <p>' . langHdl('statistics') . '</p> |
|
567 | + <p>' . langHdl('statistics').'</p> |
|
568 | 568 | </a> |
569 | 569 | </li> |
570 | 570 | </ul> |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | <li class="nav-item"> |
576 | 576 | <a href="#" data-name="tasks" class="nav-link', $get['page'] === 'tasks' ? ' active' : '', '"> |
577 | 577 | <i class="fa-solid fa-tasks nav-icon"></i> |
578 | - <p>' . langHdl('tasks') . '</p> |
|
578 | + <p>' . langHdl('tasks').'</p> |
|
579 | 579 | </a> |
580 | 580 | </li>'; |
581 | 581 | } |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | <a href="#" data-name="folders" class="nav-link', $get['page'] === 'folders' ? ' active' : '', '"> |
592 | 592 | <i class="nav-icon fa-solid fa-folder-open"></i> |
593 | 593 | <p> |
594 | - ' . langHdl('folders') . ' |
|
594 | + ' . langHdl('folders').' |
|
595 | 595 | </p> |
596 | 596 | </a> |
597 | 597 | </li> |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | <a href="#" data-name="roles" class="nav-link', $get['page'] === 'roles' ? ' active' : '', '"> |
600 | 600 | <i class="nav-icon fa-solid fa-graduation-cap"></i> |
601 | 601 | <p> |
602 | - ' . langHdl('roles') . ' |
|
602 | + ' . langHdl('roles').' |
|
603 | 603 | </p> |
604 | 604 | </a> |
605 | 605 | </li> |
@@ -607,38 +607,38 @@ discard block |
||
607 | 607 | <a href="#" data-name="users" class="nav-link', $get['page'] === 'users' ? ' active' : '', '"> |
608 | 608 | <i class="nav-icon fa-solid fa-users"></i> |
609 | 609 | <p> |
610 | - ' . langHdl('users') . ' |
|
610 | + ' . langHdl('users').' |
|
611 | 611 | </p> |
612 | 612 | </a> |
613 | 613 | </li> |
614 | 614 | <li class="nav-item has-treeview', $menuUtilities === true ? ' menu-open' : '', '"> |
615 | 615 | <a href="#" class="nav-link"> |
616 | 616 | <i class="nav-icon fa-solid fa-cubes"></i> |
617 | - <p>' . langHdl('admin_views') . '<i class="fa-solid fa-angle-left right"></i></p> |
|
617 | + <p>' . langHdl('admin_views').'<i class="fa-solid fa-angle-left right"></i></p> |
|
618 | 618 | </a> |
619 | 619 | <ul class="nav nav-treeview"> |
620 | 620 | <li class="nav-item"> |
621 | 621 | <a href="#" data-name="utilities.renewal" class="nav-link', $get['page'] === 'utilities.renewal' ? ' active' : '', '"> |
622 | 622 | <i class="far fa-calendar-alt nav-icon"></i> |
623 | - <p>' . langHdl('renewal') . '</p> |
|
623 | + <p>' . langHdl('renewal').'</p> |
|
624 | 624 | </a> |
625 | 625 | </li> |
626 | 626 | <li class="nav-item"> |
627 | 627 | <a href="#" data-name="utilities.deletion" class="nav-link', $get['page'] === 'utilities.deletion' ? ' active' : '', '"> |
628 | 628 | <i class="fa-solid fa-trash-alt nav-icon"></i> |
629 | - <p>' . langHdl('deletion') . '</p> |
|
629 | + <p>' . langHdl('deletion').'</p> |
|
630 | 630 | </a> |
631 | 631 | </li> |
632 | 632 | <li class="nav-item"> |
633 | 633 | <a href="#" data-name="utilities.logs" class="nav-link', $get['page'] === 'utilities.logs' ? ' active' : '', '"> |
634 | 634 | <i class="fa-solid fa-history nav-icon"></i> |
635 | - <p>' . langHdl('logs') . '</p> |
|
635 | + <p>' . langHdl('logs').'</p> |
|
636 | 636 | </a> |
637 | 637 | </li> |
638 | 638 | <li class="nav-item"> |
639 | 639 | <a href="#" data-name="utilities.database" class="nav-link', $get['page'] === 'utilities.database' ? ' active' : '', '"> |
640 | 640 | <i class="fa-solid fa-database nav-icon"></i> |
641 | - <p>' . langHdl('database') . '</p> |
|
641 | + <p>' . langHdl('database').'</p> |
|
642 | 642 | </a> |
643 | 643 | </li> |
644 | 644 | </ul> |
@@ -649,10 +649,10 @@ discard block |
||
649 | 649 | <!-- /.sidebar-menu --> |
650 | 650 | <div class="menu-footer"> |
651 | 651 | <div class="" id="sidebar-footer"> |
652 | - <i class="fa-solid fa-clock-o mr-2 infotip text-info pointer" title="<?php echo langHdl('server_time') . ' ' . |
|
653 | - date($SETTINGS['date_format'], (int) $server['request_time']) . ' - ' . |
|
652 | + <i class="fa-solid fa-clock-o mr-2 infotip text-info pointer" title="<?php echo langHdl('server_time').' '. |
|
653 | + date($SETTINGS['date_format'], (int) $server['request_time']).' - '. |
|
654 | 654 | date($SETTINGS['time_format'], (int) $server['request_time']); ?>"></i> |
655 | - <i class="fa-solid fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online . ' ' . langHdl('users_online'); ?>"></i> |
|
655 | + <i class="fa-solid fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online.' '.langHdl('users_online'); ?>"></i> |
|
656 | 656 | <a href="<?php echo DOCUMENTATION_URL; ?>" target="_blank" class="text-info"><i class="fa-solid fa-book mr-2 infotip" title="<?php echo langHdl('documentation_canal'); ?>"></i></a> |
657 | 657 | <a href="<?php echo HELP_URL; ?>" target="_blank" class="text-info"><i class="fa-solid fa-life-ring mr-2 infotip" title="<?php echo langHdl('admin_help'); ?>"></i></a> |
658 | 658 | <i class="fa-solid fa-bug infotip pointer text-info" title="<?php echo langHdl('bugs_page'); ?>" onclick="generateBugReport()"></i> |
@@ -954,18 +954,18 @@ discard block |
||
954 | 954 | } elseif ($get['page'] === 'items') { |
955 | 955 | // SHow page with Items |
956 | 956 | if ((int) $session_user_admin !== 1) { |
957 | - include $SETTINGS['cpassman_dir'] . '/pages/items.php'; |
|
957 | + include $SETTINGS['cpassman_dir'].'/pages/items.php'; |
|
958 | 958 | } elseif ((int) $session_user_admin === 1) { |
959 | - include $SETTINGS['cpassman_dir'] . '/pages/admin.php'; |
|
959 | + include $SETTINGS['cpassman_dir'].'/pages/admin.php'; |
|
960 | 960 | } else { |
961 | 961 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
962 | 962 | //not allowed page |
963 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
963 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
964 | 964 | } |
965 | 965 | } elseif (in_array($get['page'], array_keys($mngPages)) === true) { |
966 | 966 | // Define if user is allowed to see management pages |
967 | 967 | if ($session_user_admin === 1) { |
968 | - include $SETTINGS['cpassman_dir'] . '/pages/' . $mngPages[$get['page']]; |
|
968 | + include $SETTINGS['cpassman_dir'].'/pages/'.$mngPages[$get['page']]; |
|
969 | 969 | } elseif ($session_user_manager === 1 || $session_user_human_resources === 1) { |
970 | 970 | if ($get['page'] !== 'manage_main' |
971 | 971 | && $get['page'] !== 'manage_settings' |
@@ -974,15 +974,15 @@ discard block |
||
974 | 974 | } else { |
975 | 975 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
976 | 976 | //not allowed page |
977 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
977 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
978 | 978 | } |
979 | 979 | } else { |
980 | 980 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
981 | 981 | //not allowed page |
982 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
982 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
983 | 983 | } |
984 | 984 | } elseif (empty($get['page']) === false) { |
985 | - include $SETTINGS['cpassman_dir'] . '/pages/' . $get['page'] . '.php'; |
|
985 | + include $SETTINGS['cpassman_dir'].'/pages/'.$get['page'].'.php'; |
|
986 | 986 | } else { |
987 | 987 | $_SESSION['error']['code'] = ERR_NOT_EXIST; |
988 | 988 | //page doesn't exist |
@@ -1054,7 +1054,7 @@ discard block |
||
1054 | 1054 | ), |
1055 | 1055 | 'SESSION' |
1056 | 1056 | ); |
1057 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
1057 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
1058 | 1058 | } |
1059 | 1059 | } elseif ((empty($session_user_id) === false |
1060 | 1060 | && $session_user_id !== null) |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | $superGlobal->put('initialUrl', '', 'SESSION'); |
1085 | 1085 | |
1086 | 1086 | // LOGIN form |
1087 | - include $SETTINGS['cpassman_dir'] . '/includes/core/login.php'; |
|
1087 | + include $SETTINGS['cpassman_dir'].'/includes/core/login.php'; |
|
1088 | 1088 | } |
1089 | 1089 | |
1090 | 1090 | ?> |
@@ -1297,61 +1297,61 @@ discard block |
||
1297 | 1297 | isset($_SESSION['CPM']) === true |
1298 | 1298 | && isset($SETTINGS['cpassman_dir']) === true |
1299 | 1299 | ) { |
1300 | - include_once $SETTINGS['cpassman_dir'] . '/includes/core/load.js.php'; |
|
1300 | + include_once $SETTINGS['cpassman_dir'].'/includes/core/load.js.php'; |
|
1301 | 1301 | if ($menuAdmin === true) { |
1302 | - include_once $SETTINGS['cpassman_dir'] . '/pages/admin.js.php'; |
|
1302 | + include_once $SETTINGS['cpassman_dir'].'/pages/admin.js.php'; |
|
1303 | 1303 | if ($get['page'] === '2fa') { |
1304 | - include_once $SETTINGS['cpassman_dir'] . '/pages/2fa.js.php'; |
|
1304 | + include_once $SETTINGS['cpassman_dir'].'/pages/2fa.js.php'; |
|
1305 | 1305 | } elseif ($get['page'] === 'api') { |
1306 | - include_once $SETTINGS['cpassman_dir'] . '/pages/api.js.php'; |
|
1306 | + include_once $SETTINGS['cpassman_dir'].'/pages/api.js.php'; |
|
1307 | 1307 | } elseif ($get['page'] === 'backups') { |
1308 | - include_once $SETTINGS['cpassman_dir'] . '/pages/backups.js.php'; |
|
1308 | + include_once $SETTINGS['cpassman_dir'].'/pages/backups.js.php'; |
|
1309 | 1309 | } elseif ($get['page'] === 'emails') { |
1310 | - include_once $SETTINGS['cpassman_dir'] . '/pages/emails.js.php'; |
|
1310 | + include_once $SETTINGS['cpassman_dir'].'/pages/emails.js.php'; |
|
1311 | 1311 | } elseif ($get['page'] === 'ldap') { |
1312 | - include_once $SETTINGS['cpassman_dir'] . '/pages/ldap.js.php'; |
|
1312 | + include_once $SETTINGS['cpassman_dir'].'/pages/ldap.js.php'; |
|
1313 | 1313 | } elseif ($get['page'] === 'uploads') { |
1314 | - include_once $SETTINGS['cpassman_dir'] . '/pages/uploads.js.php'; |
|
1314 | + include_once $SETTINGS['cpassman_dir'].'/pages/uploads.js.php'; |
|
1315 | 1315 | } elseif ($get['page'] === 'fields') { |
1316 | - include_once $SETTINGS['cpassman_dir'] . '/pages/fields.js.php'; |
|
1316 | + include_once $SETTINGS['cpassman_dir'].'/pages/fields.js.php'; |
|
1317 | 1317 | } elseif ($get['page'] === 'options') { |
1318 | - include_once $SETTINGS['cpassman_dir'] . '/pages/options.js.php'; |
|
1318 | + include_once $SETTINGS['cpassman_dir'].'/pages/options.js.php'; |
|
1319 | 1319 | } elseif ($get['page'] === 'statistics') { |
1320 | - include_once $SETTINGS['cpassman_dir'] . '/pages/statistics.js.php'; |
|
1320 | + include_once $SETTINGS['cpassman_dir'].'/pages/statistics.js.php'; |
|
1321 | 1321 | } elseif ($get['page'] === 'tasks') { |
1322 | - include_once $SETTINGS['cpassman_dir'] . '/pages/tasks.js.php'; |
|
1322 | + include_once $SETTINGS['cpassman_dir'].'/pages/tasks.js.php'; |
|
1323 | 1323 | } |
1324 | 1324 | } elseif (isset($get['page']) === true && $get['page'] !== '') { |
1325 | 1325 | if ($get['page'] === 'items') { |
1326 | - include_once $SETTINGS['cpassman_dir'] . '/pages/items.js.php'; |
|
1326 | + include_once $SETTINGS['cpassman_dir'].'/pages/items.js.php'; |
|
1327 | 1327 | } elseif ($get['page'] === 'import') { |
1328 | - include_once $SETTINGS['cpassman_dir'] . '/pages/import.js.php'; |
|
1328 | + include_once $SETTINGS['cpassman_dir'].'/pages/import.js.php'; |
|
1329 | 1329 | } elseif ($get['page'] === 'export') { |
1330 | - include_once $SETTINGS['cpassman_dir'] . '/pages/export.js.php'; |
|
1330 | + include_once $SETTINGS['cpassman_dir'].'/pages/export.js.php'; |
|
1331 | 1331 | } elseif ($get['page'] === 'offline') { |
1332 | - include_once $SETTINGS['cpassman_dir'] . '/pages/offline.js.php'; |
|
1332 | + include_once $SETTINGS['cpassman_dir'].'/pages/offline.js.php'; |
|
1333 | 1333 | } elseif ($get['page'] === 'search') { |
1334 | - include_once $SETTINGS['cpassman_dir'] . '/pages/search.js.php'; |
|
1334 | + include_once $SETTINGS['cpassman_dir'].'/pages/search.js.php'; |
|
1335 | 1335 | } elseif ($get['page'] === 'profile') { |
1336 | - include_once $SETTINGS['cpassman_dir'] . '/pages/profile.js.php'; |
|
1336 | + include_once $SETTINGS['cpassman_dir'].'/pages/profile.js.php'; |
|
1337 | 1337 | } elseif ($get['page'] === 'favourites') { |
1338 | - include_once $SETTINGS['cpassman_dir'] . '/pages/favorites.js.php'; |
|
1338 | + include_once $SETTINGS['cpassman_dir'].'/pages/favorites.js.php'; |
|
1339 | 1339 | } elseif ($get['page'] === 'folders') { |
1340 | - include_once $SETTINGS['cpassman_dir'] . '/pages/folders.js.php'; |
|
1340 | + include_once $SETTINGS['cpassman_dir'].'/pages/folders.js.php'; |
|
1341 | 1341 | } elseif ($get['page'] === 'users') { |
1342 | - include_once $SETTINGS['cpassman_dir'] . '/pages/users.js.php'; |
|
1342 | + include_once $SETTINGS['cpassman_dir'].'/pages/users.js.php'; |
|
1343 | 1343 | } elseif ($get['page'] === 'roles') { |
1344 | - include_once $SETTINGS['cpassman_dir'] . '/pages/roles.js.php'; |
|
1344 | + include_once $SETTINGS['cpassman_dir'].'/pages/roles.js.php'; |
|
1345 | 1345 | } elseif ($get['page'] === 'utilities.deletion') { |
1346 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.deletion.js.php'; |
|
1346 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.deletion.js.php'; |
|
1347 | 1347 | } elseif ($get['page'] === 'utilities.logs') { |
1348 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.logs.js.php'; |
|
1348 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.logs.js.php'; |
|
1349 | 1349 | } elseif ($get['page'] === 'utilities.database') { |
1350 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.database.js.php'; |
|
1350 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.database.js.php'; |
|
1351 | 1351 | } elseif ($get['page'] === 'utilities.renewal') { |
1352 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.renewal.js.php'; |
|
1352 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.renewal.js.php'; |
|
1353 | 1353 | } |
1354 | 1354 | } else { |
1355 | - include_once $SETTINGS['cpassman_dir'] . '/includes/core/login.js.php'; |
|
1355 | + include_once $SETTINGS['cpassman_dir'].'/includes/core/login.js.php'; |
|
1356 | 1356 | } |
1357 | 1357 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | - $items = DB::query('SELECT id,label FROM ' . prefixTable('items') . ' WHERE id_tree NOT IN %li', $foldersIds); |
|
88 | + $items = DB::query('SELECT id,label FROM '.prefixTable('items').' WHERE id_tree NOT IN %li', $foldersIds); |
|
89 | 89 | foreach ($items as $item) { |
90 | 90 | //Delete item |
91 | 91 | DB::DELETE(prefixTable('items'), 'id = %i', $item['id']); |
@@ -104,12 +104,12 @@ discard block |
||
104 | 104 | // delete orphan items |
105 | 105 | $rows = DB::query( |
106 | 106 | 'SELECT id |
107 | - FROM ' . prefixTable('items') . ' |
|
107 | + FROM ' . prefixTable('items').' |
|
108 | 108 | ORDER BY id ASC' |
109 | 109 | ); |
110 | 110 | foreach ($rows as $item) { |
111 | 111 | DB::query( |
112 | - 'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i AND action = %s', |
|
112 | + 'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i AND action = %s', |
|
113 | 113 | $item['id'], |
114 | 114 | 'at_creation' |
115 | 115 | ); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | //get through all users |
77 | 77 | $users = DB::query( |
78 | 78 | 'SELECT id, login, email |
79 | - FROM ' . prefixTable('users') . ' |
|
79 | + FROM ' . prefixTable('users').' |
|
80 | 80 | WHERE id NOT IN ('.OTV_USER_ID.', '.TP_USER_ID.', '.SSH_USER_ID.', '.API_USER_ID.') |
81 | 81 | ORDER BY login ASC' |
82 | 82 | ); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | //if folder doesn't exist then create it |
97 | 97 | $data = DB::queryfirstrow( |
98 | 98 | 'SELECT id |
99 | - FROM ' . prefixTable('nested_tree') . ' |
|
99 | + FROM ' . prefixTable('nested_tree').' |
|
100 | 100 | WHERE title = %s AND parent_id = %i', |
101 | 101 | $user['id'], |
102 | 102 | 0 |