Passed
Branch — teampass_3.0 (974317)
by Nils
10:43
created
pages/offline.js.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49 49
     //not allowed page
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 ?>
Please login to merge, or discard this patch.
pages/export.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], curPage($SETTINGS), $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49 49
     //not allowed page
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 
54 54
 // Load
55
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
55
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
56 56
 
57 57
 ?>
58 58
 
Please login to merge, or discard this patch.
error.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
     && filter_input(INPUT_POST, 'session', FILTER_SANITIZE_STRING) === 'expired'
55 55
 ) {
56 56
     //Include files
57
-    require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
58
-    require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
59
-    require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
60
-    require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
57
+    require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
58
+    require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
59
+    require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
60
+    require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
61 61
     // connect to DB
62
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
62
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
63 63
     if (defined('DB_PASSWD_CLEAR') === false) {
64 64
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
65 65
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     // Update table by deleting ID
70 70
     if (isset($_SESSION['user_id'])) {
71 71
         DB::update(
72
-            DB_PREFIX . 'users',
72
+            DB_PREFIX.'users',
73 73
             [
74 74
                 'key_tempo' => '',
75 75
             ],
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         logEvents($SETTINGS, 'user_connection', 'disconnection', (string) $_SESSION['user_id'], $_SESSION['login']);
84 84
     }
85 85
 } else {
86
-    require_once $SETTINGS['cpassman_dir'] . '/sources/main.queries.php';
86
+    require_once $SETTINGS['cpassman_dir'].'/sources/main.queries.php';
87 87
     $errorCode = '';
88 88
     if (@$_SESSION['error']['code'] === ERR_NOT_ALLOWED) {
89 89
         $errorCode = 'ERROR NOT ALLOWED';
Please login to merge, or discard this patch.
pages/roles.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'roles', $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49
-    include $SETTINGS['cpassman_dir'] . '/error.php';
49
+    include $SETTINGS['cpassman_dir'].'/error.php';
50 50
     exit;
51 51
 }
52 52
 
53 53
 // Load template
54
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
54
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
55 55
 
56 56
 ?>
57 57
 
@@ -94,17 +94,17 @@  discard block
 block discarded – undo
94 94
                                 $arrUserRoles = array_filter($_SESSION['user_roles']);
95 95
                                 $where = '';
96 96
                                 if (count($arrUserRoles) > 0 && (int) $_SESSION['is_admin'] !== 1) {
97
-                                    $where = ' WHERE id IN (' . implode(',', $arrUserRoles) . ')';
97
+                                    $where = ' WHERE id IN ('.implode(',', $arrUserRoles).')';
98 98
                                 }
99
-                                $rows = DB::query('SELECT * FROM ' . prefixTable('roles_title') . $where);
99
+                                $rows = DB::query('SELECT * FROM '.prefixTable('roles_title').$where);
100 100
                                 foreach ($rows as $reccord) {
101 101
                                     echo '
102
-                                    <option value="' . $reccord['id'] . '"
103
-                                        data-complexity-text="' . addslashes(TP_PW_COMPLEXITY[$reccord['complexity']][1]) . '"
104
-                                        data-complexity-icon="' . TP_PW_COMPLEXITY[$reccord['complexity']][2] . '"
105
-                                        data-complexity="' . TP_PW_COMPLEXITY[$reccord['complexity']][0] . '"
106
-                                        data-allow-edit-all="' . $reccord['allow_pw_change'] . '">'.
107
-                                        $reccord['title'] . '</option>';
102
+                                    <option value="' . $reccord['id'].'"
103
+                                        data-complexity-text="' . addslashes(TP_PW_COMPLEXITY[$reccord['complexity']][1]).'"
104
+                                        data-complexity-icon="' . TP_PW_COMPLEXITY[$reccord['complexity']][2].'"
105
+                                        data-complexity="' . TP_PW_COMPLEXITY[$reccord['complexity']][0].'"
106
+                                        data-allow-edit-all="' . $reccord['allow_pw_change'].'">'.
107
+                                        $reccord['title'].'</option>';
108 108
                                 }
109 109
                                 ?>
110 110
                             </select>
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                                         <?php
126 126
                                         foreach (TP_PW_COMPLEXITY as $entry) {
127 127
                                             echo '
128
-                                        <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>';
128
+                                        <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>';
129 129
                                         }
130 130
                                         ?>
131 131
                                     </select>
Please login to merge, or discard this patch.
pages/2fa.js.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@
 block discarded – undo
43 43
 }
44 44
 echo "ici";
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], '2fa', $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49 49
     //not allowed page
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 ?>
Please login to merge, or discard this patch.
pages/2fa.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], '2fa', $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49
-    include $SETTINGS['cpassman_dir'] . '/error.php';
49
+    include $SETTINGS['cpassman_dir'].'/error.php';
50 50
     exit;
51 51
 }
52 52
 
53 53
 // Load template
54
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
54
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
55 55
 
56 56
 ?>
57 57
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
                                     );
116 116
                                     foreach ($roles as $role) {
117 117
                                         echo '
118
-                                    <option value="' . $role['id'] . '"', in_array($role['id'], $arrRolesMFA) === true ? ' selected' : '', '>' . addslashes($role['title']) . '</option>';
118
+                                    <option value="' . $role['id'].'"', in_array($role['id'], $arrRolesMFA) === true ? ' selected' : '', '>'.addslashes($role['title']).'</option>';
119 119
                                     }
120 120
                                     ?>
121 121
                                 </select>
Please login to merge, or discard this patch.
pages/actions.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'ldap', $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49
-    include $SETTINGS['cpassman_dir'] . '/error.php';
49
+    include $SETTINGS['cpassman_dir'].'/error.php';
50 50
     exit;
51 51
 }
52 52
 
53 53
 // Load template
54
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
54
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
55 55
 
56 56
 ?>
57 57
 
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
                                 <?php
91 91
                                 echo langHdl('rebuild_config_file');
92 92
 $data = DB::queryfirstrow(
93
-    'SELECT field_1, date FROM ' . prefixTable('log_system') . '
93
+    'SELECT field_1, date FROM '.prefixTable('log_system').'
94 94
                                     WHERE label = %s
95 95
                                     ORDER BY id DESC',
96 96
     'admin_action_rebuild_config_file'
97 97
 );
98 98
 if (DB::count() > 0) {
99
-    $tmp = langHdl('last_execution') . ' ' .
100
-                                        date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']);
99
+    $tmp = langHdl('last_execution').' '.
100
+                                        date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']);
101 101
     $tmp .= $data['field_1'] === 'success' ?
102 102
                                         '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>';
103 103
 } else {
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
                                 </span>
120 120
                                 <?php echo langHdl('admin_action_check_pf');
121 121
 $data = DB::queryfirstrow(
122
-    'SELECT field_1, date FROM ' . prefixTable('log_system') . '
122
+    'SELECT field_1, date FROM '.prefixTable('log_system').'
123 123
                                     WHERE label = %s
124 124
                                     ORDER BY id DESC',
125 125
     'admin_action_check_pf'
126 126
 );
127 127
 if (DB::count() > 0) {
128
-    $tmp = langHdl('last_execution') . ' ' .
129
-                                        date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']);
128
+    $tmp = langHdl('last_execution').' '.
129
+                                        date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']);
130 130
     $tmp .= $data['field_1'] === 'success' ?
131 131
                                         '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>';
132 132
 } else {
@@ -146,14 +146,14 @@  discard block
 block discarded – undo
146 146
                                 </span>
147 147
                                 <?php echo langHdl('admin_action_db_clean_items');
148 148
 $data = DB::queryfirstrow(
149
-    'SELECT field_1, date FROM ' . prefixTable('log_system') . '
149
+    'SELECT field_1, date FROM '.prefixTable('log_system').'
150 150
                                     WHERE label = %s
151 151
                                     ORDER BY id DESC',
152 152
     'admin_action_db_clean_items'
153 153
 );
154 154
 if (DB::count() > 0) {
155
-    $tmp = langHdl('last_execution') . ' ' .
156
-                                        date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']);
155
+    $tmp = langHdl('last_execution').' '.
156
+                                        date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']);
157 157
     $tmp .= $data['field_1'] === 'success' ?
158 158
                                         '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>';
159 159
 } else {
@@ -175,14 +175,14 @@  discard block
 block discarded – undo
175 175
                                 </span>
176 176
                                 <?php echo langHdl('admin_action_db_optimize');
177 177
 $data = DB::queryfirstrow(
178
-    'SELECT field_1, date FROM ' . prefixTable('log_system') . '
178
+    'SELECT field_1, date FROM '.prefixTable('log_system').'
179 179
                                     WHERE label = %s
180 180
                                     ORDER BY id DESC',
181 181
     'admin_action_db_optimize'
182 182
 );
183 183
 if (DB::count() > 0) {
184
-    $tmp = langHdl('last_execution') . ' ' .
185
-                                        date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']);
184
+    $tmp = langHdl('last_execution').' '.
185
+                                        date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']);
186 186
     $tmp .= $data['field_1'] === 'success' ?
187 187
                                         '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>';
188 188
 } else {
@@ -201,14 +201,14 @@  discard block
 block discarded – undo
201 201
                                 </span>
202 202
                                 <?php echo langHdl('admin_action_purge_old_files');
203 203
 $data = DB::queryfirstrow(
204
-    'SELECT field_1, date FROM ' . prefixTable('log_system') . '
204
+    'SELECT field_1, date FROM '.prefixTable('log_system').'
205 205
                                     WHERE label = %s
206 206
                                     ORDER BY id DESC',
207 207
     'admin_action_purge_old_files'
208 208
 );
209 209
 if (DB::count() > 0) {
210
-    $tmp = langHdl('last_execution') . ' ' .
211
-                                        date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']);
210
+    $tmp = langHdl('last_execution').' '.
211
+                                        date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']);
212 212
     $tmp .= $data['field_1'] === 'success' ?
213 213
                                         '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>';
214 214
 } else {
@@ -230,14 +230,14 @@  discard block
 block discarded – undo
230 230
                                 </span>
231 231
                                 <?php echo langHdl('admin_action_reload_cache_table');
232 232
 $data = DB::queryfirstrow(
233
-    'SELECT field_1, date FROM ' . prefixTable('log_system') . '
233
+    'SELECT field_1, date FROM '.prefixTable('log_system').'
234 234
                                     WHERE label = %s
235 235
                                     ORDER BY id DESC',
236 236
     'admin_action_reload_cache_table'
237 237
 );
238 238
 if (DB::count() > 0) {
239
-    $tmp = langHdl('last_execution') . ' ' .
240
-                                        date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']);
239
+    $tmp = langHdl('last_execution').' '.
240
+                                        date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']);
241 241
     $tmp .= $data['field_1'] === 'success' ?
242 242
                                         '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>';
243 243
 } else {
@@ -260,14 +260,14 @@  discard block
 block discarded – undo
260 260
                                 </span>
261 261
                                 <?php echo langHdl('admin_action_change_salt_key');
262 262
 $data = DB::queryfirstrow(
263
-    'SELECT field_1, date FROM ' . prefixTable('log_system') . '
263
+    'SELECT field_1, date FROM '.prefixTable('log_system').'
264 264
                                     WHERE label = %s
265 265
                                     ORDER BY id DESC',
266 266
     'admin_action_change_sk'
267 267
 );
268 268
 if (DB::count() > 0) {
269
-    $tmp = langHdl('last_execution') . ' ' .
270
-                                        date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']);
269
+    $tmp = langHdl('last_execution').' '.
270
+                                        date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']);
271 271
     $tmp .= $data['field_1'] === 'success' ?
272 272
                                         '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>';
273 273
 } else {
@@ -290,14 +290,14 @@  discard block
 block discarded – undo
290 290
                                 </span>
291 291
                                 <?php echo langHdl('admin_action_attachments_cryption');
292 292
 $data = DB::queryfirstrow(
293
-    'SELECT field_1, date FROM ' . prefixTable('log_system') . '
293
+    'SELECT field_1, date FROM '.prefixTable('log_system').'
294 294
                                     WHERE label = %s
295 295
                                     ORDER BY id DESC',
296 296
     'admin_action_change_file_encryption'
297 297
 );
298 298
 if (DB::count() > 0) {
299
-    $tmp = langHdl('last_execution') . ' ' .
300
-                                        date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']);
299
+    $tmp = langHdl('last_execution').' '.
300
+                                        date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']);
301 301
     $tmp .= $data['field_1'] === 'success' ?
302 302
                                         '<i class="fas fa-check ml-2 text-success"></i>' : '<i class="fas fa-times ml-2 text-danger"></i>';
303 303
 } else {
Please login to merge, or discard this patch.
pages/profile.php 1 patch
Spacing   +36 added lines, -38 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], curPage($SETTINGS), $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49
-    include $SETTINGS['cpassman_dir'] . '/error.php';
49
+    include $SETTINGS['cpassman_dir'].'/error.php';
50 50
     exit;
51 51
 }
52 52
 
53 53
 // Load template
54
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
55
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
54
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
55
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
56 56
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
57 57
 // Prepare GET variables
58 58
 $get = [];
@@ -73,25 +73,25 @@  discard block
 block discarded – undo
73 73
 // prepare list of timezones
74 74
 $zones = timezone_list();
75 75
 // prepare list of languages
76
-$languages = DB::query('SELECT label FROM ' . prefixTable('languages') . ' ORDER BY label ASC');
76
+$languages = DB::query('SELECT label FROM '.prefixTable('languages').' ORDER BY label ASC');
77 77
 // Do some stats
78
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_creation" AND  id_user = "' . $_SESSION['user_id'] . '"');
78
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_creation" AND  id_user = "'.$_SESSION['user_id'].'"');
79 79
 $userItemsNumber = DB::count();
80
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_modification" AND  id_user = "' . $_SESSION['user_id'] . '"');
80
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_modification" AND  id_user = "'.$_SESSION['user_id'].'"');
81 81
 $userModificationNumber = DB::count();
82
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_shown" AND  id_user = "' . $_SESSION['user_id'] . '"');
82
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_shown" AND  id_user = "'.$_SESSION['user_id'].'"');
83 83
 $userSeenItemsNumber = DB::count();
84
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_password_shown" AND  id_user = "' . $_SESSION['user_id'] . '"');
84
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_password_shown" AND  id_user = "'.$_SESSION['user_id'].'"');
85 85
 $userSeenPasswordsNumber = DB::count();
86 86
 $userInfo = DB::queryFirstRow(
87 87
     'SELECT avatar 
88
-    FROM ' . prefixTable('users') . ' 
89
-    WHERE id = "' . $_SESSION['user_id'] . '"'
88
+    FROM ' . prefixTable('users').' 
89
+    WHERE id = "' . $_SESSION['user_id'].'"'
90 90
 );
91 91
 if (empty($userInfo['avatar']) === true) {
92
-    $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
92
+    $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
93 93
 } else {
94
-    $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $userInfo['avatar'];
94
+    $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$userInfo['avatar'];
95 95
 }
96 96
 
97 97
 // Get Groups name
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 foreach ($_SESSION['user_roles'] as $role) {
100 100
     $tmp = DB::queryFirstRow(
101 101
         'SELECT title 
102
-        FROM ' . prefixTable('roles_title') . ' 
103
-        WHERE id = "' . $role . '"'
102
+        FROM ' . prefixTable('roles_title').' 
103
+        WHERE id = "' . $role.'"'
104 104
     );
105 105
     if ($tmp !== null) {
106 106
         array_push($userParOfGroups, $tmp['title']);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                         <h3 id="profile-username" class="text-center">
145 145
                             <?php
146 146
                             if (isset($_SESSION['name']) === true && empty($_SESSION['name']) === false) {
147
-                                echo $_SESSION['name'] . ' ' . $_SESSION['lastname'];
147
+                                echo $_SESSION['name'].' '.$_SESSION['lastname'];
148 148
                             } else {
149 149
                                 echo $_SESSION['login'];
150 150
                             }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                                             } else {
212 212
                                                 echo date('d/m/Y', (int) $_SESSION['last_connection']);
213 213
                                             }
214
-                                            echo ' ' . langHdl('at') . ' ';
214
+                                            echo ' '.langHdl('at').' ';
215 215
                                             if (isset($SETTINGS['time_format']) === true) {
216 216
                                                 echo date($SETTINGS['time_format'], (int) $_SESSION['last_connection']);
217 217
                                             } else {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                                         </a>
222 222
                                     </li>
223 223
                                     <?php
224
-                                    if (isset($_SESSION['last_pw_change']) && ! empty($_SESSION['last_pw_change'])) {
224
+                                    if (isset($_SESSION['last_pw_change']) && !empty($_SESSION['last_pw_change'])) {
225 225
                                         // Handle last password change string
226 226
                                         if (isset($_SESSION['last_pw_change']) === true) {
227 227
                                             if (isset($SETTINGS['date_format']) === true) {
@@ -241,12 +241,12 @@  discard block
 block discarded – undo
241 241
                                         ) {
242 242
                                             $numDaysBeforePwExpiration = '';
243 243
                                         } else {
244
-                                            $numDaysBeforePwExpiration = $LANG['index_pw_expiration'] . ' ' . $_SESSION['numDaysBeforePwExpiration'] . ' ' . $LANG['days'] . '.';
244
+                                            $numDaysBeforePwExpiration = $LANG['index_pw_expiration'].' '.$_SESSION['numDaysBeforePwExpiration'].' '.$LANG['days'].'.';
245 245
                                         }
246 246
                                         echo '
247 247
                                     <li class="list-group-item">
248
-                                        <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . langHdl('index_last_pw_change') . '</b>
249
-                                        <a class="float-right">' . $last_pw_change . ' ' . $numDaysBeforePwExpiration . '</a>
248
+                                        <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . langHdl('index_last_pw_change').'</b>
249
+                                        <a class="float-right">' . $last_pw_change.' '.$numDaysBeforePwExpiration.'</a>
250 250
                                     </li>';
251 251
                                     }
252 252
                                     ?>
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
                                     if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
267 267
                                         echo '
268 268
                                     <li class="list-group-item">
269
-                                        <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_api_key') . '</b>
269
+                                        <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_api_key').'</b>
270 270
                                         <a class="float-right" id="profile-user-api-token">',
271 271
                                             isset($_SESSION['user']['api-key']) === true ? $_SESSION['user']['api-key'] : '',
272 272
                                             '</a>
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                                     ) {
279 279
                                         echo '
280 280
                                     <li class="list-group-item">
281
-                                        <b><i class="fas fa-id-card-o fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_agses_card_id') . '</b>
281
+                                        <b><i class="fas fa-id-card-o fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_agses_card_id').'</b>
282 282
                                         <a class="float-right">',
283 283
                                             $_SESSION['user']['agses-usercardid'] ?? '',
284 284
                                             '</a>
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
                                         <ul class="">
303 303
                                             <?php
304 304
                                                 foreach ($_SESSION['user']['unsuccessfull_login_attempts_list'] as $entry) {
305
-                                                    echo '<li class="">' . $entry . '</li>';
305
+                                                    echo '<li class="">'.$entry.'</li>';
306 306
                                                 } ?>
307 307
                                         </ul>
308 308
                                     </div>
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
                                         <?php
316 316
                                         $rows = DB::query(
317 317
                                             'SELECT label AS labelAction, date, null
318
-                                                    FROM ' . prefixTable('log_system') . '
318
+                                                    FROM ' . prefixTable('log_system').'
319 319
                                                     WHERE qui = %i
320 320
                                                     UNION
321 321
                                                     SELECT l.action, l.date, i.label AS itemLabel
322
-                                                    FROM ' . prefixTable('log_items') . ' AS l
323
-                                                    INNER JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id)
322
+                                                    FROM ' . prefixTable('log_items').' AS l
323
+                                                    INNER JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id)
324 324
                                                     WHERE l.id_user = %i AND l.action IN ("at_access")
325 325
                                                     ORDER BY date DESC
326 326
                                                     LIMIT 0, 40',
@@ -334,9 +334,9 @@  discard block
 block discarded – undo
334 334
                                                 $text = langHdl($record['labelAction']);
335 335
                                             }
336 336
                                             if (empty($record['NULL']) === false) {
337
-                                                $text .= ' ' . langHdl('for') . ' <span class="font-weight-light">' . addslashes($record['NULL']) . '</span>';
337
+                                                $text .= ' '.langHdl('for').' <span class="font-weight-light">'.addslashes($record['NULL']).'</span>';
338 338
                                             }
339
-                                            echo '<li class="list-group-item">' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - ' . $text . '</li>';
339
+                                            echo '<li class="list-group-item">'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).' - '.$text.'</li>';
340 340
                                         }
341 341
                                         ?>
342 342
                                     </ul>
@@ -374,11 +374,10 @@  discard block
 block discarded – undo
374 374
                                                 <?php
375 375
                                                 foreach ($zones as $key => $zone) {
376 376
                                                     echo '
377
-                                                <option value="' . $key . '"',
377
+                                                <option value="' . $key.'"',
378 378
                                                     isset($_SESSION['user']['usertimezone']) === true && $_SESSION['user']['usertimezone'] === $key ?
379
-                                                    ' selected' :
380
-                                                    (isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''),
381
-                                                '>' . $zone . '</option>';
379
+                                                    ' selected' : (isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''),
380
+                                                '>'.$zone.'</option>';
382 381
                                                 }
383 382
                                                 ?>
384 383
                                             </select>
@@ -390,11 +389,10 @@  discard block
 block discarded – undo
390 389
                                             <select class="form-control" id="profile-user-language">
391 390
                                                 <?php
392 391
                                                 foreach ($languages as $language) {
393
-                                                    echo '<option value="' . $language['label'] . '"',
392
+                                                    echo '<option value="'.$language['label'].'"',
394 393
                                                     $_SESSION['user']['user_language'] === strtolower($language['label']) ?
395
-                                                    ' selected="selected"' :
396
-                                                    ($SETTINGS['default_language'] === strtolower($language['label']) ? ' selected="selected"' : ''),
397
-                                                '>' . $language['label'] . '</option>';
394
+                                                    ' selected="selected"' : ($SETTINGS['default_language'] === strtolower($language['label']) ? ' selected="selected"' : ''),
395
+                                                '>'.$language['label'].'</option>';
398 396
                                                 }
399 397
                                                 ?>
400 398
                                             </select>
@@ -445,7 +443,7 @@  discard block
 block discarded – undo
445 443
                                                 <button type="button" class="btn btn-warning float-right ml-2" id="profile-avatar-file"><?php echo langHdl('upload_new_avatar'); ?></button>
446 444
                                                 <?php
447 445
                                                 if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
448
-                                                    echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">' . langHdl('generate_api_token') . '</button>';
446
+                                                    echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">'.langHdl('generate_api_token').'</button>';
449 447
                                                 }
450 448
                                                 ?>
451 449
                                                 <div id="profile-avatar-file-container" class="hidden"></div>
Please login to merge, or discard this patch.
sources/expired.datatables.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 require_once 'SecureHandler.php';
29 29
 session_name('teampass_session');
30 30
 session_start();
31
-if (! isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || ! isset($_SESSION['key']) || empty($_SESSION['key'])) {
31
+if (!isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || !isset($_SESSION['key']) || empty($_SESSION['key'])) {
32 32
     die('Hacking attempt...');
33 33
 }
34 34
 
@@ -42,22 +42,22 @@  discard block
 block discarded – undo
42 42
 }
43 43
 
44 44
 // Do checks
45
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
45
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'folders', $SETTINGS) === false) {
48 48
     // Not allowed page
49 49
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 
54
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
55
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
54
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
55
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
56 56
 header('Content-type: text/html; charset=utf-8');
57 57
 header('Cache-Control: no-cache, must-revalidate');
58 58
 require_once 'main.functions.php';
59 59
 // Connect to mysql server
60
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
60
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
61 61
 if (defined('DB_PASSWD_CLEAR') === false) {
62 62
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
63 63
 }
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 DB::$port = DB_PORT;
69 69
 DB::$encoding = DB_ENCODING;
70 70
 // Class loader
71
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
71
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
72 72
 //Build tree
73
-$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
73
+$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
74 74
 $tree->register();
75 75
 $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
76 76
 //Columns name
@@ -81,22 +81,22 @@  discard block
 block discarded – undo
81 81
 $sOrder = $sLimit = '';
82 82
 // Is a date sent?
83 83
 if (isset($_GET['dateCriteria']) === true && empty($_GET['dateCriteria']) === false) {
84
-    $sWhere .= ' AND a.del_value < ' . round(filter_var($_GET['dateCriteria'], FILTER_SANITIZE_NUMBER_INT) / 1000, 0);
84
+    $sWhere .= ' AND a.del_value < '.round(filter_var($_GET['dateCriteria'], FILTER_SANITIZE_NUMBER_INT) / 1000, 0);
85 85
 }
86 86
 //echo $sWhere;
87 87
 /* BUILD QUERY */
88 88
 //Paging
89 89
 $sLimit = '';
90 90
 if (isset($_GET['length']) === true && (int) $_GET['length'] !== -1) {
91
-    $sLimit = ' LIMIT ' . filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT) . ', ' . filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT) . '';
91
+    $sLimit = ' LIMIT '.filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT).', '.filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT).'';
92 92
 }
93 93
 
94 94
 //Ordering
95 95
 if (isset($_GET['order'][0]['dir']) && in_array($_GET['order'][0]['dir'], $aSortTypes)) {
96 96
     $sOrder = 'ORDER BY  ';
97 97
     if (preg_match('#^(asc|desc)$#i', $_GET['order'][0]['column'])) {
98
-        $sOrder .= '' . $aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)] . ' '
99
-            . filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_STRING) . ', ';
98
+        $sOrder .= ''.$aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)].' '
99
+            . filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_STRING).', ';
100 100
     }
101 101
 
102 102
     $sOrder = substr_replace($sOrder, '', -2);
@@ -117,29 +117,29 @@  discard block
 block discarded – undo
117 117
     && $_GET['letter'] !== 'None'
118 118
 ) {
119 119
     $sWhere .= ' AND ';
120
-    $sWhere .= $aColumns[1] . " LIKE '" . filter_var($_GET['letter'], FILTER_SANITIZE_STRING) . "%' OR ";
121
-    $sWhere .= $aColumns[2] . " LIKE '" . filter_var($_GET['letter'], FILTER_SANITIZE_STRING) . "%' OR ";
122
-    $sWhere .= $aColumns[3] . " LIKE '" . filter_var($_GET['letter'], FILTER_SANITIZE_STRING) . "%' ";
120
+    $sWhere .= $aColumns[1]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_STRING)."%' OR ";
121
+    $sWhere .= $aColumns[2]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_STRING)."%' OR ";
122
+    $sWhere .= $aColumns[3]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_STRING)."%' ";
123 123
 } elseif (isset($_GET['search']['value']) === true && $_GET['search']['value'] !== '') {
124 124
     $sWhere = ' AND ';
125
-    $sWhere .= $aColumns[1] . " LIKE '" . filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING) . "%' OR ";
126
-    $sWhere .= $aColumns[2] . " LIKE '" . filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING) . "%' OR ";
127
-    $sWhere .= $aColumns[3] . " LIKE '" . filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING) . "%' ";
125
+    $sWhere .= $aColumns[1]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING)."%' OR ";
126
+    $sWhere .= $aColumns[2]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING)."%' OR ";
127
+    $sWhere .= $aColumns[3]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING)."%' ";
128 128
 }
129 129
 
130 130
 $rows = DB::query(
131 131
     'SELECT a.item_id, i.label, a.del_value, i.id_tree
132
-    FROM ' . prefixTable('automatic_del') . ' AS a
133
-    INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' .
132
+    FROM ' . prefixTable('automatic_del').' AS a
133
+    INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'.
134 134
     $sWhere.
135 135
     (string) $sOrder
136 136
 );
137 137
 $iTotal = DB::count();
138 138
 $rows = DB::query(
139 139
     'SELECT a.item_id, i.label, a.del_value, i.id_tree
140
-    FROM ' . prefixTable('automatic_del') . ' AS a
141
-    INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' .
142
-        $sWhere .
140
+    FROM ' . prefixTable('automatic_del').' AS a
141
+    INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'.
142
+        $sWhere.
143 143
         $sLimit
144 144
 );
145 145
 $iFilteredTotal = DB::count();
@@ -157,18 +157,18 @@  discard block
 block discarded – undo
157 157
     // start the line
158 158
     $sOutput .= '[';
159 159
     // Column 1
160
-    $sOutput .= '"<i class=\"fas fa-external-link-alt pointer text-primary mr-2\" onclick=\"showItemCard($(this))\" data-item-id=\"' . $record['item_id'] . '\"  data-item-tree-id=\"' . $record['id_tree'] . '\"></i>", ';
160
+    $sOutput .= '"<i class=\"fas fa-external-link-alt pointer text-primary mr-2\" onclick=\"showItemCard($(this))\" data-item-id=\"'.$record['item_id'].'\"  data-item-tree-id=\"'.$record['id_tree'].'\"></i>", ';
161 161
     // Column 2
162
-    $sOutput .= '"' . $record['label'] . '", ';
162
+    $sOutput .= '"'.$record['label'].'", ';
163 163
     // Column 3
164
-    $sOutput .= '"' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['del_value']) . '", ';
164
+    $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['del_value']).'", ';
165 165
     // Column 4
166 166
     $path = [];
167 167
     $treeDesc = $tree->getPath($record['id_tree'], true);
168 168
     foreach ($treeDesc as $t) {
169 169
         array_push($path, $t->title);
170 170
     }
171
-    $sOutput .= '"' . implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path) . '"],';
171
+    $sOutput .= '"'.implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path).'"],';
172 172
 }
173 173
 
174 174
 if ($iTotal > 0) {
@@ -181,4 +181,4 @@  discard block
 block discarded – undo
181 181
 }
182 182
 
183 183
 // finalize output
184
-echo '{"recordsTotal": ' . $iTotal . ', "recordsFiltered": ' . $iFilteredTotal . ', "data": ' . $sOutput;
184
+echo '{"recordsTotal": '.$iTotal.', "recordsFiltered": '.$iFilteredTotal.', "data": '.$sOutput;
Please login to merge, or discard this patch.