Passed
Push — teampass_3.0 ( f644bb...9dbfce )
by Nils
12:26
created
sources/find.queries.php 1 patch
Spacing   +47 added lines, -47 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,17 +42,17 @@  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'], 'items', $SETTINGS) === false) {
48 48
     // Not allowed page
49 49
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 
54
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
55
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
54
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
55
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
56 56
 header('Content-type: text/html; charset=utf-8');
57 57
 header('Cache-Control: no-cache, must-revalidate');
58 58
 require_once 'main.functions.php';
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
 if (isset($_SESSION['groupes_visibles']) === false
61 61
     || empty($_SESSION['groupes_visibles']) === true
62 62
 ) {
63
-    echo '{"sEcho": ' . intval($_GET['sEcho']) . ' ,"iTotalRecords": "0", "iTotalDisplayRecords": "0", "aaData": [] }';
63
+    echo '{"sEcho": '.intval($_GET['sEcho']).' ,"iTotalRecords": "0", "iTotalDisplayRecords": "0", "aaData": [] }';
64 64
     exit;
65 65
 }
66 66
 
67 67
 //Connect to DB
68
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
68
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
69 69
 if (defined('DB_PASSWD_CLEAR') === false) {
70 70
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
71 71
 }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     $folders = $_SESSION['groupes_visibles'];
90 90
 } else {
91 91
     // Build tree
92
-    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
92
+    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
93 93
     $tree->register();
94 94
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
95 95
     $folders = $tree->getDescendants(filter_var($_GET['limited'], FILTER_SANITIZE_NUMBER_INT), true);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
 //Get current user "personal folder" ID
100 100
 $row = DB::query(
101
-    'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %i',
101
+    'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %i',
102 102
     intval($_SESSION['user_id'])
103 103
 );
104 104
 //get list of personal folders
@@ -107,21 +107,21 @@  discard block
 block discarded – undo
107 107
 $listPf = '';
108 108
 if (empty($row['id']) === false) {
109 109
     $rows = DB::query(
110
-        'SELECT id FROM ' . prefixTable('nested_tree') . '
110
+        'SELECT id FROM '.prefixTable('nested_tree').'
111 111
         WHERE personal_folder = 1 AND NOT parent_id = %i AND NOT title = %i',
112 112
         '1',
113 113
         filter_var($row['id'], FILTER_SANITIZE_NUMBER_INT),
114 114
         filter_var($_SESSION['user_id'], FILTER_SANITIZE_NUMBER_INT)
115 115
     );
116 116
     foreach ($rows as $record) {
117
-        if (! in_array($record['id'], $arrayPf)) {
117
+        if (!in_array($record['id'], $arrayPf)) {
118 118
             //build an array of personal folders ids
119 119
             array_push($arrayPf, $record['id']);
120 120
             //build also a string with those ids
121 121
             if (empty($listPf)) {
122 122
                 $listPf = $record['id'];
123 123
             } else {
124
-                $listPf .= ', ' . $record['id'];
124
+                $listPf .= ', '.$record['id'];
125 125
             }
126 126
         }
127 127
     }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 //Paging
132 132
 $sLimit = '';
133 133
 if (isset($_GET['start']) === true && $_GET['length'] !== '-1') {
134
-    $sLimit = 'LIMIT ' . filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT) . ', ' . filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT) . '';
134
+    $sLimit = 'LIMIT '.filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT).', '.filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT).'';
135 135
 }
136 136
 
137 137
 //Ordering
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
     }
145 145
     $sOrder = 'ORDER BY  ';
146 146
     if ($_GET['order'][0]['column'] >= 0) {
147
-        $sOrder .= '' . $aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)] . ' '
148
-                . filter_var($_GET['order'][0]['dir'], FILTER_SANITIZE_STRING) . ', ';
147
+        $sOrder .= ''.$aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)].' '
148
+                . filter_var($_GET['order'][0]['dir'], FILTER_SANITIZE_STRING).', ';
149 149
     }
150 150
 
151 151
     $sOrder = substr_replace($sOrder, '', -2);
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         $sOrder = '';
154 154
     }
155 155
 } else {
156
-    $sOrder = 'ORDER BY ' . $aColumns[1] . ' ASC';
156
+    $sOrder = 'ORDER BY '.$aColumns[1].' ASC';
157 157
 }
158 158
 
159 159
 // Define criteria
@@ -175,9 +175,9 @@  discard block
 block discarded – undo
175 175
 if (empty($search_criteria) === false) {
176 176
     $sWhere .= ' AND (';
177 177
     for ($i = 0; $i < count($aColumns); ++$i) {
178
-        $sWhere .= $aColumns[$i] . ' LIKE %ss_' . $i . ' OR ';
178
+        $sWhere .= $aColumns[$i].' LIKE %ss_'.$i.' OR ';
179 179
     }
180
-    $sWhere = substr_replace((string) $sWhere, '', -3) . ') ';
180
+    $sWhere = substr_replace((string) $sWhere, '', -3).') ';
181 181
     $crit = [
182 182
         'idtree' => array_unique($folders),
183 183
         '0' => $search_criteria,
@@ -215,13 +215,13 @@  discard block
 block discarded – undo
215 215
     if (empty($sWhere) === false) {
216 216
         $sWhere .= ' AND ';
217 217
     }
218
-    $sWhere = 'WHERE ' . $sWhere . 'id_tree NOT IN %ls_pf ';
218
+    $sWhere = 'WHERE '.$sWhere.'id_tree NOT IN %ls_pf ';
219 219
 } else {
220
-    $sWhere = 'WHERE ' . $sWhere;
220
+    $sWhere = 'WHERE '.$sWhere;
221 221
 }
222 222
 
223 223
 DB::query(
224
-    'SELECT id FROM ' . prefixTable('cache') . "
224
+    'SELECT id FROM '.prefixTable('cache')."
225 225
     ${sWhere}
226 226
     ${sOrder}",
227 227
     $crit
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 $iTotal = DB::count();
230 230
 $rows = DB::query(
231 231
     'SELECT id, label, description, tags, id_tree, perso, restricted_to, login, folder, author, renewal_period, url, timestamp
232
-    FROM ' . prefixTable('cache') . "
232
+    FROM ' . prefixTable('cache')."
233 233
     ${sWhere}
234 234
     ${sOrder}
235 235
     ${sLimit}",
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 if (isset($_GET['type']) === false) {
244 244
     $sOutput = '{';
245 245
     if (isset($_GET['draw']) === true) {
246
-        $sOutput .= '"draw": ' . intval($_GET['draw']) . ', ';
246
+        $sOutput .= '"draw": '.intval($_GET['draw']).', ';
247 247
     }
248 248
     $sOutput .= '"data": [';
249 249
     $sOutputConst = '';
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
             $arrTmp = [];
260 260
             foreach (explode(';', $_SESSION['fonction_id']) as $role) {
261 261
                 $access = DB::queryFirstRow(
262
-                    'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i',
262
+                    'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i',
263 263
                     $role,
264 264
                     $record['id_tree']
265 265
                 );
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
             }
278 278
             $accessLevel = count($arrTmp) > 0 ? min($arrTmp) : $accessLevel;
279 279
             if ($accessLevel === 0) {
280
-                $checkbox = '<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" data-id=\"' . $record['id'] . '\">';
280
+                $checkbox = '<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" data-id=\"'.$record['id'].'\">';
281 281
             }
282 282
 
283 283
             if ((int) $accessLevel === 0) {
@@ -317,22 +317,22 @@  discard block
 block discarded – undo
317 317
             if (empty($restrictedTo)) {
318 318
                 $restrictedTo = $_SESSION['user_id'];
319 319
             } else {
320
-                $restrictedTo .= ',' . $_SESSION['user_id'];
320
+                $restrictedTo .= ','.$_SESSION['user_id'];
321 321
             }
322 322
         }
323 323
 
324 324
         //col1
325
-        $sOutputItem .= '"<i class=\"fa fa-external-link-alt infotip mr-2\" title=\"' . langHdl('open_url_link') . '\" onClick=\"window.location.href=&#039;index.php?page=items&amp;group=' . $record['id_tree'] . '&amp;id=' . $record['id'] . '&#039;\" style=\"cursor:pointer;\"></i>' .
326
-            '<i class=\"fa fa-eye infotip mr-2 item-detail\" title=\"' . langHdl('see_item_title') . '\" data-id=\"' . $record['id'] . '\" data-perso=\"' . $record['perso'] . '\" data-tree-id=\"' . $record['id_tree'] . '\" data-expired=\"' . $expired . '\" data-restricted-to=\"' . $restrictedTo . '\" data-rights=\"' . $right . '\" style=\"cursor:pointer;\"></i>' . $checkbox . '", ';
325
+        $sOutputItem .= '"<i class=\"fa fa-external-link-alt infotip mr-2\" title=\"'.langHdl('open_url_link').'\" onClick=\"window.location.href=&#039;index.php?page=items&amp;group='.$record['id_tree'].'&amp;id='.$record['id'].'&#039;\" style=\"cursor:pointer;\"></i>'.
326
+            '<i class=\"fa fa-eye infotip mr-2 item-detail\" title=\"'.langHdl('see_item_title').'\" data-id=\"'.$record['id'].'\" data-perso=\"'.$record['perso'].'\" data-tree-id=\"'.$record['id_tree'].'\" data-expired=\"'.$expired.'\" data-restricted-to=\"'.$restrictedTo.'\" data-rights=\"'.$right.'\" style=\"cursor:pointer;\"></i>'.$checkbox.'", ';
327 327
         //col2
328
-        $sOutputItem .= '"<span id=\"item_label-' . $record['id'] . '\">' . stripslashes($record['label']) . '</span>", ';
328
+        $sOutputItem .= '"<span id=\"item_label-'.$record['id'].'\">'.stripslashes($record['label']).'</span>", ';
329 329
         //col3
330
-        $sOutputItem .= '"' . str_replace('&amp;', '&', htmlspecialchars(stripslashes($record['login']), ENT_QUOTES)) . '", ';
330
+        $sOutputItem .= '"'.str_replace('&amp;', '&', htmlspecialchars(stripslashes($record['login']), ENT_QUOTES)).'", ';
331 331
         //col4
332 332
         //get restriction from ROles
333 333
         $restrictedToRole = false;
334 334
         $rTmp = DB::queryFirstColumn(
335
-            'SELECT role_id FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id = %i',
335
+            'SELECT role_id FROM '.prefixTable('restriction_to_roles').' WHERE item_id = %i',
336 336
             $record['id']
337 337
         );
338 338
         // We considere here that if user has at least one group similar to the object ones
@@ -350,14 +350,14 @@  discard block
 block discarded – undo
350 350
         } else {
351 351
             $txt = str_replace(['\n', '<br />', '\\'], [' ', ' ', '', ' '], strip_tags($record['description']));
352 352
             if (strlen($txt) > 50) {
353
-                $sOutputItem .= '"' . substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50) . '", ';
353
+                $sOutputItem .= '"'.substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50).'", ';
354 354
             } else {
355
-                $sOutputItem .= '"' . stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt)) . '", ';
355
+                $sOutputItem .= '"'.stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt)).'", ';
356 356
             }
357 357
         }
358 358
 
359 359
         //col5 - TAGS
360
-        $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['tags']), ENT_QUOTES) . '", ';
360
+        $sOutputItem .= '"'.htmlspecialchars(stripslashes($record['tags']), ENT_QUOTES).'", ';
361 361
         // col6 - URL
362 362
         if ($record['url'] !== '0') {
363 363
             $sOutputItem .= '"'.filter_var($record['url'], FILTER_SANITIZE_URL).'", ';
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
         }
367 367
 
368 368
         //col7 - Prepare the Treegrid
369
-        $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['folder']), ENT_QUOTES) . '"';
369
+        $sOutputItem .= '"'.htmlspecialchars(stripslashes($record['folder']), ENT_QUOTES).'"';
370 370
         //Finish the line
371 371
         $sOutputItem .= '], ';
372 372
         if ($getItemInList === true) {
@@ -376,16 +376,16 @@  discard block
 block discarded – undo
376 376
             --$iTotal;
377 377
         }
378 378
     }
379
-    if (! empty($sOutputConst)) {
379
+    if (!empty($sOutputConst)) {
380 380
         $sOutput .= substr_replace($sOutputConst, '', -2);
381 381
     }
382 382
     $sOutput .= '], ';
383
-    $sOutput .= '"recordsTotal": ' . $iTotal . ', ';
384
-    $sOutput .= '"recordsFiltered": ' . $iTotal . ' }';
383
+    $sOutput .= '"recordsTotal": '.$iTotal.', ';
384
+    $sOutput .= '"recordsFiltered": '.$iTotal.' }';
385 385
     echo $sOutput;
386 386
 } elseif (isset($_GET['type']) && ($_GET['type'] === 'search_for_items' || $_GET['type'] === 'search_for_items_with_tags')) {
387 387
     include_once 'main.functions.php';
388
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
388
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
389 389
     $sOutput = '';
390 390
     $init_personal_folder = false;
391 391
     $arr_data = [];
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
         // Anyone can modify?
408 408
         $tmp = DB::queryfirstrow(
409
-            'SELECT anyone_can_modify FROM ' . prefixTable('items') . ' WHERE id = %i',
409
+            'SELECT anyone_can_modify FROM '.prefixTable('items').' WHERE id = %i',
410 410
             $record['id']
411 411
         );
412 412
         if (count($tmp) > 0) {
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
         // => récupérer un tableau contenant les roles associés à cet ID (a partir table restriction_to_roles)
439 439
         $user_is_included_in_role = 0;
440 440
         $roles = DB::query(
441
-            'SELECT role_id FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id=%i',
441
+            'SELECT role_id FROM '.prefixTable('restriction_to_roles').' WHERE item_id=%i',
442 442
             $record['id']
443 443
         );
444 444
         if (count($roles) > 0) {
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
             if (empty($restrictedTo)) {
462 462
                 $restrictedTo = $_SESSION['user_id'];
463 463
             } else {
464
-                $restrictedTo .= ',' . $_SESSION['user_id'];
464
+                $restrictedTo .= ','.$_SESSION['user_id'];
465 465
             }
466 466
         }
467 467
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
         // Get log for this item
470 470
         $logs = DB::query(
471 471
             'SELECT *
472
-            FROM ' . prefixTable('log_items') . '
472
+            FROM ' . prefixTable('log_items').'
473 473
             WHERE id_item = %i AND action = %s AND id_user = %i',
474 474
             $record['id'],
475 475
             'at_creation',
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
             $arrTmp = [];
569 569
             foreach (explode(';', $_SESSION['fonction_id']) as $role) {
570 570
                 $access = DB::queryFirstRow(
571
-                    'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i',
571
+                    'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i',
572 572
                     $role,
573 573
                     $record['id_tree']
574 574
                 );
@@ -617,8 +617,8 @@  discard block
 block discarded – undo
617 617
         ) {
618 618
             $data_item = DB::queryFirstRow(
619 619
                 'SELECT i.pw AS pw, s.share_key AS share_key
620
-                FROM ' . prefixTable('items') . ' AS i
621
-                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
620
+                FROM ' . prefixTable('items').' AS i
621
+                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
622 622
                 WHERE i.id = %i AND s.user_id = %i',
623 623
                 $record['id'],
624 624
                 $_SESSION['user_id']
Please login to merge, or discard this patch.
sources/tree.php 1 patch
Spacing   +53 added lines, -58 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 }
48 48
 
49 49
 // includes
50
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
51
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
52
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
53
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
54
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
50
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
51
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
52
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
53
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
54
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
55 55
 // header
56 56
 header('Content-type: text/html; charset=utf-8');
57 57
 header('Cache-Control: no-cache, must-revalidate');
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 }
64 64
 
65 65
 // Connect to mysql server
66
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
66
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
67 67
 if (defined('DB_PASSWD_CLEAR') === false) {
68 68
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
69 69
 }
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
 DB::$port = DB_PORT;
75 75
 DB::$encoding = DB_ENCODING;
76 76
 // Superglobal load
77
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
77
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
78 78
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
79 79
 $session_user_admin = $superGlobal->get('user_admin', 'GET');
80 80
 $sessionTreeStructure = $superGlobal->get('user_tree_structure', 'GET');
81 81
 $sessionLastTreeRefresh = $superGlobal->get('user_tree_last_refresh_timestamp', 'GET');
82 82
 $lastFolderChange = DB::query(
83
-    'SELECT * FROM ' . prefixTable('misc') . '
83
+    'SELECT * FROM '.prefixTable('misc').'
84 84
     WHERE type = %s AND intitule = %s',
85 85
     'timestamp',
86 86
     'last_folder_change'
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     || (isset($_GET['force_refresh']) === true && (int) $_GET['force_refresh'] === 1)
92 92
 ) {
93 93
     // Build tree
94
-    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
94
+    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
95 95
     $tree->register();
96 96
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
97 97
     if (
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     array $SETTINGS
188 188
 ): array {
189 189
     // Load library
190
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
190
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
191 191
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
192 192
     // Prepare superGlobal variables
193 193
     $session_forbiden_pfs = $superGlobal->get('forbiden_pfs', 'SESSION');
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                 // get count of Items in this folder
237 237
                 DB::query(
238 238
                     'SELECT *
239
-                    FROM ' . prefixTable('items') . '
239
+                    FROM ' . prefixTable('items').'
240 240
                     WHERE inactif=%i AND id_tree = %i',
241 241
                     0,
242 242
                     $node->id
@@ -245,54 +245,50 @@  discard block
 block discarded – undo
245 245
                 // get info about current folder
246 246
                 DB::query(
247 247
                     'SELECT *
248
-                    FROM ' . prefixTable('nested_tree') . '
248
+                    FROM ' . prefixTable('nested_tree').'
249 249
                     WHERE parent_id = %i',
250 250
                     $node->id
251 251
                 );
252 252
                 $childrenNb = DB::count();
253 253
                 // If personal Folder, convert id into user name
254 254
                 $node->title = $node->title === $session_user_id && (int) $node->nlevel === 1 ?
255
-                    $session_login :
256
-                    ($node->title === null ? '' : htmlspecialchars_decode($node->title, ENT_QUOTES));
255
+                    $session_login : ($node->title === null ? '' : htmlspecialchars_decode($node->title, ENT_QUOTES));
257 256
                 // prepare json return for current node
258
-                $parent = $node->parent_id === 0 ? '#' : 'li_' . $node->parent_id;
257
+                $parent = $node->parent_id === 0 ? '#' : 'li_'.$node->parent_id;
259 258
                 // special case for READ-ONLY folder
260
-                $title = $session_user_read_only === true && ! in_array($node->id, $session_personal_folders) ? langHdl('read_only_account') : $title;
259
+                $title = $session_user_read_only === true && !in_array($node->id, $session_personal_folders) ? langHdl('read_only_account') : $title;
261 260
                 $text .= str_replace('&', '&amp;', $node->title);
262 261
                 $restricted = '0';
263 262
                 $folderClass = 'folder';
264 263
                 if (in_array($node->id, $session_groupes_visibles)) {
265 264
                     if (in_array($node->id, $session_read_only_folders)) {
266
-                        $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
265
+                        $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
267 266
                         $title = langHdl('read_only_account');
268 267
                         $restricted = 1;
269 268
                         $folderClass = 'folder_not_droppable';
270
-                    } elseif ($session_user_read_only === true && ! in_array($node->id, $session_personal_visible_groups)) {
271
-                        $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
269
+                    } elseif ($session_user_read_only === true && !in_array($node->id, $session_personal_visible_groups)) {
270
+                        $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
272 271
                     }
273 272
                     $text .=
274
-                        ' <span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_' . $node->id . '\'>' . $itemsNb . '</span>'
273
+                        ' <span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_'.$node->id.'\'>'.$itemsNb.'</span>'
275 274
                         .(isset($SETTINGS['tree_counters']) && $SETTINGS['tree_counters'] === 1 ?
276
-                            '/'.$nbChildrenItems .
277
-                            '/'.(count($nodeDescendants) - 1) :
278
-                            '')
275
+                            '/'.$nbChildrenItems.
276
+                            '/'.(count($nodeDescendants) - 1) : '')
279 277
                         .'</span>';
280 278
                 } elseif (in_array($node->id, $listFoldersLimitedKeys)) {
281 279
                     $restricted = '1';
282 280
                     $text .=
283 281
                         $session_user_read_only === true ?
284
-                            "<i class='far fa-eye fa-xs mr-1'></i>" :
285
-                            ''
286
-                        .'<span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_' . $node->id . '\'>' . count($session_list_folders_limited[$node->id]) . '</span>';
282
+                            "<i class='far fa-eye fa-xs mr-1'></i>" : ''
283
+                        .'<span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_'.$node->id.'\'>'.count($session_list_folders_limited[$node->id]).'</span>';
287 284
                 } elseif (in_array($node->id, $listRestrictedFoldersForItemsKeys)) {
288 285
                     $restricted = '1';
289 286
                     if ($session_user_read_only === true) {
290
-                        $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
287
+                        $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
291 288
                     }
292 289
                     $text .= $session_user_read_only === true ?
293
-                        "<i class='far fa-eye fa-xs mr-1'></i>" :
294
-                        ''
295
-                        . '<span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_' . $node->id . '\'>' . count($session_list_restricted_folders_for_items[$node->id]) . '</span>';
290
+                        "<i class='far fa-eye fa-xs mr-1'></i>" : ''
291
+                        . '<span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_'.$node->id.'\'>'.count($session_list_restricted_folders_for_items[$node->id]).'</span>';
296 292
                 } else {
297 293
                     $restricted = '1';
298 294
                     $folderClass = 'folder_not_droppable';
@@ -318,18 +314,18 @@  discard block
 block discarded – undo
318 314
                     array_push(
319 315
                         $ret_json,
320 316
                         [
321
-                            'id' => 'li_' . $node->id,
317
+                            'id' => 'li_'.$node->id,
322 318
                             'parent' => $parent,
323 319
                             'text' => $text,
324 320
                             'children' => $childrenNb === 0 ? false : true,
325 321
                             'li_attr' => [
326 322
                                 'class' => 'jstreeopen',
327
-                                'title' => 'ID [' . $node->id . '] ' . $title,
323
+                                'title' => 'ID ['.$node->id.'] '.$title,
328 324
                             ],
329 325
                             'a_attr' => [
330
-                                'id' => 'fld_' . $node->id,
326
+                                'id' => 'fld_'.$node->id,
331 327
                                 'class' => $folderClass,
332
-                                'onclick' => 'ListerItems(' . $node->id . ', ' . $restricted . ', 0, 1)',
328
+                                'onclick' => 'ListerItems('.$node->id.', '.$restricted.', 0, 1)',
333 329
                                 'data-title' => $node->title,
334 330
                             ],
335 331
                         ]
@@ -338,13 +334,13 @@  discard block
 block discarded – undo
338 334
                     array_push(
339 335
                         $ret_json,
340 336
                         [
341
-                            'id' => 'li_' . $node->id,
337
+                            'id' => 'li_'.$node->id,
342 338
                             'parent' => $parent,
343 339
                             'children' => $childrenNb === 0 ? false : true,
344
-                            'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>' . $text,
340
+                            'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>'.$text,
345 341
                             'li_attr' => [
346 342
                                 'class' => '',
347
-                                'title' => 'ID [' . $node->id . '] ' . langHdl('no_access'),
343
+                                'title' => 'ID ['.$node->id.'] '.langHdl('no_access'),
348 344
                             ],
349 345
                         ]
350 346
                     );
@@ -394,7 +390,7 @@  discard block
 block discarded – undo
394 390
     }
395 391
 
396 392
     // Load library
397
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
393
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
398 394
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
399 395
     // Prepare superGlobal variables
400 396
     $session_forbiden_pfs = $superGlobal->get('forbiden_pfs', 'SESSION');
@@ -427,7 +423,7 @@  discard block
 block discarded – undo
427 423
                 ) === true
428 424
             ) {
429 425
                 DB::query(
430
-                    'SELECT * FROM ' . prefixTable('items') . '
426
+                    'SELECT * FROM '.prefixTable('items').'
431 427
                     WHERE inactif=%i AND id_tree = %i',
432 428
                     0,
433 429
                     $node
@@ -457,7 +453,7 @@  discard block
 block discarded – undo
457 453
         if ($displayThisNode === true) {
458 454
             // get info about current folder
459 455
             DB::query(
460
-                'SELECT * FROM ' . prefixTable('items') . '
456
+                'SELECT * FROM '.prefixTable('items').'
461 457
                 WHERE inactif=%i AND id_tree = %i',
462 458
                 0,
463 459
                 $completTree[$nodeId]->id
@@ -482,7 +478,7 @@  discard block
 block discarded – undo
482 478
             $folderClass = 'folder';
483 479
             if (in_array($completTree[$nodeId]->id, $session_groupes_visibles) === true) {
484 480
                 if (in_array($completTree[$nodeId]->id, $session_read_only_folders) === true) {
485
-                    $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
481
+                    $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
486 482
                     $title = langHdl('read_only_account');
487 483
                     $restricted = 1;
488 484
                     $folderClass = 'folder_not_droppable';
@@ -490,27 +486,26 @@  discard block
 block discarded – undo
490 486
                     $session_user_read_only === true
491 487
                     && in_array($completTree[$nodeId]->id, $session_personal_visible_groups) === false
492 488
                 ) {
493
-                    $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
489
+                    $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
494 490
                 }
495 491
                 $text .=
496
-                    '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_' . $completTree[$nodeId]->id . '\'>' . $itemsNb .
492
+                    '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_'.$completTree[$nodeId]->id.'\'>'.$itemsNb.
497 493
                     (isset($SETTINGS['tree_counters']) === true && (int) $SETTINGS['tree_counters'] === 1 ?
498
-                        '/'.$nbChildrenItems .
499
-                        '/'.(count($nodeDescendants) - 1) :
500
-                        '')
494
+                        '/'.$nbChildrenItems.
495
+                        '/'.(count($nodeDescendants) - 1) : '')
501 496
                     . '</span>';
502 497
             } elseif (in_array($completTree[$nodeId]->id, $listFoldersLimitedKeys) === true) {
503 498
                 $restricted = '1';
504 499
                 if ($session_user_read_only === true) {
505
-                    $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
500
+                    $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
506 501
                 }
507
-                $text .= '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_' . $completTree[$nodeId]->id . '\'>' . count($session_list_folders_limited[$completTree[$nodeId]->id]);
502
+                $text .= '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_'.$completTree[$nodeId]->id.'\'>'.count($session_list_folders_limited[$completTree[$nodeId]->id]);
508 503
             } elseif (in_array($completTree[$nodeId]->id, $listRestrictedFoldersForItemsKeys) === true) {
509 504
                 $restricted = '1';
510 505
                 if ($session_user_read_only === true) {
511
-                    $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
506
+                    $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
512 507
                 }
513
-                $text .= '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_' . $completTree[$nodeId]->id . '\'>' . count($session_list_restricted_folders_for_items[$completTree[$nodeId]->id]) . '</span>';
508
+                $text .= '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_'.$completTree[$nodeId]->id.'\'>'.count($session_list_restricted_folders_for_items[$completTree[$nodeId]->id]).'</span>';
514 509
             } else {
515 510
                 $restricted = '1';
516 511
                 $folderClass = 'folder_not_droppable';
@@ -547,7 +542,7 @@  discard block
 block discarded – undo
547 542
             }
548 543
 
549 544
             // prepare json return for current node
550
-            $parent = $completTree[$nodeId]->parent_id === '0' ? '#' : 'li_' . $completTree[$nodeId]->parent_id;
545
+            $parent = $completTree[$nodeId]->parent_id === '0' ? '#' : 'li_'.$completTree[$nodeId]->parent_id;
551 546
             // handle displaying
552 547
             if (
553 548
                 isset($SETTINGS['show_only_accessible_folders']) === true
@@ -566,17 +561,17 @@  discard block
 block discarded – undo
566 561
                 array_push(
567 562
                     $ret_json,
568 563
                     [
569
-                        'id' => 'li_' . $completTree[$nodeId]->id,
564
+                        'id' => 'li_'.$completTree[$nodeId]->id,
570 565
                         'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent,
571 566
                         'text' => $text,
572 567
                         'li_attr' => [
573 568
                             'class' => 'jstreeopen',
574
-                            'title' => 'ID [' . $completTree[$nodeId]->id . '] ' . $title,
569
+                            'title' => 'ID ['.$completTree[$nodeId]->id.'] '.$title,
575 570
                         ],
576 571
                         'a_attr' => [
577
-                            'id' => 'fld_' . $completTree[$nodeId]->id,
572
+                            'id' => 'fld_'.$completTree[$nodeId]->id,
578 573
                             'class' => $folderClass,
579
-                            'onclick' => 'ListerItems(' . $completTree[$nodeId]->id . ', ' . $restricted . ', 0, 1)',
574
+                            'onclick' => 'ListerItems('.$completTree[$nodeId]->id.', '.$restricted.', 0, 1)',
580 575
                             'data-title' => $completTree[$nodeId]->title,
581 576
                         ],
582 577
                     ]
@@ -585,12 +580,12 @@  discard block
 block discarded – undo
585 580
                 array_push(
586 581
                     $ret_json,
587 582
                     [
588
-                        'id' => 'li_' . $completTree[$nodeId]->id,
583
+                        'id' => 'li_'.$completTree[$nodeId]->id,
589 584
                         'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent,
590
-                        'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>' . $text,
585
+                        'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>'.$text,
591 586
                         'li_attr' => [
592 587
                             'class' => '',
593
-                            'title' => 'ID [' . $completTree[$nodeId]->id . '] ' . langHdl('no_access'),
588
+                            'title' => 'ID ['.$completTree[$nodeId]->id.'] '.langHdl('no_access'),
594 589
                         ],
595 590
                     ]
596 591
                 );
Please login to merge, or discard this patch.
sources/aes.functions.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -81,9 +81,9 @@
 block discarded – undo
81 81
             // Decrypt and retreive data in JSON format
82 82
 
83 83
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           $dataReceived = prepareExchangedData(
84
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              $post_data,
85
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              'decode'
86
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          );
84
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                $post_data,
85
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                'decode'
86
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            );
87 87
 $post_user_id = filter_var($dataReceived['user_id'], FILTER_SANITIZE_NUMBER_INT);
88 88
 $post_user_pwd = filter_var($dataReceived['user_pwd'], FILTER_SANITIZE_STRING);
89 89
 // Get user info
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 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,12 +42,12 @@  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'], 'items', $SETTINGS) === false) {
48 48
     // Not allowed page
49 49
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
     date_default_timezone_set('UTC');
61 61
 }
62 62
 
63
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
64
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
63
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
64
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
65 65
 header('Content-type: text/html; charset=utf-8');
66 66
 header('Cache-Control: no-cache, must-revalidate');
67 67
 require_once 'main.functions.php';
68 68
 // Connect to mysql server
69
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
69
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
70 70
 $link = mysqli_connect(DB_HOST, DB_USER, defuseReturnDecrypted(DB_PASSWD, $SETTINGS), DB_NAME, (int) DB_PORT, null);
71 71
 // Protect POST
72 72
 $post_type = filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING);
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 // Get user info
90 90
             $userInfo = DB::queryFirstRow(
91 91
                 'SELECT id, public_key, private_key
92
-                FROM ' . prefixTable('users') . '
92
+                FROM ' . prefixTable('users').'
93 93
                 WHERE id = %i',
94 94
                 $post_user_id
95 95
             );
Please login to merge, or discard this patch.
sources/utilities.queries.php 2 patches
Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -90,25 +90,25 @@  discard block
 block discarded – undo
90 90
             // Check KEY
91 91
 
92 92
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       if ($post_key !== $_SESSION['key']) {
93
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          echo prepareExchangedData(
94
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [
95
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'error' => true,
96
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'message' => langHdl('key_is_not_correct'),
97
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ],
98
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              'encode'
99
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          );
100
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          break;
101
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }
102
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      if ($_SESSION['user_read_only'] === true) {
103
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          echo prepareExchangedData(
104
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [
105
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'error' => true,
106
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'message' => langHdl('error_not_allowed_to'),
107
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ],
108
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              'encode'
109
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          );
110
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          break;
111
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }
93
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            echo prepareExchangedData(
94
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [
95
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'error' => true,
96
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'message' => langHdl('key_is_not_correct'),
97
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ],
98
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                'encode'
99
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            );
100
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            break;
101
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }
102
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        if ($_SESSION['user_read_only'] === true) {
103
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            echo prepareExchangedData(
104
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [
105
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'error' => true,
106
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'message' => langHdl('error_not_allowed_to'),
107
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ],
108
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                'encode'
109
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            );
110
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            break;
111
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }
112 112
 
113 113
             // Get list of deleted FOLDERS
114 114
             $arrFolders = [];
@@ -186,25 +186,25 @@  discard block
 block discarded – undo
186 186
             // Check KEY
187 187
 
188 188
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       if ($post_key !== $_SESSION['key']) {
189
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          echo prepareExchangedData(
190
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [
191
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'error' => true,
192
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'message' => langHdl('key_is_not_correct'),
193
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ],
194
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              'encode'
195
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          );
196
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          break;
197
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }
198
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      if ($_SESSION['user_read_only'] === true) {
199
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          echo prepareExchangedData(
200
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [
201
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'error' => true,
202
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'message' => langHdl('error_not_allowed_to'),
203
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ],
204
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              'encode'
205
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          );
206
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          break;
207
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }
189
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            echo prepareExchangedData(
190
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [
191
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'error' => true,
192
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'message' => langHdl('key_is_not_correct'),
193
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ],
194
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                'encode'
195
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            );
196
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            break;
197
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }
198
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        if ($_SESSION['user_read_only'] === true) {
199
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            echo prepareExchangedData(
200
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [
201
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'error' => true,
202
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'message' => langHdl('error_not_allowed_to'),
203
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ],
204
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                'encode'
205
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            );
206
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            break;
207
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }
208 208
 
209 209
             // decrypt and retrieve data in JSON format
210 210
             $dataReceived = prepareExchangedData($post_data, 'decode');
@@ -312,25 +312,25 @@  discard block
 block discarded – undo
312 312
             // Check KEY
313 313
 
314 314
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       if ($post_key !== $_SESSION['key']) {
315
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          echo prepareExchangedData(
316
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [
317
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'error' => true,
318
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'message' => langHdl('key_is_not_correct'),
319
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ],
320
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              'encode'
321
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          );
322
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          break;
323
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }
324
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      if ($_SESSION['user_read_only'] === true) {
325
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          echo prepareExchangedData(
326
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [
327
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'error' => true,
328
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'message' => langHdl('error_not_allowed_to'),
329
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ],
330
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              'encode'
331
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          );
332
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          break;
333
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }
315
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            echo prepareExchangedData(
316
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [
317
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'error' => true,
318
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'message' => langHdl('key_is_not_correct'),
319
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ],
320
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                'encode'
321
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            );
322
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            break;
323
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }
324
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        if ($_SESSION['user_read_only'] === true) {
325
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            echo prepareExchangedData(
326
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [
327
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'error' => true,
328
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'message' => langHdl('error_not_allowed_to'),
329
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ],
330
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                'encode'
331
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            );
332
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            break;
333
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }
334 334
 
335 335
             // decrypt and retrieve data in JSON format
336 336
             $dataReceived = prepareExchangedData($post_data, 'decode');
@@ -434,25 +434,25 @@  discard block
 block discarded – undo
434 434
             // Check KEY
435 435
 
436 436
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       if ($post_key !== $_SESSION['key']) {
437
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          echo prepareExchangedData(
438
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [
439
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'error' => true,
440
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'message' => langHdl('key_is_not_correct'),
441
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ],
442
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              'encode'
443
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          );
444
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          break;
445
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }
446
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      if ($_SESSION['user_read_only'] === true) {
447
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          echo prepareExchangedData(
448
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [
449
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'error' => true,
450
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'message' => langHdl('error_not_allowed_to'),
451
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ],
452
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              'encode'
453
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          );
454
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          break;
455
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }
437
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            echo prepareExchangedData(
438
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [
439
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'error' => true,
440
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'message' => langHdl('key_is_not_correct'),
441
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ],
442
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                'encode'
443
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            );
444
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            break;
445
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }
446
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        if ($_SESSION['user_read_only'] === true) {
447
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            echo prepareExchangedData(
448
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [
449
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'error' => true,
450
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    'message' => langHdl('error_not_allowed_to'),
451
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ],
452
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                'encode'
453
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            );
454
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            break;
455
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }
456 456
 
457 457
             // decrypt and retrieve data in JSON format
458 458
             $dataReceived = prepareExchangedData($post_data, 'decode');
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 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,12 +42,12 @@  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'], 'utilities.database', $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
 
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
     date_default_timezone_set('UTC');
61 61
 }
62 62
 
63
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
64
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
63
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
64
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
65 65
 header('Content-type: text/html; charset=utf-8');
66 66
 header('Cache-Control: no-cache, must-revalidate');
67 67
 require_once 'main.functions.php';
68 68
 //Connect to DB
69
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
69
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
70 70
 if (defined('DB_PASSWD_CLEAR') === false) {
71 71
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
72 72
 }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             $arrFolders = [];
115 115
 $rows = DB::query(
116 116
     'SELECT valeur, intitule
117
-                FROM ' . prefixTable('misc') . '
117
+                FROM ' . prefixTable('misc').'
118 118
                 WHERE type  = %s',
119 119
     'folder_deleted'
120 120
 );
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
     'SELECT u.login as login, u.name as name, u.lastname as lastname,
136 136
                 i.id as id, i.label as label,
137 137
                 i.id_tree as id_tree, l.date as date, n.title as folder_title
138
-                FROM ' . prefixTable('log_items') . ' as l
139
-                INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id)
140
-                INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
141
-                INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree=n.id)
138
+                FROM ' . prefixTable('log_items').' as l
139
+                INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id)
140
+                INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
141
+                INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree=n.id)
142 142
                 WHERE i.inactif = %i
143 143
                 AND l.action = %s',
144 144
     1,
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                 'label' => $record['label'],
161 161
                 'date' => date($SETTINGS['date_format'], $record['date']),
162 162
                 'login' => $record['login'],
163
-                'name' => $record['name'] . ' ' . $record['lastname'],
163
+                'name' => $record['name'].' '.$record['lastname'],
164 164
                 'folder_label' => $record['folder_title'],
165 165
                 'folder_deleted' => $thisFolder,
166 166
             ]
@@ -215,10 +215,10 @@  discard block
 block discarded – undo
215 215
             foreach ($post_folders as $folderId) {
216 216
                 $data = DB::queryfirstrow(
217 217
                     'SELECT valeur
218
-                    FROM ' . prefixTable('misc') . "
218
+                    FROM ' . prefixTable('misc')."
219 219
                     WHERE type = 'folder_deleted'
220 220
                     AND intitule = %s",
221
-                    'f' . $folderId
221
+                    'f'.$folderId
222 222
                 );
223 223
                 if ((int) $data['valeur'] !== 0) {
224 224
                     $folderData = explode(', ', $data['valeur']);
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
                         prefixTable('misc'),
244 244
                         'type = %s AND intitule = %s',
245 245
                         'folder_deleted',
246
-                        'f' . $folderId
246
+                        'f'.$folderId
247 247
                     );
248 248
                     // Restore all items in this folder
249 249
                     DB::update(
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
                     // Get list of all items in thos folder
258 258
                     $items = DB::query(
259 259
                         'SELECT id
260
-                        FROM ' . prefixTable('items') . '
260
+                        FROM ' . prefixTable('items').'
261 261
                         WHERE id_tree = %i',
262 262
                         $folderId
263 263
                     );
@@ -341,10 +341,10 @@  discard block
 block discarded – undo
341 341
             foreach ($post_folders as $folderId) {
342 342
                 $data = DB::queryfirstrow(
343 343
                     'SELECT valeur
344
-                    FROM ' . prefixTable('misc') . "
344
+                    FROM ' . prefixTable('misc')."
345 345
                     WHERE type = 'folder_deleted'
346 346
                     AND intitule = %s",
347
-                    'f' . $folderId
347
+                    'f'.$folderId
348 348
                 );
349 349
                 if ((int) $data['valeur'] !== 0) {
350 350
                     $folderData = explode(', ', $data['valeur']);
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
                         prefixTable('misc'),
376 376
                         'type = %s AND intitule = %s',
377 377
                         'folder_deleted',
378
-                        'f' . $folderData[0]
378
+                        'f'.$folderData[0]
379 379
                     );
380 380
                     // Delete all items in this folder
381 381
                     DB::delete(
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
                     // Get list of all items in thos folder
388 388
                     $items = DB::query(
389 389
                         'SELECT id
390
-                        FROM ' . prefixTable('items') . '
390
+                        FROM ' . prefixTable('items').'
391 391
                         WHERE id_tree = %i',
392 392
                         $folderData[0]
393 393
                     );
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
             ) {
482 482
                 if ($post_log_type === 'items') {
483 483
                     DB::query(
484
-                        'SELECT * FROM ' . prefixTable('log_items') . '
484
+                        'SELECT * FROM '.prefixTable('log_items').'
485 485
                         WHERE action=%s ' .  'AND date BETWEEN %i AND %i'
486 486
                         . ($post_filter_action === 'all' ? '' : ' AND action = %s')
487 487
                         . ($post_filter_user === -1 ? '' : ' AND id_user = %i'),
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
                 } elseif ($post_log_type === 'connections') {
504 504
                     db::debugmode(true);
505 505
                     DB::query(
506
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
506
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
507 507
                             'AND date BETWEEN %i AND %i',
508 508
                         'user_connection',
509 509
                         $post_date_from,
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
                     );
521 521
                 } elseif ($post_log_type === 'errors') {
522 522
                     DB::query(
523
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
523
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
524 524
                             'AND date BETWEEN %i AND %i',
525 525
                         'error',
526 526
                         $post_date_from,
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
                     );
538 538
                 } elseif ($post_log_type === 'copy') {
539 539
                     DB::query(
540
-                        'SELECT * FROM ' . prefixTable('log_items') . ' WHERE action=%s ' .
540
+                        'SELECT * FROM '.prefixTable('log_items').' WHERE action=%s '.
541 541
                             'AND date BETWEEN %i AND %i',
542 542
                         'at_copy',
543 543
                         $post_date_from,
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
                     );
555 555
                 } elseif ($post_log_type === 'admin') {
556 556
                     DB::query(
557
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
557
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
558 558
                             'AND date BETWEEN %i AND %i',
559 559
                         'admin_action',
560 560
                         $post_date_from,
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
                     );
572 572
                 } elseif ($post_log_type === 'failed') {
573 573
                     DB::query(
574
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
574
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
575 575
                             'AND date BETWEEN %i AND %i',
576 576
                         'failed_auth',
577 577
                         $post_date_from,
Please login to merge, or discard this patch.
sources/main.functions.php 1 patch
Spacing   +229 added lines, -229 removed lines patch added patch discarded remove patch
@@ -116,24 +116,24 @@  discard block
 block discarded – undo
116 116
  */
117 117
 function cryption(string $message, string $ascii_key, string $type, array $SETTINGS): array
118 118
 {
119
-    $ascii_key = empty($ascii_key) === true ? file_get_contents(SECUREPATH . '/teampass-seckey.txt') : $ascii_key;
119
+    $ascii_key = empty($ascii_key) === true ? file_get_contents(SECUREPATH.'/teampass-seckey.txt') : $ascii_key;
120 120
     $err = false;
121 121
     // load PhpEncryption library
122 122
     if (isset($SETTINGS['cpassman_dir']) === false || empty($SETTINGS['cpassman_dir']) === true) {
123 123
         $path = '../includes/libraries/Encryption/Encryption/';
124 124
     } else {
125
-        $path = $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/';
126
-    }
127
-
128
-    include_once $path . 'Crypto.php';
129
-    include_once $path . 'Encoding.php';
130
-    include_once $path . 'DerivedKeys.php';
131
-    include_once $path . 'Key.php';
132
-    include_once $path . 'KeyOrPassword.php';
133
-    include_once $path . 'File.php';
134
-    include_once $path . 'RuntimeTests.php';
135
-    include_once $path . 'KeyProtectedByPassword.php';
136
-    include_once $path . 'Core.php';
125
+        $path = $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/';
126
+    }
127
+
128
+    include_once $path.'Crypto.php';
129
+    include_once $path.'Encoding.php';
130
+    include_once $path.'DerivedKeys.php';
131
+    include_once $path.'Key.php';
132
+    include_once $path.'KeyOrPassword.php';
133
+    include_once $path.'File.php';
134
+    include_once $path.'RuntimeTests.php';
135
+    include_once $path.'KeyProtectedByPassword.php';
136
+    include_once $path.'Core.php';
137 137
     // convert KEY
138 138
     $key = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key);
139 139
     try {
@@ -175,15 +175,15 @@  discard block
 block discarded – undo
175 175
         $path = '../includes/libraries/Encryption/Encryption/';
176 176
     }
177 177
 
178
-    include_once $path . 'Crypto.php';
179
-    include_once $path . 'Encoding.php';
180
-    include_once $path . 'DerivedKeys.php';
181
-    include_once $path . 'Key.php';
182
-    include_once $path . 'KeyOrPassword.php';
183
-    include_once $path . 'File.php';
184
-    include_once $path . 'RuntimeTests.php';
185
-    include_once $path . 'KeyProtectedByPassword.php';
186
-    include_once $path . 'Core.php';
178
+    include_once $path.'Crypto.php';
179
+    include_once $path.'Encoding.php';
180
+    include_once $path.'DerivedKeys.php';
181
+    include_once $path.'Key.php';
182
+    include_once $path.'KeyOrPassword.php';
183
+    include_once $path.'File.php';
184
+    include_once $path.'RuntimeTests.php';
185
+    include_once $path.'KeyProtectedByPassword.php';
186
+    include_once $path.'Core.php';
187 187
     $key = \Defuse\Crypto\Key::createNewRandomKey();
188 188
     $key = $key->saveToAsciiSafeString();
189 189
     return $key;
@@ -205,15 +205,15 @@  discard block
 block discarded – undo
205 205
         $path = '../includes/libraries/Encryption/Encryption/';
206 206
     }
207 207
 
208
-    include_once $path . 'Crypto.php';
209
-    include_once $path . 'Encoding.php';
210
-    include_once $path . 'DerivedKeys.php';
211
-    include_once $path . 'Key.php';
212
-    include_once $path . 'KeyOrPassword.php';
213
-    include_once $path . 'File.php';
214
-    include_once $path . 'RuntimeTests.php';
215
-    include_once $path . 'KeyProtectedByPassword.php';
216
-    include_once $path . 'Core.php';
208
+    include_once $path.'Crypto.php';
209
+    include_once $path.'Encoding.php';
210
+    include_once $path.'DerivedKeys.php';
211
+    include_once $path.'Key.php';
212
+    include_once $path.'KeyOrPassword.php';
213
+    include_once $path.'File.php';
214
+    include_once $path.'RuntimeTests.php';
215
+    include_once $path.'KeyProtectedByPassword.php';
216
+    include_once $path.'Core.php';
217 217
     $protected_key = \Defuse\Crypto\KeyProtectedByPassword::createRandomPasswordProtectedKey($psk);
218 218
     return $protected_key->saveToAsciiSafeString(); // save this in user table
219 219
 }
@@ -235,15 +235,15 @@  discard block
 block discarded – undo
235 235
         $path = '../includes/libraries/Encryption/Encryption/';
236 236
     }
237 237
 
238
-    include_once $path . 'Crypto.php';
239
-    include_once $path . 'Encoding.php';
240
-    include_once $path . 'DerivedKeys.php';
241
-    include_once $path . 'Key.php';
242
-    include_once $path . 'KeyOrPassword.php';
243
-    include_once $path . 'File.php';
244
-    include_once $path . 'RuntimeTests.php';
245
-    include_once $path . 'KeyProtectedByPassword.php';
246
-    include_once $path . 'Core.php';
238
+    include_once $path.'Crypto.php';
239
+    include_once $path.'Encoding.php';
240
+    include_once $path.'DerivedKeys.php';
241
+    include_once $path.'Key.php';
242
+    include_once $path.'KeyOrPassword.php';
243
+    include_once $path.'File.php';
244
+    include_once $path.'RuntimeTests.php';
245
+    include_once $path.'KeyProtectedByPassword.php';
246
+    include_once $path.'Core.php';
247 247
     try {
248 248
         $protected_key = \Defuse\Crypto\KeyProtectedByPassword::loadFromAsciiSafeString($protected_key_encoded);
249 249
         $user_key = $protected_key->unlockKey($psk);
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
  * @param string|array $chaine  what to trim
281 281
  * @param string       $element trim on what
282 282
  */
283
-function trimElement(string|array $chaine, string $element): string
283
+function trimElement(string | array $chaine, string $element): string
284 284
 {
285
-    if (! empty($chaine)) {
285
+    if (!empty($chaine)) {
286 286
         if (is_array($chaine) === true) {
287 287
             $chaine = implode(';', $chaine);
288 288
         }
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
  */
327 327
 function db_error_handler(array $params): void
328 328
 {
329
-    echo 'Error: ' . $params['error'] . "<br>\n";
330
-    echo 'Query: ' . $params['query'] . "<br>\n";
329
+    echo 'Error: '.$params['error']."<br>\n";
330
+    echo 'Query: '.$params['query']."<br>\n";
331 331
     throw new Exception('Error - Query', 1);
332 332
 }
333 333
 
@@ -349,12 +349,12 @@  discard block
 block discarded – undo
349 349
     $SETTINGS
350 350
 ): string {
351 351
     //load ClassLoader
352
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
352
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
353 353
     // Load superglobal
354
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
354
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
355 355
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
356 356
     //Connect to DB
357
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
357
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
358 358
     if (defined('DB_PASSWD_CLEAR') === false) {
359 359
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
360 360
     }
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
     DB::$port = DB_PORT;
366 366
     DB::$encoding = DB_ENCODING;
367 367
     //Build tree
368
-    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
368
+    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
369 369
     $tree->register();
370 370
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
371 371
     // Check if user is ADMINISTRATOR
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 function identAdmin(string $idFonctions, array $SETTINGS, array $tree): void
407 407
 {
408 408
     // Load superglobal
409
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
409
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
410 410
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
411 411
     // Init
412 412
     $groupesVisibles = [];
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
     $globalsVisibleFolders = $superGlobal->get('groupes_visibles', 'SESSION');
426 426
     $globalsPersonalVisibleFolders = $superGlobal->get('personal_visible_groups', 'SESSION');
427 427
     // Get list of Folders
428
-    $rows = DB::query('SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0);
428
+    $rows = DB::query('SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0);
429 429
     foreach ($rows as $record) {
430 430
         array_push($groupesVisibles, $record['id']);
431 431
     }
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
     }
445 445
     // Get ID of personal folder
446 446
     $persfld = DB::queryfirstrow(
447
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %s',
447
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %s',
448 448
         $globalsUserId
449 449
     );
450 450
     if (empty($persfld['id']) === false) {
@@ -465,20 +465,20 @@  discard block
 block discarded – undo
465 465
     // get complete list of ROLES
466 466
     $tmp = explode(';', $idFonctions);
467 467
     $rows = DB::query(
468
-    'SELECT * FROM ' . prefixTable('roles_title') . '
468
+    'SELECT * FROM '.prefixTable('roles_title').'
469 469
         ORDER BY title ASC'
470 470
 );
471 471
     foreach ($rows as $record) {
472
-        if (! empty($record['id']) && ! in_array($record['id'], $tmp)) {
472
+        if (!empty($record['id']) && !in_array($record['id'], $tmp)) {
473 473
             array_push($tmp, $record['id']);
474 474
         }
475 475
     }
476 476
     $superGlobal->put('fonction_id', implode(';', $tmp), 'SESSION');
477 477
     $superGlobal->put('is_admin', 1, 'SESSION');
478 478
     // Check if admin has created Folders and Roles
479
-    DB::query('SELECT * FROM ' . prefixTable('nested_tree') . '');
479
+    DB::query('SELECT * FROM '.prefixTable('nested_tree').'');
480 480
     $superGlobal->put('nb_folders', DB::count(), 'SESSION');
481
-    DB::query('SELECT * FROM ' . prefixTable('roles_title'));
481
+    DB::query('SELECT * FROM '.prefixTable('roles_title'));
482 482
     $superGlobal->put('nb_roles', DB::count(), 'SESSION');
483 483
 }
484 484
 
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
  *
490 490
  * @return array
491 491
  */
492
-function convertToArray(string|array $element): array
492
+function convertToArray(string | array $element): array
493 493
 {
494 494
     if (is_string($element) === true) {
495 495
         if (empty($element) === true) {
@@ -517,14 +517,14 @@  discard block
 block discarded – undo
517 517
  * @param object       $tree            Tree of folders
518 518
  */
519 519
 function identUser(
520
-    string|array $allowedFolders,
521
-    string|array $noAccessFolders,
522
-    string|array $userRoles,
520
+    string | array $allowedFolders,
521
+    string | array $noAccessFolders,
522
+    string | array $userRoles,
523 523
     array $SETTINGS,
524 524
     object $tree
525 525
 ) {
526 526
     // Load superglobal
527
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
527
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
528 528
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
529 529
     // Init
530 530
     $superGlobal->put('groupes_visibles', [], 'SESSION');
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
     // Get list of folders depending on Roles
553 553
     $rows = DB::query(
554 554
         'SELECT *
555
-        FROM ' . prefixTable('roles_values') . '
555
+        FROM ' . prefixTable('roles_values').'
556 556
         WHERE role_id IN %li AND type IN %ls',
557 557
         $userRoles,
558 558
         ['W', 'ND', 'NE', 'NDNE', 'R']
@@ -576,9 +576,9 @@  discard block
 block discarded – undo
576 576
     // Does this user is allowed to see other items
577 577
     $inc = 0;
578 578
     $rows = DB::query(
579
-    'SELECT id, id_tree FROM ' . prefixTable('items') . '
579
+    'SELECT id, id_tree FROM '.prefixTable('items').'
580 580
         WHERE restricted_to LIKE %ss AND inactif = %s',
581
-    $globalsUserId . ';',
581
+    $globalsUserId.';',
582 582
     '0'
583 583
 );
584 584
     foreach ($rows as $record) {
@@ -592,8 +592,8 @@  discard block
 block discarded – undo
592 592
     // Check for the users roles if some specific rights exist on items
593 593
     $rows = DB::query(
594 594
         'SELECT i.id_tree, r.item_id
595
-        FROM ' . prefixTable('items') . ' as i
596
-        INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (r.item_id=i.id)
595
+        FROM ' . prefixTable('items').' as i
596
+        INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (r.item_id=i.id)
597 597
         WHERE r.role_id IN %li
598 598
         ORDER BY i.id_tree ASC',
599 599
         $userRoles
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
     ) {
615 615
         $persoFld = DB::queryfirstrow(
616 616
             'SELECT id
617
-            FROM ' . prefixTable('nested_tree') . '
617
+            FROM ' . prefixTable('nested_tree').'
618 618
             WHERE title = %s AND personal_folder = %i',
619 619
             $globalsUserId,
620 620
             1
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
     }
648 648
     $persoFlds = DB::query(
649 649
         'SELECT id
650
-        FROM ' . prefixTable('nested_tree') . '
650
+        FROM ' . prefixTable('nested_tree').'
651 651
         WHERE %l',
652 652
         $where
653 653
     );
@@ -688,16 +688,16 @@  discard block
 block discarded – undo
688 688
     'SESSION'
689 689
 );
690 690
     // Folders and Roles numbers
691
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('nested_tree') . '');
691
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('nested_tree').'');
692 692
     $superGlobal->put('nb_folders', DB::count(), 'SESSION');
693
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('roles_title'));
693
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('roles_title'));
694 694
     $superGlobal->put('nb_roles', DB::count(), 'SESSION');
695 695
     // check if change proposals on User's items
696 696
     if (isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1) {
697 697
         DB::query(
698 698
             'SELECT *
699
-            FROM ' . prefixTable('items_change') . ' AS c
700
-            LEFT JOIN ' . prefixTable('log_items') . ' AS i ON (c.item_id = i.id_item)
699
+            FROM ' . prefixTable('items_change').' AS c
700
+            LEFT JOIN ' . prefixTable('log_items').' AS i ON (c.item_id = i.id_item)
701 701
             WHERE i.action = %s AND i.id_user = %i',
702 702
             'at_creation',
703 703
             $globalsUserId
@@ -741,9 +741,9 @@  discard block
 block discarded – undo
741 741
  */
742 742
 function cacheTableRefresh(array $SETTINGS): void
743 743
 {
744
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
744
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
745 745
     //Connect to DB
746
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
746
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
747 747
     if (defined('DB_PASSWD_CLEAR') === false) {
748 748
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
749 749
     }
@@ -758,12 +758,12 @@  discard block
 block discarded – undo
758 758
     $tree->register();
759 759
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
760 760
     // truncate table
761
-    DB::query('TRUNCATE TABLE ' . prefixTable('cache'));
761
+    DB::query('TRUNCATE TABLE '.prefixTable('cache'));
762 762
     // reload date
763 763
     $rows = DB::query(
764 764
         'SELECT *
765
-        FROM ' . prefixTable('items') . ' as i
766
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
765
+        FROM ' . prefixTable('items').' as i
766
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
767 767
         AND l.action = %s
768 768
         AND i.inactif = %i',
769 769
         'at_creation',
@@ -775,18 +775,18 @@  discard block
 block discarded – undo
775 775
             $tags = '';
776 776
             $itemTags = DB::query(
777 777
     'SELECT tag
778
-                FROM ' . prefixTable('tags') . '
778
+                FROM ' . prefixTable('tags').'
779 779
                 WHERE item_id = %i AND tag != ""',
780 780
     $record['id']
781 781
 );
782 782
             foreach ($itemTags as $itemTag) {
783
-                $tags .= $itemTag['tag'] . ' ';
783
+                $tags .= $itemTag['tag'].' ';
784 784
             }
785 785
 
786 786
             // Get renewal period
787 787
             $resNT = DB::queryfirstrow(
788 788
                 'SELECT renewal_period
789
-                FROM ' . prefixTable('nested_tree') . '
789
+                FROM ' . prefixTable('nested_tree').'
790 790
                 WHERE id = %i',
791 791
                 $record['id_tree']
792 792
             );
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
                     // Is this a User id?
800 800
                     $user = DB::queryfirstrow(
801 801
                         'SELECT id, login
802
-                        FROM ' . prefixTable('users') . '
802
+                        FROM ' . prefixTable('users').'
803 803
                         WHERE id = %i',
804 804
                         $elem->title
805 805
                     );
@@ -817,11 +817,11 @@  discard block
 block discarded – undo
817 817
                     'id' => $record['id'],
818 818
                     'label' => $record['label'],
819 819
                     'description' => $record['description'] ?? '',
820
-                    'url' => isset($record['url']) && ! empty($record['url']) ? $record['url'] : '0',
820
+                    'url' => isset($record['url']) && !empty($record['url']) ? $record['url'] : '0',
821 821
                     'tags' => $tags,
822 822
                     'id_tree' => $record['id_tree'],
823 823
                     'perso' => $record['perso'],
824
-                    'restricted_to' => isset($record['restricted_to']) && ! empty($record['restricted_to']) ? $record['restricted_to'] : '0',
824
+                    'restricted_to' => isset($record['restricted_to']) && !empty($record['restricted_to']) ? $record['restricted_to'] : '0',
825 825
                     'login' => $record['login'] ?? '',
826 826
                     'folder' => implode(' > ', $folder),
827 827
                     'author' => $record['id_user'],
@@ -841,12 +841,12 @@  discard block
 block discarded – undo
841 841
  */
842 842
 function cacheTableUpdate(array $SETTINGS, ?string $ident = null): void
843 843
 {
844
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
844
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
845 845
     // Load superglobal
846
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
846
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
847 847
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
848 848
     //Connect to DB
849
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
849
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
850 850
     if (defined('DB_PASSWD_CLEAR') === false) {
851 851
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
852 852
     }
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
     // get new value from db
864 864
     $data = DB::queryfirstrow(
865 865
         'SELECT label, description, id_tree, perso, restricted_to, login, url
866
-        FROM ' . prefixTable('items') . '
866
+        FROM ' . prefixTable('items').'
867 867
         WHERE id=%i',
868 868
         $ident
869 869
     );
@@ -871,12 +871,12 @@  discard block
 block discarded – undo
871 871
     $tags = '';
872 872
     $itemTags = DB::query(
873 873
     'SELECT tag
874
-        FROM ' . prefixTable('tags') . '
874
+        FROM ' . prefixTable('tags').'
875 875
         WHERE item_id = %i AND tag != ""',
876 876
     $ident
877 877
 );
878 878
     foreach ($itemTags as $itemTag) {
879
-        $tags .= $itemTag['tag'] . ' ';
879
+        $tags .= $itemTag['tag'].' ';
880 880
     }
881 881
     // form id_tree to full foldername
882 882
     $folder = [];
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
             // Is this a User id?
888 888
             $user = DB::queryfirstrow(
889 889
                 'SELECT id, login
890
-                FROM ' . prefixTable('users') . '
890
+                FROM ' . prefixTable('users').'
891 891
                 WHERE id = %i',
892 892
                 $elem->title
893 893
             );
@@ -905,10 +905,10 @@  discard block
 block discarded – undo
905 905
             'label' => $data['label'],
906 906
             'description' => $data['description'],
907 907
             'tags' => $tags,
908
-            'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0',
908
+            'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0',
909 909
             'id_tree' => $data['id_tree'],
910 910
             'perso' => $data['perso'],
911
-            'restricted_to' => isset($data['restricted_to']) && ! empty($data['restricted_to']) ? $data['restricted_to'] : '0',
911
+            'restricted_to' => isset($data['restricted_to']) && !empty($data['restricted_to']) ? $data['restricted_to'] : '0',
912 912
             'login' => $data['login'] ?? '',
913 913
             'folder' => implode(' » ', $folder),
914 914
             'author' => $superGlobal->get('user_id', 'SESSION'),
@@ -926,14 +926,14 @@  discard block
 block discarded – undo
926 926
  */
927 927
 function cacheTableAdd(array $SETTINGS, ?string $ident = null): void
928 928
 {
929
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
929
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
930 930
     // Load superglobal
931
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
931
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
932 932
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
933 933
     // Get superglobals
934 934
     $globalsUserId = $superGlobal->get('user_id', 'SESSION');
935 935
     //Connect to DB
936
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
936
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
937 937
     if (defined('DB_PASSWD_CLEAR') === false) {
938 938
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
939 939
     }
@@ -950,8 +950,8 @@  discard block
 block discarded – undo
950 950
     // get new value from db
951 951
     $data = DB::queryFirstRow(
952 952
         'SELECT i.label, i.description, i.id_tree as id_tree, i.perso, i.restricted_to, i.id, i.login, i.url, l.date
953
-        FROM ' . prefixTable('items') . ' as i
954
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
953
+        FROM ' . prefixTable('items').' as i
954
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
955 955
         WHERE i.id = %i
956 956
         AND l.action = %s',
957 957
         $ident,
@@ -961,12 +961,12 @@  discard block
 block discarded – undo
961 961
     $tags = '';
962 962
     $itemTags = DB::query(
963 963
     'SELECT tag
964
-        FROM ' . prefixTable('tags') . '
964
+        FROM ' . prefixTable('tags').'
965 965
         WHERE item_id = %i AND tag != ""',
966 966
     $ident
967 967
 );
968 968
     foreach ($itemTags as $itemTag) {
969
-        $tags .= $itemTag['tag'] . ' ';
969
+        $tags .= $itemTag['tag'].' ';
970 970
     }
971 971
     // form id_tree to full foldername
972 972
     $folder = [];
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
             // Is this a User id?
978 978
             $user = DB::queryfirstrow(
979 979
                 'SELECT id, login
980
-                FROM ' . prefixTable('users') . '
980
+                FROM ' . prefixTable('users').'
981 981
                 WHERE id = %i',
982 982
                 $elem->title
983 983
             );
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
             'label' => $data['label'],
997 997
             'description' => $data['description'],
998 998
             'tags' => isset($tags) && empty($tags) === false ? $tags : 'None',
999
-            'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0',
999
+            'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0',
1000 1000
             'id_tree' => $data['id_tree'],
1001 1001
             'perso' => isset($data['perso']) && empty($data['perso']) === false && $data['perso'] !== 'None' ? $data['perso'] : '0',
1002 1002
             'restricted_to' => isset($data['restricted_to']) && empty($data['restricted_to']) === false ? $data['restricted_to'] : '0',
@@ -1018,52 +1018,52 @@  discard block
 block discarded – undo
1018 1018
 function getStatisticsData(array $SETTINGS): array
1019 1019
 {
1020 1020
     DB::query(
1021
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1021
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1022 1022
         0
1023 1023
     );
1024 1024
     $counter_folders = DB::count();
1025 1025
     DB::query(
1026
-    'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1026
+    'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1027 1027
     1
1028 1028
 );
1029 1029
     $counter_folders_perso = DB::count();
1030 1030
     DB::query(
1031
-    'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1031
+    'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1032 1032
     0
1033 1033
 );
1034 1034
     $counter_items = DB::count();
1035 1035
     DB::query(
1036
-    'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1036
+    'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1037 1037
     1
1038 1038
 );
1039 1039
     $counter_items_perso = DB::count();
1040 1040
     DB::query(
1041
-    'SELECT id FROM ' . prefixTable('users') . ''
1041
+    'SELECT id FROM '.prefixTable('users').''
1042 1042
 );
1043 1043
     $counter_users = DB::count();
1044 1044
     DB::query(
1045
-    'SELECT id FROM ' . prefixTable('users') . ' WHERE admin = %i',
1045
+    'SELECT id FROM '.prefixTable('users').' WHERE admin = %i',
1046 1046
     1
1047 1047
 );
1048 1048
     $admins = DB::count();
1049 1049
     DB::query(
1050
-    'SELECT id FROM ' . prefixTable('users') . ' WHERE gestionnaire = %i',
1050
+    'SELECT id FROM '.prefixTable('users').' WHERE gestionnaire = %i',
1051 1051
     1
1052 1052
 );
1053 1053
     $managers = DB::count();
1054 1054
     DB::query(
1055
-    'SELECT id FROM ' . prefixTable('users') . ' WHERE read_only = %i',
1055
+    'SELECT id FROM '.prefixTable('users').' WHERE read_only = %i',
1056 1056
     1
1057 1057
 );
1058 1058
     $readOnly = DB::count();
1059 1059
     // list the languages
1060 1060
     $usedLang = [];
1061 1061
     $tp_languages = DB::query(
1062
-    'SELECT name FROM ' . prefixTable('languages')
1062
+    'SELECT name FROM '.prefixTable('languages')
1063 1063
 );
1064 1064
     foreach ($tp_languages as $tp_language) {
1065 1065
         DB::query(
1066
-            'SELECT * FROM ' . prefixTable('users') . ' WHERE user_language = %s',
1066
+            'SELECT * FROM '.prefixTable('users').' WHERE user_language = %s',
1067 1067
             $tp_language['name']
1068 1068
         );
1069 1069
         $usedLang[$tp_language['name']] = round((DB::count() * 100 / $counter_users), 0);
@@ -1072,12 +1072,12 @@  discard block
 block discarded – undo
1072 1072
     // get list of ips
1073 1073
     $usedIp = [];
1074 1074
     $tp_ips = DB::query(
1075
-    'SELECT user_ip FROM ' . prefixTable('users')
1075
+    'SELECT user_ip FROM '.prefixTable('users')
1076 1076
 );
1077 1077
     foreach ($tp_ips as $ip) {
1078 1078
         if (array_key_exists($ip['user_ip'], $usedIp)) {
1079 1079
             $usedIp[$ip['user_ip']] = $usedIp[$ip['user_ip']] + 1;
1080
-        } elseif (! empty($ip['user_ip']) && $ip['user_ip'] !== 'none') {
1080
+        } elseif (!empty($ip['user_ip']) && $ip['user_ip'] !== 'none') {
1081 1081
             $usedIp[$ip['user_ip']] = 1;
1082 1082
         }
1083 1083
     }
@@ -1134,25 +1134,25 @@  discard block
 block discarded – undo
1134 1134
 ): string {
1135 1135
     // CAse where email not defined
1136 1136
     if ($email === 'none' || empty($email) === true) {
1137
-        return '"error":"" , "message":"' . langHdl('forgot_my_pw_email_sent') . '"';
1137
+        return '"error":"" , "message":"'.langHdl('forgot_my_pw_email_sent').'"';
1138 1138
     }
1139 1139
 
1140 1140
     // Load settings
1141
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
1141
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
1142 1142
     // Load superglobal
1143
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1143
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1144 1144
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1145 1145
     // Get user language
1146
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $superGlobal->get('user_language', 'SESSION') . '.php';
1146
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$superGlobal->get('user_language', 'SESSION').'.php';
1147 1147
     // Load library
1148
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1148
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1149 1149
     // load PHPMailer
1150 1150
     $mail = new SplClassLoader('PHPMailer\PHPMailer', '../includes/libraries');
1151 1151
     $mail->register();
1152 1152
     $mail = new PHPMailer\PHPMailer\PHPMailer(true);
1153 1153
     try {
1154 1154
         // send to user
1155
-        $mail->setLanguage('en', $SETTINGS['cpassman_dir'] . '/includes/libraries/PHPMailer/PHPMailer/language/');
1155
+        $mail->setLanguage('en', $SETTINGS['cpassman_dir'].'/includes/libraries/PHPMailer/PHPMailer/language/');
1156 1156
         $mail->SMTPDebug = 0;
1157 1157
         //value 1 can be used to debug - 4 for debuging connections
1158 1158
         $mail->Port = $SETTINGS['email_port'];
@@ -1243,7 +1243,7 @@  discard block
 block discarded – undo
1243 1243
         <table width="600" cellpadding="0" cellspacing="0" border="0" class="container" bgcolor="#ffffff" style="border-spacing: 0; border-bottom: 1px solid #e0e0e0; box-shadow: 0 0 3px #ddd; color: #434343; font-family: Helvetica, Verdana, sans-serif;">
1244 1244
         <tr><td class="container-padding" bgcolor="#ffffff" style="border-collapse: collapse; border-left: 1px solid #e0e0e0; background-color: #ffffff; padding-left: 30px; padding-right: 30px;">
1245 1245
         <br><div style="float:right;">' .
1246
-        $textMail .
1246
+        $textMail.
1247 1247
         '<br><br></td></tr></table>
1248 1248
     </td></tr></table>
1249 1249
     <br></body></html>';
@@ -1254,7 +1254,7 @@  discard block
 block discarded – undo
1254 1254
  */
1255 1255
 function generateKey(): string
1256 1256
 {
1257
-    return substr(md5(rand() . rand()), 0, 15);
1257
+    return substr(md5(rand().rand()), 0, 15);
1258 1258
 }
1259 1259
 
1260 1260
 /**
@@ -1321,7 +1321,7 @@  discard block
 block discarded – undo
1321 1321
 {
1322 1322
     array_walk_recursive(
1323 1323
         $array,
1324
-        static function (&$item): void {
1324
+        static function(&$item): void {
1325 1325
             if (mb_detect_encoding($item, 'utf-8', true) === false) {
1326 1326
                 $item = utf8_encode($item);
1327 1327
             }
@@ -1339,7 +1339,7 @@  discard block
 block discarded – undo
1339 1339
  *
1340 1340
  * @return resource|string|array
1341 1341
  */
1342
-function prepareExchangedData(array|string $data, string $type, ?string $key = null)
1342
+function prepareExchangedData(array | string $data, string $type, ?string $key = null)
1343 1343
 {
1344 1344
     if (file_exists('../includes/config/tp.config.php')) {
1345 1345
         include '../includes/config/tp.config.php';
@@ -1356,7 +1356,7 @@  discard block
 block discarded – undo
1356 1356
     }
1357 1357
 
1358 1358
     // Load superglobal
1359
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1359
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1360 1360
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1361 1361
     // Get superglobals
1362 1362
     if ($key !== null) {
@@ -1367,9 +1367,9 @@  discard block
 block discarded – undo
1367 1367
     }
1368 1368
 
1369 1369
     //load ClassLoader
1370
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1370
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1371 1371
     //Load AES
1372
-    $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1372
+    $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'].'/includes/libraries');
1373 1373
     $aes->register();
1374 1374
     if ($type === 'encode' && is_array($data) === true) {
1375 1375
         // Ensure UTF8 format
@@ -1459,8 +1459,8 @@  discard block
 block discarded – undo
1459 1459
  */
1460 1460
 function prefixTable(string $table): string
1461 1461
 {
1462
-    $safeTable = htmlspecialchars(DB_PREFIX . $table);
1463
-    if (! empty($safeTable)) {
1462
+    $safeTable = htmlspecialchars(DB_PREFIX.$table);
1463
+    if (!empty($safeTable)) {
1464 1464
         // sanitize string
1465 1465
         return $safeTable;
1466 1466
     }
@@ -1490,13 +1490,13 @@  discard block
 block discarded – undo
1490 1490
     bool $lowercase = false,
1491 1491
     array $SETTINGS = []
1492 1492
 ): string {
1493
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1494
-    $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1493
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1494
+    $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'].'/includes/libraries');
1495 1495
     $generator->register();
1496 1496
     $generator = new PasswordGenerator\Generator\ComputerPasswordGenerator();
1497 1497
     // Is PHP7 being used?
1498 1498
     if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
1499
-        $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1499
+        $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'].'/includes/libraries');
1500 1500
         $php7generator->register();
1501 1501
         $generator->setRandomGenerator(new PasswordGenerator\RandomGenerator\Php7RandomGenerator());
1502 1502
     }
@@ -1526,7 +1526,7 @@  discard block
 block discarded – undo
1526 1526
 function send_syslog($message, $host, $port, $component = 'teampass'): void
1527 1527
 {
1528 1528
     $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
1529
-    $syslog_message = '<123>' . date('M d H:i:s ') . $component . ': ' . $message;
1529
+    $syslog_message = '<123>'.date('M d H:i:s ').$component.': '.$message;
1530 1530
     socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $host, $port);
1531 1531
     socket_close($sock);
1532 1532
 }
@@ -1548,7 +1548,7 @@  discard block
 block discarded – undo
1548 1548
     }
1549 1549
 
1550 1550
     // include librairies & connect to DB
1551
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1551
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1552 1552
     if (defined('DB_PASSWD_CLEAR') === false) {
1553 1553
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1554 1554
     }
@@ -1572,14 +1572,14 @@  discard block
 block discarded – undo
1572 1572
     if (isset($SETTINGS['syslog_enable']) === true && (int) $SETTINGS['syslog_enable'] === 1) {
1573 1573
         if ($type === 'user_mngt') {
1574 1574
             send_syslog(
1575
-                'action=' . str_replace('at_', '', $label) . ' attribute=user user=' . $who . ' userid="' . $login . '" change="' . $field_1 . '" ',
1575
+                'action='.str_replace('at_', '', $label).' attribute=user user='.$who.' userid="'.$login.'" change="'.$field_1.'" ',
1576 1576
                 $SETTINGS['syslog_host'],
1577 1577
                 $SETTINGS['syslog_port'],
1578 1578
                 'teampass'
1579 1579
             );
1580 1580
         } else {
1581 1581
             send_syslog(
1582
-                'action=' . $type . ' attribute=' . $label . ' user=' . $who . ' userid="' . $login . '" ',
1582
+                'action='.$type.' attribute='.$label.' user='.$who.' userid="'.$login.'" ',
1583 1583
                 $SETTINGS['syslog_host'],
1584 1584
                 $SETTINGS['syslog_port'],
1585 1585
                 'teampass'
@@ -1611,7 +1611,7 @@  discard block
 block discarded – undo
1611 1611
     ?string $encryption_type = null
1612 1612
 ): void {
1613 1613
     // include librairies & connect to DB
1614
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1614
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1615 1615
     if (defined('DB_PASSWD_CLEAR') === false) {
1616 1616
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1617 1617
     }
@@ -1655,7 +1655,7 @@  discard block
 block discarded – undo
1655 1655
         if (empty($item_label) === true) {
1656 1656
             $dataItem = DB::queryfirstrow(
1657 1657
                 'SELECT id, id_tree, label
1658
-                FROM ' . prefixTable('items') . '
1658
+                FROM ' . prefixTable('items').'
1659 1659
                 WHERE id = %i',
1660 1660
                 $item_id
1661 1661
             );
@@ -1663,11 +1663,11 @@  discard block
 block discarded – undo
1663 1663
         }
1664 1664
 
1665 1665
         send_syslog(
1666
-            'action=' . str_replace('at_', '', $action) .
1667
-                ' attribute=' . str_replace('at_', '', $attribute[0]) .
1668
-                ' itemno=' . $item_id .
1669
-                ' user=' . is_null($login) === true ? '' : addslashes((string) $login) .
1670
-                ' itemname="' . addslashes($item_label) . '"',
1666
+            'action='.str_replace('at_', '', $action).
1667
+                ' attribute='.str_replace('at_', '', $attribute[0]).
1668
+                ' itemno='.$item_id.
1669
+                ' user='.is_null($login) === true ? '' : addslashes((string) $login).
1670
+                ' itemname="'.addslashes($item_label).'"',
1671 1671
             $SETTINGS['syslog_host'],
1672 1672
             $SETTINGS['syslog_port'],
1673 1673
             'teampass'
@@ -1693,7 +1693,7 @@  discard block
 block discarded – undo
1693 1693
         && $action === 'at_shown'
1694 1694
     ) {
1695 1695
         // Load superglobal
1696
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1696
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1697 1697
         $superGlobal = new protect\SuperGlobal\SuperGlobal();
1698 1698
         // Get superglobals
1699 1699
         $globalsLastname = $superGlobal->get('lastname', 'SESSION');
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
         // Get info about item
1703 1703
         $dataItem = DB::queryfirstrow(
1704 1704
             'SELECT id, id_tree, label
1705
-            FROM ' . prefixTable('items') . '
1705
+            FROM ' . prefixTable('items').'
1706 1706
             WHERE id = %i',
1707 1707
             $item_id
1708 1708
         );
@@ -1716,9 +1716,9 @@  discard block
 block discarded – undo
1716 1716
                 'body' => str_replace(
1717 1717
                     ['#tp_user#', '#tp_item#', '#tp_link#'],
1718 1718
                     [
1719
-                        addslashes($globalsName . ' ' . $globalsLastname),
1719
+                        addslashes($globalsName.' '.$globalsLastname),
1720 1720
                         addslashes($item_label),
1721
-                        $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $item_id,
1721
+                        $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$item_id,
1722 1722
                     ],
1723 1723
                     langHdl('email_on_open_notification_mail')
1724 1724
                 ),
@@ -1740,7 +1740,7 @@  discard block
 block discarded – undo
1740 1740
 function notifyChangesToSubscribers(int $item_id, string $label, array $changes, array $SETTINGS): void
1741 1741
 {
1742 1742
     // Load superglobal
1743
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1743
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1744 1744
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1745 1745
     // Get superglobals
1746 1746
     $globalsUserId = $superGlobal->get('user_id', 'SESSION');
@@ -1750,8 +1750,8 @@  discard block
 block discarded – undo
1750 1750
     $notification = DB::queryOneColumn(
1751 1751
         'email',
1752 1752
         'SELECT *
1753
-        FROM ' . prefixTable('notification') . ' AS n
1754
-        INNER JOIN ' . prefixTable('users') . ' AS u ON (n.user_id = u.id)
1753
+        FROM ' . prefixTable('notification').' AS n
1754
+        INNER JOIN ' . prefixTable('users').' AS u ON (n.user_id = u.id)
1755 1755
         WHERE n.item_id = %i AND n.user_id != %i',
1756 1756
         $item_id,
1757 1757
         $globalsUserId
@@ -1762,7 +1762,7 @@  discard block
 block discarded – undo
1762 1762
         // Get list of changes
1763 1763
         $htmlChanges = '<ul>';
1764 1764
         foreach ($changes as $change) {
1765
-            $htmlChanges .= '<li>' . $change . '</li>';
1765
+            $htmlChanges .= '<li>'.$change.'</li>';
1766 1766
         }
1767 1767
         $htmlChanges .= '</ul>';
1768 1768
         // send email
@@ -1793,7 +1793,7 @@  discard block
 block discarded – undo
1793 1793
 function geItemReadablePath(int $id_tree, string $label, array $SETTINGS): string
1794 1794
 {
1795 1795
     // Class loader
1796
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1796
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1797 1797
     //Load Tree
1798 1798
     $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries');
1799 1799
     $tree->register();
@@ -1802,15 +1802,15 @@  discard block
 block discarded – undo
1802 1802
     $path = '';
1803 1803
     foreach ($arbo as $elem) {
1804 1804
         if (empty($path) === true) {
1805
-            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' ';
1805
+            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
1806 1806
         } else {
1807
-            $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1807
+            $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1808 1808
         }
1809 1809
     }
1810 1810
 
1811 1811
     // Build text to show user
1812 1812
     if (empty($label) === false) {
1813
-        return empty($path) === true ? addslashes($label) : addslashes($label) . ' (' . $path . ')';
1813
+        return empty($path) === true ? addslashes($label) : addslashes($label).' ('.$path.')';
1814 1814
     }
1815 1815
     return empty($path) === true ? '' : $path;
1816 1816
 
@@ -1863,11 +1863,11 @@  discard block
 block discarded – undo
1863 1863
  * @param string $field    Field to refresh
1864 1864
  * @param string $value    Value to set
1865 1865
  */
1866
-function handleConfigFile(string $action, array $SETTINGS, ?string $field = null, ?string $value = null): string|bool
1866
+function handleConfigFile(string $action, array $SETTINGS, ?string $field = null, ?string $value = null): string | bool
1867 1867
 {
1868
-    $tp_config_file = $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php';
1868
+    $tp_config_file = $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php';
1869 1869
     // include librairies & connect to DB
1870
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1870
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1871 1871
     if (defined('DB_PASSWD_CLEAR') === false) {
1872 1872
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1873 1873
     }
@@ -1880,8 +1880,8 @@  discard block
 block discarded – undo
1880 1880
     if (file_exists($tp_config_file) === false || $action === 'rebuild') {
1881 1881
         // perform a copy
1882 1882
         if (file_exists($tp_config_file)) {
1883
-            if (! copy($tp_config_file, $tp_config_file . '.' . date('Y_m_d_His', time()))) {
1884
-                return "ERROR: Could not copy file '" . $tp_config_file . "'";
1883
+            if (!copy($tp_config_file, $tp_config_file.'.'.date('Y_m_d_His', time()))) {
1884
+                return "ERROR: Could not copy file '".$tp_config_file."'";
1885 1885
             }
1886 1886
         }
1887 1887
 
@@ -1891,11 +1891,11 @@  discard block
 block discarded – undo
1891 1891
         $data[1] = "global \$SETTINGS;\n";
1892 1892
         $data[2] = "\$SETTINGS = array (\n";
1893 1893
         $rows = DB::query(
1894
-    'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s',
1894
+    'SELECT * FROM '.prefixTable('misc').' WHERE type=%s',
1895 1895
     'admin'
1896 1896
 );
1897 1897
         foreach ($rows as $record) {
1898
-            array_push($data, "    '" . $record['intitule'] . "' => '" . $record['valeur'] . "',\n");
1898
+            array_push($data, "    '".$record['intitule']."' => '".$record['valeur']."',\n");
1899 1899
         }
1900 1900
         array_push($data, ");\n");
1901 1901
         $data = array_unique($data);
@@ -1909,15 +1909,15 @@  discard block
 block discarded – undo
1909 1909
                 break;
1910 1910
             }
1911 1911
 
1912
-            if (stristr($line, "'" . $field . "' => '")) {
1913
-                $data[$inc] = "    '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n";
1912
+            if (stristr($line, "'".$field."' => '")) {
1913
+                $data[$inc] = "    '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n";
1914 1914
                 $bFound = true;
1915 1915
                 break;
1916 1916
             }
1917 1917
             ++$inc;
1918 1918
         }
1919 1919
         if ($bFound === false) {
1920
-            $data[$inc] = "    '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n);\n";
1920
+            $data[$inc] = "    '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n);\n";
1921 1921
         }
1922 1922
     }
1923 1923
 
@@ -1943,7 +1943,7 @@  discard block
 block discarded – undo
1943 1943
 {
1944 1944
     global $SETTINGS;
1945 1945
     /* LOAD CPASSMAN SETTINGS */
1946
-    if (! isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) {
1946
+    if (!isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) {
1947 1947
         $SETTINGS['duplicate_folder'] = 0;
1948 1948
         //by default, this is set to 0;
1949 1949
         $SETTINGS['duplicate_item'] = 0;
@@ -1952,7 +1952,7 @@  discard block
 block discarded – undo
1952 1952
         //by default, this value is set to 5;
1953 1953
         $settings = [];
1954 1954
         $rows = DB::query(
1955
-    'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s_type OR type=%s_type2',
1955
+    'SELECT * FROM '.prefixTable('misc').' WHERE type=%s_type OR type=%s_type2',
1956 1956
     [
1957 1957
                 'type' => 'admin',
1958 1958
                 'type2' => 'settings',
@@ -1979,7 +1979,7 @@  discard block
 block discarded – undo
1979 1979
     $source_cf = [];
1980 1980
     $rows = DB::QUERY(
1981 1981
     'SELECT id_category
1982
-        FROM ' . prefixTable('categories_folders') . '
1982
+        FROM ' . prefixTable('categories_folders').'
1983 1983
         WHERE id_folder = %i',
1984 1984
     $source_id
1985 1985
 );
@@ -1990,7 +1990,7 @@  discard block
 block discarded – undo
1990 1990
     $target_cf = [];
1991 1991
     $rows = DB::QUERY(
1992 1992
     'SELECT id_category
1993
-        FROM ' . prefixTable('categories_folders') . '
1993
+        FROM ' . prefixTable('categories_folders').'
1994 1994
         WHERE id_folder = %i',
1995 1995
     $target_id
1996 1996
 );
@@ -2021,11 +2021,11 @@  discard block
 block discarded – undo
2021 2021
     string $target_file,
2022 2022
     array $SETTINGS,
2023 2023
     ?string $password = null
2024
-): string|bool {
2024
+): string | bool {
2025 2025
     // Load AntiXSS
2026
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
2027
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php';
2028
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php';
2026
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
2027
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php';
2028
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php';
2029 2029
     $antiXss = new voku\helper\AntiXSS();
2030 2030
     // Protect against bad inputs
2031 2031
     if (is_array($source_file) === true || is_array($target_file) === true) {
@@ -2037,7 +2037,7 @@  discard block
 block discarded – undo
2037 2037
     $target_file = $antiXss->xss_clean($target_file);
2038 2038
     if (empty($password) === true || is_null($password) === true) {
2039 2039
         // get KEY to define password
2040
-        $ascii_key = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
2040
+        $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
2041 2041
         $password = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key);
2042 2042
     }
2043 2043
 
@@ -2078,18 +2078,18 @@  discard block
 block discarded – undo
2078 2078
     string $target_file,
2079 2079
     array $SETTINGS,
2080 2080
     ?string $password = null
2081
-): string|bool {
2081
+): string | bool {
2082 2082
     // load PhpEncryption library
2083 2083
     $path_to_encryption = '/includes/libraries/Encryption/Encryption/';
2084
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php';
2085
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php';
2086
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php';
2087
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php';
2088
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php';
2089
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php';
2090
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php';
2091
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php';
2092
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php';
2084
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php';
2085
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php';
2086
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php';
2087
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php';
2088
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php';
2089
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php';
2090
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php';
2091
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php';
2092
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php';
2093 2093
     try {
2094 2094
         \Defuse\Crypto\File::encryptFileWithPassword(
2095 2095
             $source_file,
@@ -2121,18 +2121,18 @@  discard block
 block discarded – undo
2121 2121
     string $target_file,
2122 2122
     array $SETTINGS,
2123 2123
     ?string $password = null
2124
-): string|bool {
2124
+): string | bool {
2125 2125
     // load PhpEncryption library
2126 2126
     $path_to_encryption = '/includes/libraries/Encryption/Encryption/';
2127
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php';
2128
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php';
2129
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php';
2130
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php';
2131
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php';
2132
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php';
2133
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php';
2134
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php';
2135
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php';
2127
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php';
2128
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php';
2129
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php';
2130
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php';
2131
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php';
2132
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php';
2133
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php';
2134
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php';
2135
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php';
2136 2136
     try {
2137 2137
         \Defuse\Crypto\File::decryptFileWithPassword(
2138 2138
             $source_file,
@@ -2177,9 +2177,9 @@  discard block
 block discarded – undo
2177 2177
 function fileDelete(string $file, array $SETTINGS): void
2178 2178
 {
2179 2179
     // Load AntiXSS
2180
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php';
2181
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php';
2182
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
2180
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php';
2181
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php';
2182
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
2183 2183
     $antiXss = new voku\helper\AntiXSS();
2184 2184
     $file = $antiXss->xss_clean($file);
2185 2185
     if (is_file($file)) {
@@ -2224,7 +2224,7 @@  discard block
 block discarded – undo
2224 2224
 function recursiveChmod(string $path, string $filePerm = 0644, string $dirPerm = 0755): bool
2225 2225
 {
2226 2226
     // Check if the path exists
2227
-    if (! file_exists($path)) {
2227
+    if (!file_exists($path)) {
2228 2228
         return false;
2229 2229
     }
2230 2230
 
@@ -2259,7 +2259,7 @@  discard block
 block discarded – undo
2259 2259
  */
2260 2260
 function accessToItemIsGranted(int $item_id, $SETTINGS)
2261 2261
 {
2262
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2262
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2263 2263
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2264 2264
     // Prepare superGlobal variables
2265 2265
     $session_groupes_visibles = $superGlobal->get('groupes_visibles', 'SESSION');
@@ -2267,7 +2267,7 @@  discard block
 block discarded – undo
2267 2267
     // Load item data
2268 2268
     $data = DB::queryFirstRow(
2269 2269
         'SELECT id_tree
2270
-        FROM ' . prefixTable('items') . '
2270
+        FROM ' . prefixTable('items').'
2271 2271
         WHERE id = %i',
2272 2272
         $item_id
2273 2273
     );
@@ -2340,8 +2340,8 @@  discard block
 block discarded – undo
2340 2340
 function performDBQuery(array $SETTINGS, string $fields, string $table): array
2341 2341
 {
2342 2342
     // include librairies & connect to DB
2343
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2344
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2343
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2344
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2345 2345
     if (defined('DB_PASSWD_CLEAR') === false) {
2346 2346
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2347 2347
     }
@@ -2353,7 +2353,7 @@  discard block
 block discarded – undo
2353 2353
     DB::$encoding = DB_ENCODING;
2354 2354
     // Insert log in DB
2355 2355
     return DB::query(
2356
-        'SELECT ' . $fields . '
2356
+        'SELECT '.$fields.'
2357 2357
         FROM ' . prefixTable($table)
2358 2358
     );
2359 2359
 }
@@ -2366,11 +2366,11 @@  discard block
 block discarded – undo
2366 2366
 function formatSizeUnits(int $bytes): string
2367 2367
 {
2368 2368
     if ($bytes >= 1073741824) {
2369
-        $bytes = number_format($bytes / 1073741824, 2) . ' GB';
2369
+        $bytes = number_format($bytes / 1073741824, 2).' GB';
2370 2370
     } elseif ($bytes >= 1048576) {
2371
-        $bytes = number_format($bytes / 1048576, 2) . ' MB';
2371
+        $bytes = number_format($bytes / 1048576, 2).' MB';
2372 2372
     } elseif ($bytes >= 1024) {
2373
-        $bytes = number_format($bytes / 1024, 2) . ' KB';
2373
+        $bytes = number_format($bytes / 1024, 2).' KB';
2374 2374
     } elseif ($bytes > 1) {
2375 2375
         $bytes .= ' bytes';
2376 2376
     } elseif ($bytes === 1) {
@@ -2559,14 +2559,14 @@  discard block
 block discarded – undo
2559 2559
 
2560 2560
     // Encrypt the file content
2561 2561
     $plaintext = file_get_contents(
2562
-        filter_var($fileInPath . '/' . $fileInName, FILTER_SANITIZE_URL)
2562
+        filter_var($fileInPath.'/'.$fileInName, FILTER_SANITIZE_URL)
2563 2563
     );
2564 2564
     $ciphertext = $cipher->encrypt($plaintext);
2565 2565
     // Save new file
2566 2566
     $hash = md5($plaintext);
2567
-    $fileOut = $fileInPath . '/' . TP_FILE_PREFIX . $hash;
2567
+    $fileOut = $fileInPath.'/'.TP_FILE_PREFIX.$hash;
2568 2568
     file_put_contents($fileOut, $ciphertext);
2569
-    unlink($fileInPath . '/' . $fileInName);
2569
+    unlink($fileInPath.'/'.$fileInName);
2570 2570
     return [
2571 2571
     'fileHash' => base64_encode($hash),
2572 2572
     'objectKey' => base64_encode($objectKey),
@@ -2582,7 +2582,7 @@  discard block
 block discarded – undo
2582 2582
  */
2583 2583
 function decryptFile(string $fileName, string $filePath, string $key): string
2584 2584
 {
2585
-    if (! defined('FILE_BUFFER_SIZE')) {
2585
+    if (!defined('FILE_BUFFER_SIZE')) {
2586 2586
         define('FILE_BUFFER_SIZE', 128 * 1024);
2587 2587
     }
2588 2588
 
@@ -2601,7 +2601,7 @@  discard block
 block discarded – undo
2601 2601
     $cipher->enableContinuousBuffer();
2602 2602
     $cipher->disablePadding();
2603 2603
     // Get file content
2604
-    $ciphertext = file_get_contents($filePath . '/' . TP_FILE_PREFIX . $fileName);
2604
+    $ciphertext = file_get_contents($filePath.'/'.TP_FILE_PREFIX.$fileName);
2605 2605
     // Decrypt file content and return
2606 2606
     return base64_encode($cipher->decrypt($ciphertext));
2607 2607
 }
@@ -2651,8 +2651,8 @@  discard block
 block discarded – undo
2651 2651
     array $SETTINGS
2652 2652
 ): void {
2653 2653
     // include librairies & connect to DB
2654
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2655
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2654
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2655
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2656 2656
     if (defined('DB_PASSWD_CLEAR') === false) {
2657 2657
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2658 2658
     }
@@ -2669,7 +2669,7 @@  discard block
 block discarded – undo
2669 2669
         $post_object_id
2670 2670
     );
2671 2671
     // Superglobals
2672
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2672
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2673 2673
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2674 2674
     // Prepare superGlobal variables
2675 2675
     $sessionPpersonaFolders = $superGlobal->get('personal_folders', 'SESSION');
@@ -2694,8 +2694,8 @@  discard block
 block discarded – undo
2694 2694
         // Create sharekey for each user
2695 2695
         $users = DB::query(
2696 2696
             'SELECT id, public_key
2697
-            FROM ' . prefixTable('users') . '
2698
-            WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '")
2697
+            FROM ' . prefixTable('users').'
2698
+            WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'")
2699 2699
             AND public_key != ""'
2700 2700
         );
2701 2701
         foreach ($users as $user) {
@@ -2723,7 +2723,7 @@  discard block
 block discarded – undo
2723 2723
 function isBase64(string $str): bool
2724 2724
 {
2725 2725
     $str = (string) trim($str);
2726
-    if (! isset($str[0])) {
2726
+    if (!isset($str[0])) {
2727 2727
         return false;
2728 2728
     }
2729 2729
 
@@ -2789,13 +2789,13 @@  discard block
 block discarded – undo
2789 2789
         ],
2790 2790
     ];
2791 2791
     // Load expected libraries
2792
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
2793
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php';
2794
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php';
2795
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php';
2796
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php';
2797
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php';
2798
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php';
2792
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
2793
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php';
2794
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php';
2795
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php';
2796
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php';
2797
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php';
2798
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php';
2799 2799
     $ad = new SplClassLoader('LdapRecord', '../includes/libraries');
2800 2800
     $ad->register();
2801 2801
     $connection = new Connection($config);
@@ -2804,7 +2804,7 @@  discard block
 block discarded – undo
2804 2804
         $connection->connect();
2805 2805
     } catch (\LdapRecord\Auth\BindException $e) {
2806 2806
         $error = $e->getDetailedError();
2807
-        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage();
2807
+        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage();
2808 2808
         return false;
2809 2809
     }
2810 2810
 
@@ -2813,7 +2813,7 @@  discard block
 block discarded – undo
2813 2813
         $connection->auth()->attempt($SETTINGS['ldap_user_attribute'].'='.$login.','.$SETTINGS['ldap_bdn'], $password, $stayAuthenticated = true);
2814 2814
     } catch (\LdapRecord\Auth\BindException $e) {
2815 2815
         $error = $e->getDetailedError();
2816
-        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage();
2816
+        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage();
2817 2817
         return false;
2818 2818
     }
2819 2819
 
@@ -2826,11 +2826,11 @@  discard block
 block discarded – undo
2826 2826
  * @param int $userId User's id
2827 2827
  * @param array   $SETTINGS Teampass settings
2828 2828
  */
2829
-function deleteUserObjetsKeys(int $userId, array $SETTINGS): null|bool
2829
+function deleteUserObjetsKeys(int $userId, array $SETTINGS): null | bool
2830 2830
 {
2831 2831
     // include librairies & connect to DB
2832
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2833
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2832
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2833
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2834 2834
     if (defined('DB_PASSWD_CLEAR') === false) {
2835 2835
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2836 2836
     }
@@ -2884,7 +2884,7 @@  discard block
 block discarded – undo
2884 2884
         foreach (DateTimeZone::listIdentifiers() as $timezone) {
2885 2885
             $now->setTimezone(new DateTimeZone($timezone));
2886 2886
             $offsets[] = $offset = $now->getOffset();
2887
-            $timezones[$timezone] = '(' . format_GMT_offset($offset) . ') ' . format_timezone_name($timezone);
2887
+            $timezones[$timezone] = '('.format_GMT_offset($offset).') '.format_timezone_name($timezone);
2888 2888
         }
2889 2889
 
2890 2890
         array_multisort($offsets, $timezones);
@@ -2897,7 +2897,7 @@  discard block
 block discarded – undo
2897 2897
 {
2898 2898
     $hours = intval($offset / 3600);
2899 2899
     $minutes = abs(intval($offset % 3600 / 60));
2900
-    return 'GMT' . ($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
2900
+    return 'GMT'.($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
2901 2901
 }
2902 2902
 
2903 2903
 function format_timezone_name($name)
Please login to merge, or discard this patch.
sources/logs.datatables.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 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
 
Please login to merge, or discard this patch.
sources/favourites.queries.php 1 patch
Spacing   +2 added lines, -2 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
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 $tab_favs = [];
80 80
 //redefine new list of favourites
81 81
             foreach ($tmp as $favorite) {
82
-                if (! empty($favorite) && $favorite !== $post_id) {
82
+                if (!empty($favorite) && $favorite !== $post_id) {
83 83
                     if (empty($favs)) {
84 84
                         $favs = $favorite;
85 85
                     } else {
Please login to merge, or discard this patch.
sources/roles.queries.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -94,25 +94,25 @@  discard block
 block discarded – undo
94 94
             // Check KEY
95 95
 
96 96
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          if ($post_key !== $_SESSION['key']) {
97
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             echo prepareExchangedData(
97
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                echo prepareExchangedData(
98 98
                     [
99 99
                         'error' => true,
100 100
                         'message' => langHdl('key_is_not_correct'),
101 101
                     ],
102 102
                     'encode'
103 103
                 );
104
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             break;
105
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         }
106
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         if ($_SESSION['user_read_only'] === true) {
107
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             echo prepareExchangedData(
104
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                break;
105
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }
106
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            if ($_SESSION['user_read_only'] === true) {
107
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                echo prepareExchangedData(
108 108
                     [
109 109
                         'error' => true,
110 110
                         'message' => langHdl('error_not_allowed_to'),
111 111
                     ],
112 112
                     'encode'
113 113
                 );
114
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             break;
115
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         }
114
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                break;
115
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }
116 116
 
117 117
             // Prepare variables
118 118
             $post_role_id = filter_input(INPUT_POST, 'role_id', FILTER_SANITIZE_NUMBER_INT);
@@ -165,25 +165,25 @@  discard block
 block discarded – undo
165 165
             // Check KEY
166 166
 
167 167
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          if ($post_key !== $_SESSION['key']) {
168
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             echo prepareExchangedData(
168
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                echo prepareExchangedData(
169 169
                     [
170 170
                         'error' => true,
171 171
                         'message' => langHdl('key_is_not_correct'),
172 172
                     ],
173 173
                     'encode'
174 174
                 );
175
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             break;
176
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         }
177
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         if ($_SESSION['user_read_only'] === true) {
178
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             echo prepareExchangedData(
175
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                break;
176
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }
177
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            if ($_SESSION['user_read_only'] === true) {
178
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                echo prepareExchangedData(
179 179
                     [
180 180
                         'error' => true,
181 181
                         'message' => langHdl('error_not_allowed_to'),
182 182
                     ],
183 183
                     'encode'
184 184
                 );
185
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             break;
186
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         }
185
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                break;
186
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }
187 187
 
188 188
             // decrypt and retrieve data in JSON format
189 189
             $dataReceived = prepareExchangedData($post_data, 'decode');
@@ -247,25 +247,25 @@  discard block
 block discarded – undo
247 247
             // Check KEY
248 248
 
249 249
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          if ($post_key !== $_SESSION['key']) {
250
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             echo prepareExchangedData(
250
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                echo prepareExchangedData(
251 251
                     [
252 252
                         'error' => true,
253 253
                         'message' => langHdl('key_is_not_correct'),
254 254
                     ],
255 255
                     'encode'
256 256
                 );
257
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             break;
258
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         }
259
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         if ($_SESSION['user_read_only'] === true) {
260
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             echo prepareExchangedData(
257
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                break;
258
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }
259
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            if ($_SESSION['user_read_only'] === true) {
260
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                echo prepareExchangedData(
261 261
                     [
262 262
                         'error' => true,
263 263
                         'message' => langHdl('error_not_allowed_to'),
264 264
                     ],
265 265
                     'encode'
266 266
                 );
267
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             break;
268
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         }
267
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                break;
268
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }
269 269
 
270 270
             // decrypt and retrieve data in JSON format
271 271
             $dataReceived = prepareExchangedData($post_data, 'decode');
@@ -447,25 +447,25 @@  discard block
 block discarded – undo
447 447
             // Check KEY
448 448
 
449 449
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          if ($post_key !== $_SESSION['key']) {
450
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             echo prepareExchangedData(
450
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                echo prepareExchangedData(
451 451
                     [
452 452
                         'error' => true,
453 453
                         'message' => langHdl('key_is_not_correct'),
454 454
                     ],
455 455
                     'encode'
456 456
                 );
457
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             break;
458
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         }
459
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         if ($_SESSION['user_read_only'] === true) {
460
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             echo prepareExchangedData(
457
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                break;
458
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }
459
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            if ($_SESSION['user_read_only'] === true) {
460
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                echo prepareExchangedData(
461 461
                     [
462 462
                         'error' => true,
463 463
                         'message' => langHdl('error_not_allowed_to'),
464 464
                     ],
465 465
                     'encode'
466 466
                 );
467
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             break;
468
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         }
467
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                break;
468
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }
469 469
 
470 470
             // decrypt and retrieve data in JSON format
471 471
             $dataReceived = prepareExchangedData($post_data, 'decode');
@@ -520,25 +520,25 @@  discard block
 block discarded – undo
520 520
             // Check KEY
521 521
 
522 522
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          if ($post_key !== $_SESSION['key']) {
523
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             echo prepareExchangedData(
523
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                echo prepareExchangedData(
524 524
                     [
525 525
                         'error' => true,
526 526
                         'message' => langHdl('key_is_not_correct'),
527 527
                     ],
528 528
                     'encode'
529 529
                 );
530
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             break;
531
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         }
532
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         if ($_SESSION['user_read_only'] === true) {
533
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             echo prepareExchangedData(
530
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                break;
531
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }
532
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            if ($_SESSION['user_read_only'] === true) {
533
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                echo prepareExchangedData(
534 534
                     [
535 535
                         'error' => true,
536 536
                         'message' => langHdl('error_not_allowed_to'),
537 537
                     ],
538 538
                     'encode'
539 539
                 );
540
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             break;
541
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         }
540
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                break;
541
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }
542 542
 
543 543
             // Prepare variables
544 544
             $post_role_id = filter_input(INPUT_POST, 'role_id', FILTER_SANITIZE_NUMBER_INT);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 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
 
Please login to merge, or discard this patch.
sources/users.datatable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 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
 
Please login to merge, or discard this patch.