Passed
Push — wip_sessions ( 355516...486c48 )
by Nils
05:15
created
sources/export.queries.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 ) {
69 69
     // Not allowed page
70 70
     $session->set('system-error_code', ERR_NOT_ALLOWED);
71
-    include $SETTINGS['cpassman_dir'] . '/error.php';
71
+    include $SETTINGS['cpassman_dir'].'/error.php';
72 72
     exit;
73 73
 }
74 74
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 $antiXss = new AntiXSS();
91 91
 
92 92
 // User's language loading
93
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $session->get('user-language') . '.php';
93
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$session->get('user-language').'.php';
94 94
 
95 95
 // Prepare POST variables
96 96
 $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT);
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
                         'SELECT i.id as id, i.id_tree as id_tree, i.restricted_to as restricted_to, i.perso as perso,
142 142
                             i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url,
143 143
                             i.email as email,l.date as date, i.pw_iv as pw_iv,n.renewal_period as renewal_period
144
-                        FROM ' . prefixTable('items') . ' as i
145
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
146
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
144
+                        FROM ' . prefixTable('items').' as i
145
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
146
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
147 147
                         WHERE i.inactif = %i
148 148
                         AND i.id_tree= %i
149 149
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
                                 // Run query
167 167
                                 $dataItem = DB::queryfirstrow(
168 168
                                     'SELECT i.pw AS pw, s.share_key AS share_key
169
-                                    FROM ' . prefixTable('items') . ' AS i
170
-                                    INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
169
+                                    FROM ' . prefixTable('items').' AS i
170
+                                    INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
171 171
                                     WHERE user_id = %i AND i.id = %i',
172 172
                                     $session->get('user-id'),
173 173
                                     $record['id']
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
                                 $arr_kbs = [];
192 192
                                 $rows_kb = DB::query(
193 193
                                     'SELECT b.label, b.id
194
-                                    FROM ' . prefixTable('kb_items') . ' AS a
195
-                                    INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
194
+                                    FROM ' . prefixTable('kb_items').' AS a
195
+                                    INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
196 196
                                     WHERE a.item_id = %i',
197 197
                                     $record['id']
198 198
                                 );
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                                 $arr_tags = [];
205 205
                                 $rows_tag = DB::query(
206 206
                                     'SELECT tag
207
-                                    FROM ' . prefixTable('tags') . '
207
+                                    FROM ' . prefixTable('tags').'
208 208
                                     WHERE item_id = %i',
209 209
                                     $record['id']
210 210
                                 );
@@ -216,18 +216,18 @@  discard block
 block discarded – undo
216 216
                                 $arr_trees = [];
217 217
                                 $rows_child_tree = DB::query(
218 218
                                     'SELECT t.id, t.title
219
-                                    FROM ' . prefixTable('nested_tree') . ' AS t
220
-                                    INNER JOIN ' . prefixTable('items') . ' AS i ON (t.id = i.id_tree)
219
+                                    FROM ' . prefixTable('nested_tree').' AS t
220
+                                    INNER JOIN ' . prefixTable('items').' AS i ON (t.id = i.id_tree)
221 221
                                     WHERE i.id = %i',
222 222
                                     $record['id']
223 223
                                 );
224 224
                                 foreach ($rows_child_tree as $rec_child_tree) {
225 225
                                     $stack = array();
226 226
                                     $parent = $rec_child_tree['id'];
227
-                                    while($parent != 0){
227
+                                    while ($parent != 0) {
228 228
                                         $rows_parent_tree = DB::query(
229 229
                                             'SELECT parent_id, title
230
-                                            FROM ' . prefixTable('nested_tree') . '
230
+                                            FROM ' . prefixTable('nested_tree').'
231 231
                                             WHERE id = %i',
232 232
                                             $parent
233 233
                                         );
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
             // Prepare variables
315 315
             $post_export_tag = filter_var($dataReceived['export_tag'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
316 316
             if (empty($post_export_tag) === false) {
317
-                DB::query('DELETE FROM ' . prefixTable('export') . ' WHERE export_tag = %s', $post_export_tag);
317
+                DB::query('DELETE FROM '.prefixTable('export').' WHERE export_tag = %s', $post_export_tag);
318 318
             }
319 319
             break;
320 320
 
@@ -364,9 +364,9 @@  discard block
 block discarded – undo
364 364
                         l.date as date, i.pw_iv as pw_iv,
365 365
                         n.renewal_period as renewal_period,
366 366
                         i.id_tree as tree_id
367
-                        FROM ' . prefixTable('items') . ' as i
368
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
369
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
367
+                        FROM ' . prefixTable('items').' as i
368
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
369
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
370 370
                         WHERE i.inactif = %i
371 371
                         AND i.id_tree= %i
372 372
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -392,8 +392,8 @@  discard block
 block discarded – undo
392 392
                             // Run query
393 393
                             $dataItem = DB::queryfirstrow(
394 394
                                 'SELECT i.pw AS pw, s.share_key AS share_key
395
-                                FROM ' . prefixTable('items') . ' AS i
396
-                                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
395
+                                FROM ' . prefixTable('items').' AS i
396
+                                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
397 397
                                 WHERE user_id = %i AND i.id = %i',
398 398
                                 $session->get('user-id'),
399 399
                                 $record['id']
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
                             $arr_kbs = '';
418 418
                             $rows_kb = DB::query(
419 419
                                 'SELECT b.label, b.id
420
-                                FROM ' . prefixTable('kb_items') . ' AS a
421
-                                INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
420
+                                FROM ' . prefixTable('kb_items').' AS a
421
+                                INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
422 422
                                 WHERE a.item_id = %i',
423 423
                                 $record['id']
424 424
                             );
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
                                 if (empty($arr_kbs)) {
427 427
                                     $arr_kbs = $rec_kb['label'];
428 428
                                 } else {
429
-                                    $arr_kbs .= ' | ' . $rec_kb['label'];
429
+                                    $arr_kbs .= ' | '.$rec_kb['label'];
430 430
                                 }
431 431
                             }
432 432
 
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
                             $arr_tags = '';
435 435
                             $rows_tag = DB::query(
436 436
                                 'SELECT tag
437
-                                FROM ' . prefixTable('tags') . '
437
+                                FROM ' . prefixTable('tags').'
438 438
                                 WHERE item_id = %i',
439 439
                                 $record['id']
440 440
                             );
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
                                 if (empty($arr_tags)) {
443 443
                                     $arr_tags = $rec_tag['tag'];
444 444
                                 } else {
445
-                                    $arr_tags .= ' ' . $rec_tag['tag'];
445
+                                    $arr_tags .= ' '.$rec_tag['tag'];
446 446
                                 }
447 447
                             }
448 448
 
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
             // query
521 521
             $rows = DB::query(
522 522
                 'SELECT * 
523
-                FROM ' . prefixTable('export') . ' 
523
+                FROM ' . prefixTable('export').' 
524 524
                 WHERE export_tag = %s',
525 525
                 $dataReceived['export_tag']
526 526
             );
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
                 $prev_path = '';
533 533
 
534 534
                 //Prepare the PDF file
535
-                include $SETTINGS['cpassman_dir'] . '/vendor/tecnickcom/tcpdf/tcpdf.php';
535
+                include $SETTINGS['cpassman_dir'].'/vendor/tecnickcom/tcpdf/tcpdf.php';
536 536
 
537 537
                 $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
538 538
                 $pdf->SetProtection(array('print'), $dataReceived['pdf_password'], null);
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 
545 545
                 // set default header data
546 546
                 $pdf->SetHeaderData(
547
-                    $SETTINGS['cpassman_dir'] . '/includes/images/teampass-logo2-home.png',
547
+                    $SETTINGS['cpassman_dir'].'/includes/images/teampass-logo2-home.png',
548 548
                     PDF_HEADER_LOGO_WIDTH,
549 549
                     'Teampass export',
550 550
                     $session->get('user-lastname')." ".$session->get('user-name').' @ '.date($SETTINGS['date_format']." ".$SETTINGS['time_format'], (int) time())
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
                 logEvents($SETTINGS, 'pdf_export', '', (string) $session->get('user-id'), $session->get('user-login'));
655 655
 
656 656
                 //clean table
657
-                DB::query('TRUNCATE TABLE ' . prefixTable('export'));
657
+                DB::query('TRUNCATE TABLE '.prefixTable('export'));
658 658
 
659 659
                 // Clean any content of the output buffer
660 660
                 ob_end_clean();
@@ -692,13 +692,13 @@  discard block
 block discarded – undo
692 692
             // step 1:
693 693
             // - prepare export file
694 694
             // - get full list of objects id to export
695
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
695
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
696 696
             $idsList = array();
697 697
 
698 698
             // query
699 699
             $rows = DB::query(
700 700
                 'SELECT * 
701
-                FROM ' . prefixTable('export') . ' 
701
+                FROM ' . prefixTable('export').' 
702 702
                 WHERE export_tag = %s',
703 703
                 $inputData['export_tag']
704 704
             );
@@ -735,13 +735,13 @@  discard block
 block discarded – undo
735 735
             }
736 736
             // prepare export file
737 737
             //save the file
738
-            $outstream = fopen($SETTINGS['path_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'], 'w');
738
+            $outstream = fopen($SETTINGS['path_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'], 'w');
739 739
             if ($outstream === false) {
740 740
                 echo (string) prepareExchangedData(
741 741
                     [
742 742
                         'error' => true,
743 743
                         'message' => $lang->get('error_while_creating_file'),
744
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
744
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
745 745
                     ],
746 746
                     'encode'
747 747
                 );
@@ -767,12 +767,12 @@  discard block
 block discarded – undo
767 767
     </style>
768 768
     </head>
769 769
     <body>
770
-    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $inputData['password']) . '" />
770
+    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $inputData['password']).'" />
771 771
     <div id="header">
772
-    ' . TP_TOOL_NAME . ' - Off Line mode
772
+    ' . TP_TOOL_NAME.' - Off Line mode
773 773
     </div>
774 774
     <div style="margin:10px; font-size:9px;">
775
-    <i>This page was generated by <b>' . $session->get('user-name') . ' ' . $session->get('user-lastname') . '</b>, the ' . date('Y/m/d H:i:s') . '.</i>
775
+    <i>This page was generated by <b>' . $session->get('user-name').' '.$session->get('user-lastname').'</b>, the '.date('Y/m/d H:i:s').'.</i>
776 776
     <span id="info_page" style="margin-left:20px; font-weight:bold; font-size: 14px; color:red;"></span>
777 777
     </div>
778 778
     <div id="information"></div>
@@ -783,11 +783,11 @@  discard block
 block discarded – undo
783 783
     <div>
784 784
     <table id="itemsTable">
785 785
         <thead><tr>
786
-            <th style="width:15%;">' . $lang->get('label') . '</th>
787
-            <th style="width:10%;">' . $lang->get('pw') . '</th>
788
-            <th style="width:30%;">' . $lang->get('description') . '</th>
789
-            <th style="width:5%;">' . $lang->get('user_login') . '</th>
790
-            <th style="width:20%;">' . $lang->get('url') . '</th>
786
+            <th style="width:15%;">' . $lang->get('label').'</th>
787
+            <th style="width:10%;">' . $lang->get('pw').'</th>
788
+            <th style="width:30%;">' . $lang->get('description').'</th>
789
+            <th style="width:5%;">' . $lang->get('user_login').'</th>
790
+            <th style="width:20%;">' . $lang->get('url').'</th>
791 791
         </tr></thead>
792 792
         <tbody id="itemsTable_tbody">'
793 793
             );
@@ -801,8 +801,8 @@  discard block
 block discarded – undo
801 801
                     'loop' => true,
802 802
                     'ids_list' => json_encode($idsList),
803 803
                     'ids_count' => count($idsList),
804
-                    'file_path' => $SETTINGS['path_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'],
805
-                    'file_link' => $SETTINGS['url_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'],
804
+                    'file_path' => $SETTINGS['path_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'],
805
+                    'file_link' => $SETTINGS['url_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'],
806 806
                     'export_tag' => $inputData['export_tag'],
807 807
                 ],
808 808
                 'encode'
@@ -842,12 +842,12 @@  discard block
 block discarded – undo
842 842
 
843 843
             $full_listing = array();
844 844
             $items_id_list = array();
845
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
845
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
846 846
 
847 847
             // query
848 848
             $rows = DB::query(
849 849
                 'SELECT * 
850
-                FROM ' . prefixTable('export') . ' 
850
+                FROM ' . prefixTable('export').' 
851 851
                 WHERE export_tag = %s AND item_id IN %ls',
852 852
                 $inputData['export_tag'],
853 853
                 $inputData['idsList']
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
                         [
862 862
                             'error' => true,
863 863
                             'message' => $lang->get('error_while_creating_file'),
864
-                            'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
864
+                            'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
865 865
                         ],
866 866
                         'encode'
867 867
                     );
@@ -903,13 +903,13 @@  discard block
 block discarded – undo
903 903
                         if (empty($arboHtml)) {
904 904
                             $arboHtml = $arboHtml_tmp;
905 905
                         } else {
906
-                            $arboHtml .= ' » ' . $arboHtml_tmp;
906
+                            $arboHtml .= ' » '.$arboHtml_tmp;
907 907
                         }
908 908
                     }
909 909
                     fputs(
910 910
                         $outstream,
911 911
                         '
912
-        <tr class="path"><td colspan="5">' . $arboHtml . '</td></tr>'
912
+        <tr class="path"><td colspan="5">' . $arboHtml.'</td></tr>'
913 913
                     );
914 914
                     $idTree = $record['folder_id'];
915 915
 
@@ -917,12 +917,12 @@  discard block
 block discarded – undo
917 917
                     fputs(
918 918
                         $outstream,
919 919
                         '
920
-        <tr class="' . $lineType . '">
921
-            <td>' . addslashes($record['label']) . '</td>
922
-            <td align="center"><span class="span_pw" id="span_' . $record['item_id'] . '"><a href="#" onclick="decryptme(' . $record['item_id'] . ', \'' . $encPw . '\');return false;">Decrypt </a></span><input type="hidden" id="hide_' . $record['item_id'] . '" value="' . $encPw . '" /></td>
923
-            <td>' . (empty($record['description']) === true ? '&nbsp;' : addslashes(str_replace(array(';', '<br />'), array('|', "\n\r"), stripslashes(mb_convert_encoding($record['description'], 'ISO-8859-1', 'UTF-8'))))) . '</td>
924
-            <td align="center">' . (empty($record['login']) === true ? '&nbsp;' : addslashes($record['login'])) . '</td>
925
-            <td align="center">' . (empty($record['url']) === true ? '&nbsp;' : addslashes($record['url'])) . '</td>
920
+        <tr class="' . $lineType.'">
921
+            <td>' . addslashes($record['label']).'</td>
922
+            <td align="center"><span class="span_pw" id="span_' . $record['item_id'].'"><a href="#" onclick="decryptme('.$record['item_id'].', \''.$encPw.'\');return false;">Decrypt </a></span><input type="hidden" id="hide_'.$record['item_id'].'" value="'.$encPw.'" /></td>
923
+            <td>' . (empty($record['description']) === true ? '&nbsp;' : addslashes(str_replace(array(';', '<br />'), array('|', "\n\r"), stripslashes(mb_convert_encoding($record['description'], 'ISO-8859-1', 'UTF-8'))))).'</td>
924
+            <td align="center">' . (empty($record['login']) === true ? '&nbsp;' : addslashes($record['login'])).'</td>
925
+            <td align="center">' . (empty($record['url']) === true ? '&nbsp;' : addslashes($record['url'])).'</td>
926 926
         </tr>'
927 927
                     );
928 928
                 }
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
             $inputData['password'] = (string) filter_var($dataReceived['password'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
972 972
             
973 973
             // Load includes
974
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
974
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
975 975
 
976 976
             // read the content of the temporary file
977 977
             $handle = fopen($inputData['filename'].'.txt', 'r');
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
                     [
981 981
                         'error' => true,
982 982
                         'message' => $lang->get('error_while_creating_file'),
983
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
983
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
984 984
                     ],
985 985
                     'encode'
986 986
                 );
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
                     [
993 993
                         'error' => true,
994 994
                         'message' => $lang->get('error_while_creating_file'),
995
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
995
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
996 996
                     ],
997 997
                     'encode'
998 998
                 );
@@ -1008,9 +1008,9 @@  discard block
 block discarded – undo
1008 1008
             $chunks = explode('|#|#|', chunk_split($contents, 10000, '|#|#|'));
1009 1009
             foreach ($chunks as $chunk) {
1010 1010
                 if (empty($encrypted_text) === true) {
1011
-                    $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password'] );
1011
+                    $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password']);
1012 1012
                 } else {
1013
-                    $encrypted_text .= '|#|#|' . GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password'] );
1013
+                    $encrypted_text .= '|#|#|'.GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password']);
1014 1014
                 }
1015 1015
             }
1016 1016
 
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
                     [
1022 1022
                         'error' => true,
1023 1023
                         'message' => $lang->get('error_while_creating_file'),
1024
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
1024
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
1025 1025
                     ],
1026 1026
                     'encode'
1027 1027
                 );
@@ -1034,9 +1034,9 @@  discard block
 block discarded – undo
1034 1034
         </table></div>
1035 1035
         <input type="button" value="Hide all" onclick="hideAll()" />
1036 1036
         <div id="footer" style="text-align:center;">
1037
-            <a href="https://teampass.net/about/" target="_blank">' . TP_TOOL_NAME . '&nbsp;' . TP_VERSION . '&nbsp;' . TP_COPYRIGHT . '</a>
1037
+            <a href="https://teampass.net/about/" target="_blank">' . TP_TOOL_NAME.'&nbsp;'.TP_VERSION.'&nbsp;'.TP_COPYRIGHT.'</a>
1038 1038
         </div>
1039
-        <div id="enc_html" style="display:none;">' . $encrypted_text . '</div>
1039
+        <div id="enc_html" style="display:none;">' . $encrypted_text.'</div>
1040 1040
         </body>
1041 1041
     </html>
1042 1042
     <script type="text/javascript">
@@ -1139,12 +1139,12 @@  discard block
 block discarded – undo
1139 1139
             fclose($outstream);
1140 1140
 
1141 1141
             //clean table
1142
-            DB::query('TRUNCATE TABLE ' . prefixTable('export'));
1142
+            DB::query('TRUNCATE TABLE '.prefixTable('export'));
1143 1143
 
1144 1144
             echo (string) prepareExchangedData(
1145 1145
                 [
1146 1146
                     'error' => false,
1147
-                    'filelink' => $inputData['file_link'] ,
1147
+                    'filelink' => $inputData['file_link'],
1148 1148
                 ],
1149 1149
                 'encode'
1150 1150
             );
Please login to merge, or discard this patch.
sources/utils.queries.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 ) {
70 70
     // Not allowed page
71 71
     $session->set('system-error_code', ERR_NOT_ALLOWED);
72
-    include $SETTINGS['cpassman_dir'] . '/error.php';
72
+    include $SETTINGS['cpassman_dir'].'/error.php';
73 73
     exit;
74 74
 }
75 75
 
Please login to merge, or discard this patch.
sources/favourites.queries.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 ) {
70 70
     // Not allowed page
71 71
     $session->set('system-error_code', ERR_NOT_ALLOWED);
72
-    include $SETTINGS['cpassman_dir'] . '/error.php';
72
+    include $SETTINGS['cpassman_dir'].'/error.php';
73 73
     exit;
74 74
 }
75 75
 
Please login to merge, or discard this patch.
sources/items.logs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 ) {
70 70
     // Not allowed page
71 71
     $session->set('system-error_code', ERR_NOT_ALLOWED);
72
-    include $SETTINGS['cpassman_dir'] . '/error.php';
72
+    include $SETTINGS['cpassman_dir'].'/error.php';
73 73
     exit;
74 74
 }
75 75
 
Please login to merge, or discard this patch.
sources/user.logs.datatables.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 ) {
70 70
     // Not allowed page
71 71
     $session->set('system-error_code', ERR_NOT_ALLOWED);
72
-    include $SETTINGS['cpassman_dir'] . '/error.php';
72
+    include $SETTINGS['cpassman_dir'].'/error.php';
73 73
     exit;
74 74
 }
75 75
 
Please login to merge, or discard this patch.
install--ASUPPRIMER/upgrade_run_3.0.0_logs.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
         $database,
79 79
         $port
80 80
     );
81
-	$db_link->set_charset(DB_ENCODING);
81
+    $db_link->set_charset(DB_ENCODING);
82 82
 } else {
83 83
     $res = 'Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error());
84 84
     echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]';
Please login to merge, or discard this patch.
install--ASUPPRIMER/upgrade_run_3.0.0_files.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
         $database,
79 79
         $port
80 80
     );
81
-	$db_link->set_charset(DB_ENCODING);
81
+    $db_link->set_charset(DB_ENCODING);
82 82
 } else {
83 83
     $res = 'Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error());
84 84
     echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]';
Please login to merge, or discard this patch.
install--ASUPPRIMER/upgrade_run_3.0.0_fields.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
         $database,
79 79
         $port
80 80
     );
81
-	$db_link->set_charset(DB_ENCODING);
81
+    $db_link->set_charset(DB_ENCODING);
82 82
 } else {
83 83
     $res = 'Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error());
84 84
     echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]';
Please login to merge, or discard this patch.
sources/ldap.queries.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 ) {
71 71
     // Not allowed page
72 72
     $session->set('system-error_code', ERR_NOT_ALLOWED);
73
-    include $SETTINGS['cpassman_dir'] . '/error.php';
73
+    include $SETTINGS['cpassman_dir'].'/error.php';
74 74
     exit;
75 75
 }
76 76
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                     $openLdapExtra = new OpenLdapExtra();
145 145
                     break;
146 146
                 default:
147
-                    throw new Exception("Unsupported LDAP type: " . $SETTINGS['ldap_type']);
147
+                    throw new Exception("Unsupported LDAP type: ".$SETTINGS['ldap_type']);
148 148
             }
149 149
         } catch (Exception $e) {
150 150
             echo  prepareExchangedData(
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             // 2- Get user info from AD
160 160
             // We want to isolate attribute ldap_user_attribute or mostly samAccountName
161 161
             $userADInfos = $ldapConnection->query()
162
-                ->where((isset($SETTINGS['ldap_user_attribute']) ===true && empty($SETTINGS['ldap_user_attribute']) === false) ? $SETTINGS['ldap_user_attribute'] : 'samaccountname', '=', $post_username)
162
+                ->where((isset($SETTINGS['ldap_user_attribute']) === true && empty($SETTINGS['ldap_user_attribute']) === false) ? $SETTINGS['ldap_user_attribute'] : 'samaccountname', '=', $post_username)
163 163
                 ->firstOrFail();
164 164
 
165 165
             // Is user enabled? Only ActiveDirectory
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             echo prepareExchangedData(
183 183
                 array(
184 184
                     'error' => true,
185
-                    'message' => $lang->get('error')." - ".(isset($error) === true ? $error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage() : $e),
185
+                    'message' => $lang->get('error')." - ".(isset($error) === true ? $error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage() : $e),
186 186
                 ),
187 187
                 'encode'
188 188
             );
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
             // For OpenLDAP and others, we use attribute dn
196 196
             $userAuthAttempt = $ldapConnection->auth()->attempt(
197 197
                 $SETTINGS['ldap_type'] === 'ActiveDirectory' ?
198
-                    $userADInfos['userprincipalname'][0] :  // refering to https://ldaprecord.com/docs/core/v2/authentication#basic-authentication
198
+                    $userADInfos['userprincipalname'][0] : // refering to https://ldaprecord.com/docs/core/v2/authentication#basic-authentication
199 199
                     $userADInfos['dn'],
200 200
                 $post_password
201 201
             );
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
             echo prepareExchangedData(
217 217
                 array(
218 218
                     'error' => true,
219
-                    'message' => $lang->get('error')." - ".(isset($error) === true ? $error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage() : $e),
219
+                    'message' => $lang->get('error')." - ".(isset($error) === true ? $error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage() : $e),
220 220
                 ),
221 221
                 'encode'
222 222
             );
Please login to merge, or discard this patch.