Completed
Push — development ( 362b6c...477849 )
by Nils
08:04
created
profile.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@
 block discarded – undo
158 158
 
159 159
 // if DUOSecurity enabled then changing PWD is not allowed
160 160
 if (!isset($_SESSION['settings']['duo']) || $_SESSION['settings']['duo'] == 0)
161
-   echo '
161
+    echo '
162 162
     <div id="div_change_password" style="display:none; padding:5px;" class="ui-widget ui-state-default">
163 163
         <div style="text-align:center;margin:5px;padding:3px;" id="change_pwd_complexPw" class="ui-widget ui-state-active ui-corner-all"></div>
164 164
         <label for="new_pw" class="form_label">'.$LANG['index_new_pw'].' :</label>
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 if (isset($_SESSION['last_pw_change']) && !empty($_SESSION['last_pw_change'])) {
115 115
     echo '
116 116
     <div style="margin-bottom:6px;">
117
-        <i class="fa fa-calendar fa-fw fa-lg"></i>&nbsp;'. $LANG['index_last_pw_change'].' ', isset($_SESSION['settings']['date_format']) ? date($_SESSION['settings']['date_format'], $_SESSION['last_pw_change']) : (isset($_SESSION['last_pw_change']) ? date("d/m/Y", $_SESSION['last_pw_change']) : "-"). '. ', $_SESSION['numDaysBeforePwExpiration'] == "infinite" ? '' : $LANG['index_pw_expiration'].' '.$_SESSION['numDaysBeforePwExpiration'].' '.$LANG['days'].'
117
+        <i class="fa fa-calendar fa-fw fa-lg"></i>&nbsp;'. $LANG['index_last_pw_change'].' ', isset($_SESSION['settings']['date_format']) ? date($_SESSION['settings']['date_format'], $_SESSION['last_pw_change']) : (isset($_SESSION['last_pw_change']) ? date("d/m/Y", $_SESSION['last_pw_change']) : "-").'. ', $_SESSION['numDaysBeforePwExpiration'] == "infinite" ? '' : $LANG['index_pw_expiration'].' '.$_SESSION['numDaysBeforePwExpiration'].' '.$LANG['days'].'
118 118
     </div>';
119 119
 }
120 120
 echo '
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
     $(".tip").tooltipster({multiple: true});
218 218
     // password
219 219
     $("#but_change_password").click(function() {
220
-        $("#change_pwd_complexPw").html("<?php echo $LANG['complex_asked'];?> : <?php echo $_SESSION['settings']['pwComplexity'][$_SESSION['user_pw_complexity']][1];?>");
220
+        $("#change_pwd_complexPw").html("<?php echo $LANG['complex_asked']; ?> : <?php echo $_SESSION['settings']['pwComplexity'][$_SESSION['user_pw_complexity']][1]; ?>");
221 221
         $("#change_pwd_error").hide();
222 222
       $("#div_change_psk, #div_reset_psk").hide();
223 223
 
@@ -232,35 +232,35 @@  discard block
 block discarded – undo
232 232
         $("#new_pw").simplePassMeter({
233 233
             "requirements": {},
234 234
             "container": "#pw_strength",
235
-            "defaultText" : "<?php echo $LANG['index_pw_level_txt'];?>",
235
+            "defaultText" : "<?php echo $LANG['index_pw_level_txt']; ?>",
236 236
             "ratings": [
237 237
                 {"minScore": 0,
238 238
                     "className": "meterFail",
239
-                    "text": "<?php echo $LANG['complex_level0'];?>"
239
+                    "text": "<?php echo $LANG['complex_level0']; ?>"
240 240
                 },
241 241
                 {"minScore": 25,
242 242
                     "className": "meterWarn",
243
-                    "text": "<?php echo $LANG['complex_level1'];?>"
243
+                    "text": "<?php echo $LANG['complex_level1']; ?>"
244 244
                 },
245 245
                 {"minScore": 50,
246 246
                     "className": "meterWarn",
247
-                    "text": "<?php echo $LANG['complex_level2'];?>"
247
+                    "text": "<?php echo $LANG['complex_level2']; ?>"
248 248
                 },
249 249
                 {"minScore": 60,
250 250
                     "className": "meterGood",
251
-                    "text": "<?php echo $LANG['complex_level3'];?>"
251
+                    "text": "<?php echo $LANG['complex_level3']; ?>"
252 252
                 },
253 253
                 {"minScore": 70,
254 254
                     "className": "meterGood",
255
-                    "text": "<?php echo $LANG['complex_level4'];?>"
255
+                    "text": "<?php echo $LANG['complex_level4']; ?>"
256 256
                 },
257 257
                 {"minScore": 80,
258 258
                     "className": "meterExcel",
259
-                    "text": "<?php echo $LANG['complex_level5'];?>"
259
+                    "text": "<?php echo $LANG['complex_level5']; ?>"
260 260
                 },
261 261
                 {"minScore": 90,
262 262
                     "className": "meterExcel",
263
-                    "text": "<?php echo $LANG['complex_level6'];?>"
263
+                    "text": "<?php echo $LANG['complex_level6']; ?>"
264 264
                 }
265 265
             ]
266 266
         });
@@ -284,32 +284,32 @@  discard block
 block discarded – undo
284 284
                         type                : "change_pw",
285 285
                         change_pw_origine   : "user_change",
286 286
                         complexity          : $("#pw_strength_value").val(),
287
-                        data                : prepareExchangedData(data, "encode", "<?php echo $_SESSION['key'];?>")
287
+                        data                : prepareExchangedData(data, "encode", "<?php echo $_SESSION['key']; ?>")
288 288
                     },
289 289
                     function(data) {
290 290
                         if (data[0].error == "already_used") {
291 291
                             $("#new_pw, #new_pw2").val("");
292
-                            $("#change_pwd_error").addClass("ui-state-error ui-corner-all").show().html("<span><?php echo $LANG['pw_used'];?></span>");
292
+                            $("#change_pwd_error").addClass("ui-state-error ui-corner-all").show().html("<span><?php echo $LANG['pw_used']; ?></span>");
293 293
                         } else if (data[0].error == "complexity_level_not_reached") {
294 294
                             $("#new_pw, #new_pw2").val("");
295
-                            $("#change_pwd_error").addClass("ui-state-error ui-corner-all").show().html("<span><?php echo $LANG['error_complex_not_enought'];?></span>");
295
+                            $("#change_pwd_error").addClass("ui-state-error ui-corner-all").show().html("<span><?php echo $LANG['error_complex_not_enought']; ?></span>");
296 296
                         } else {
297 297
                             $("#div_change_password").hide();
298 298
                             $("#dialog_user_profil").dialog("option", "height", 450);
299 299
                             $("#new_pw, #new_pw2").val("");
300 300
                         }
301 301
                         $("#password_change_wait").hide();
302
-                        $("#profile_info_box").html("<?php echo $LANG['alert_message_done'];?>").show();
302
+                        $("#profile_info_box").html("<?php echo $LANG['alert_message_done']; ?>").show();
303 303
                         setTimeout(function(){$("#profile_info_box").effect( "fade", "slow" );}, 1000);
304 304
                     },
305 305
                     "json"
306 306
                 );
307 307
             } else {
308
-                $("#change_pwd_error").addClass("ui-state-error ui-corner-all").show().html("<?php echo $LANG['error_complex_not_enought'];?>");
308
+                $("#change_pwd_error").addClass("ui-state-error ui-corner-all").show().html("<?php echo $LANG['error_complex_not_enought']; ?>");
309 309
                 setTimeout(function(){$("#change_pwd_error").effect( "fade", "slow" );}, 1000);
310 310
             }
311 311
         } else {
312
-            $("#change_pwd_error").addClass("ui-state-error ui-corner-all").show().html("<?php echo $LANG['index_pw_error_identical'];?>");
312
+            $("#change_pwd_error").addClass("ui-state-error ui-corner-all").show().html("<?php echo $LANG['index_pw_error_identical']; ?>");
313 313
             setTimeout(function(){$("#change_pwd_error").effect( "fade", "slow" );}, 1000);
314 314
         }
315 315
     });
@@ -362,8 +362,8 @@  discard block
 block discarded – undo
362 362
                 var tmp = Math.random().toString(36).substring(7);
363 363
 
364 364
                 up.settings.multipart_params = {
365
-                    "PHPSESSID":"<?php echo $_SESSION['user_id'];?>",
366
-                    "newFileName":"user<?php echo $_SESSION['user_id'];?>"+tmp,
365
+                    "PHPSESSID":"<?php echo $_SESSION['user_id']; ?>",
366
+                    "newFileName":"user<?php echo $_SESSION['user_id']; ?>"+tmp,
367 367
                     "type_upload":"upload_profile_photo",
368 368
                     "user_token": $("#profile_user_token").val()
369 369
                 };
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 
374 374
     // Show runtime status
375 375
     uploader_photo.bind("Init", function(up, params) {
376
-        $("#plupload_runtime2").html("<?php echo $LANG['runtime_upload'];?> " + params.runtime).removeClass('ui-state-error');
376
+        $("#plupload_runtime2").html("<?php echo $LANG['runtime_upload']; ?> " + params.runtime).removeClass('ui-state-error');
377 377
         $("#upload_enabled2").val("1");
378 378
     });
379 379
 
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
     });
422 422
     $(".editable_select").editable("sources/users.queries.php", {
423 423
         indicator : "<img src=\'includes/images/loading.gif\' />",
424
-        data   : " {'full':'<?php echo $LANG['full'];?>','sequential':'<?php echo $LANG['sequential'];?>', 'selected':'<?php echo $_SESSION['user_settings']['treeloadstrategy'];?>'}",
424
+        data   : " {'full':'<?php echo $LANG['full']; ?>','sequential':'<?php echo $LANG['sequential']; ?>', 'selected':'<?php echo $_SESSION['user_settings']['treeloadstrategy']; ?>'}",
425 425
         type   : 'select',
426 426
         select : true,
427 427
         onblur : "cancel",
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
     });
432 432
     $(".editable_language").editable("sources/users.queries.php", {
433 433
         indicator : "<img src=\'includes/images/loading.gif\' />",
434
-        data   : '<?php print json_encode($arraFlags);?>',
434
+        data   : '<?php print json_encode($arraFlags); ?>',
435 435
         type   : 'select',
436 436
         select : true,
437 437
         onblur : "cancel",
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
     });
442 442
     $(".editable_timezone").editable("sources/users.queries.php", {
443 443
         indicator : "<img src=\'includes/images/loading.gif\' />",
444
-        data : '<?php print json_encode($arrayTimezones);?>',
444
+        data : '<?php print json_encode($arrayTimezones); ?>',
445 445
         type   : 'select',
446 446
         select : true,
447 447
         onblur : "cancel",
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
     });
452 452
     $(".editable_yesno").editable("sources/users.queries.php", {
453 453
         indicator : "<img src=\'includes/images/loading.gif\' />",
454
-        data : '{"O":"<?php echo $LANG['no'];?>","1":"<?php echo $LANG['yes'];?>"}',
454
+        data : '{"O":"<?php echo $LANG['no']; ?>","1":"<?php echo $LANG['yes']; ?>"}',
455 455
         type   : 'select',
456 456
         select : true,
457 457
         onblur : "cancel",
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 
473 473
       // prepare fields
474 474
       $("#new_personal_saltkey").val("");
475
-      $("#old_personal_saltkey").val("<?php echo addslashes(str_replace("&quot;", '"', @$_SESSION['my_sk']));?>");
475
+      $("#old_personal_saltkey").val("<?php echo addslashes(str_replace("&quot;", '"', @$_SESSION['my_sk'])); ?>");
476 476
 
477 477
       $("#div_change_psk").show();
478 478
       $("#dialog_user_profil").dialog("option", "height", 600);
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 
485 485
         if ($("#new_personal_saltkey").val() === "" || $("#new_personal_saltkey").val() === "") {
486 486
             $("#psk_change_wait").hide();
487
-            $("#div_change_psk").before('<div id="tmp_msg" class="ui-widget ui-state-error ui-corner-all" style="margin-bottom:3px; padding:3px;"><?php echo addslashes($LANG['home_personal_saltkey_label']);?></div>');
487
+            $("#div_change_psk").before('<div id="tmp_msg" class="ui-widget ui-state-error ui-corner-all" style="margin-bottom:3px; padding:3px;"><?php echo addslashes($LANG['home_personal_saltkey_label']); ?></div>');
488 488
 
489 489
             setTimeout(function(){$("#tmp_msg").effect( "fade", "slow" );$("#tmp_msg").remove();}, 1000);
490 490
             return false;
@@ -499,11 +499,11 @@  discard block
 block discarded – undo
499 499
             "sources/main.queries.php",
500 500
             {
501 501
                 type            : "change_personal_saltkey",
502
-                data_to_share   : prepareExchangedData(data_to_share, "encode", "<?php echo $_SESSION['key'];?>"),
503
-                key             : "<?php echo $_SESSION['key'];?>"
502
+                data_to_share   : prepareExchangedData(data_to_share, "encode", "<?php echo $_SESSION['key']; ?>"),
503
+                key             : "<?php echo $_SESSION['key']; ?>"
504 504
             },
505 505
             function(data) {
506
-                data = prepareExchangedData(data , "decode", "<?php echo $_SESSION['key'];?>");
506
+                data = prepareExchangedData(data , "decode", "<?php echo $_SESSION['key']; ?>");
507 507
                 if (data.error == "no") {
508 508
                     changePersonalSaltKey(data_to_share, data.list, data.nb_total);
509 509
                 } else {
@@ -538,12 +538,12 @@  discard block
 block discarded – undo
538 538
          "sources/main.queries.php",
539 539
          {
540 540
             type    : "reset_personal_saltkey",
541
-            data_to_share   : prepareExchangedData(data_to_share, "encode", "<?php echo $_SESSION['key'];?>"),
542
-            key             : "<?php echo $_SESSION['key'];?>"
541
+            data_to_share   : prepareExchangedData(data_to_share, "encode", "<?php echo $_SESSION['key']; ?>"),
542
+            key             : "<?php echo $_SESSION['key']; ?>"
543 543
          },
544 544
          function(data) {
545 545
             $("#psk_reset_wait").hide();
546
-            $("#button_reset_psk").after('<div id="reset_temp"><?php echo $LANG['alert_message_done'];?></div>');
546
+            $("#button_reset_psk").after('<div id="reset_temp"><?php echo $LANG['alert_message_done']; ?></div>');
547 547
             setTimeout(function(){$("#div_reset_psk").effect( "fade", "slow" ); $("#reset_temp").remove();}, 1500);
548 548
          }
549 549
       );
@@ -571,14 +571,14 @@  discard block
 block discarded – undo
571 571
          var regex = new RegExp("^[a-zA-Z0-9.,/#&$@()%*]+$");
572 572
          var key = event.key;
573 573
          if (!regex.test(key)) {
574
-            $("#field_warning").html("<?php echo addslashes($LANG['character_not_allowed']);?>").stop(true,true).show().fadeOut(1000);
574
+            $("#field_warning").html("<?php echo addslashes($LANG['character_not_allowed']); ?>").stop(true,true).show().fadeOut(1000);
575 575
             event.preventDefault();
576 576
             return false;
577 577
          }
578 578
          break;
579 579
       }
580 580
    }).bind("paste",function(e){
581
-      $("#field_warning").html("<?php echo addslashes($LANG['error_not_allowed_to']);?>").stop(true,true).show().fadeOut(1000);
581
+      $("#field_warning").html("<?php echo addslashes($LANG['error_not_allowed_to']); ?>").stop(true,true).show().fadeOut(1000);
582 582
       e.preventDefault();
583 583
    });
584 584
 });
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
       "sources/main.queries.php",
604 604
         {
605 605
            type    : "store_personal_saltkey",
606
-           data    : prepareExchangedData(data, "encode", "<?php echo $_SESSION['key'];?>"),
606
+           data    : prepareExchangedData(data, "encode", "<?php echo $_SESSION['key']; ?>"),
607 607
            debug   : true
608 608
         },
609 609
         function(data){
@@ -617,13 +617,13 @@  discard block
 block discarded – undo
617 617
                     "sources/utils.queries.php",
618 618
                     {
619 619
                         type            : "reencrypt_personal_pwd",
620
-                        data_to_share   : prepareExchangedData(credentials, "encode", "<?php echo $_SESSION['key'];?>"),
620
+                        data_to_share   : prepareExchangedData(credentials, "encode", "<?php echo $_SESSION['key']; ?>"),
621 621
                         currentId       : currentID,
622
-                        key             : "<?php echo $_SESSION['key'];?>"
622
+                        key             : "<?php echo $_SESSION['key']; ?>"
623 623
                     },
624 624
                     function(data){
625 625
                         if (currentID == "") {
626
-                            $("#psk_change_wait_info").html("<?php echo $LANG['alert_message_done'];?>");
626
+                            $("#psk_change_wait_info").html("<?php echo $LANG['alert_message_done']; ?>");
627 627
                             location.reload();
628 628
                         } else {
629 629
                             if (data[0].error == "") {
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,8 +95,10 @@  discard block
 block discarded – undo
95 95
       <li class="menu_150" style="padding:4px; text-align:left;"><i class="fa fa-bars fa-fw"></i>&nbsp;'.$LANG['admin_actions_title'].'
96 96
          <ul class="menu_250" style="text-align:left;">
97 97
             <li id="but_pickfiles_photo"><i class="fa fa-camera fa-fw"></i> &nbsp;'.$LANG['upload_new_avatar'].'</li>';
98
-            if (!isset($_SESSION['settings']['duo']) || $_SESSION['settings']['duo'] == 0) echo '
98
+            if (!isset($_SESSION['settings']['duo']) || $_SESSION['settings']['duo'] == 0) {
99
+                echo '
99 100
             <li id="but_change_password"><i class="fa fa-key fa-fw"></i> &nbsp;'.$LANG['index_change_pw'].'</li>';
101
+            }
100 102
             echo '
101 103
             <li id="but_change_psk"><i class="fa fa-lock fa-fw"></i> &nbsp;'.$LANG['menu_title_new_personal_saltkey'].'</li>
102 104
             <li id="but_reset_psk"><i class="fa fa-eraser fa-fw"></i> &nbsp;'.$LANG['personal_saltkey_lost'].'</li>
@@ -157,7 +159,7 @@  discard block
 block discarded – undo
157 159
     <div id="filelist_photo" style="display:none;"></div>';
158 160
 
159 161
 // if DUOSecurity enabled then changing PWD is not allowed
160
-if (!isset($_SESSION['settings']['duo']) || $_SESSION['settings']['duo'] == 0)
162
+if (!isset($_SESSION['settings']['duo']) || $_SESSION['settings']['duo'] == 0) {
161 163
    echo '
162 164
     <div id="div_change_password" style="display:none; padding:5px;" class="ui-widget ui-state-default">
163 165
         <div style="text-align:center;margin:5px;padding:3px;" id="change_pwd_complexPw" class="ui-widget ui-state-active ui-corner-all"></div>
@@ -171,6 +173,7 @@  discard block
 block discarded – undo
171 173
         <span class="button" id="button_change_pw">'.$LANG['index_change_pw_button'].'</span>&nbsp;
172 174
         <span id="password_change_wait" style="display:none;"><i class="fa fa-cog fa-spin"></i>&nbsp;'.$LANG['please_wait'].'</span>
173 175
     </div>';
176
+}
174 177
 
175 178
 //change the saltkey dialogbox
176 179
 echo '
Please login to merge, or discard this patch.
error.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,13 +67,13 @@
 block discarded – undo
67 67
         <div class="ui-state-error ui-corner-all error" >'.$LANG['error_not_exists'].'</div>';
68 68
     } elseif (@$_SESSION['error']['code'] == ERR_SESS_EXPIRED) {
69 69
         echo '
70
-        <div class="ui-state-error ui-corner-all error" style="text-align:center;" >'.$LANG['index_session_expired'].'<br /><br /><a href="index.php" />'.$LANG['home'] .'</a></div>';
70
+        <div class="ui-state-error ui-corner-all error" style="text-align:center;" >'.$LANG['index_session_expired'].'<br /><br /><a href="index.php" />'.$LANG['home'].'</a></div>';
71 71
     } elseif (@$_SESSION['error']['code'] == ERR_NO_MCRYPT) {
72 72
         echo '
73
-        <div class="ui-state-error ui-corner-all error" style="text-align:center;" >'.$LANG['error_mcrypt_not_loaded'].'<br /><br /><a href="index.php" />'.$LANG['home'] .'</a></div>';
73
+        <div class="ui-state-error ui-corner-all error" style="text-align:center;" >'.$LANG['error_mcrypt_not_loaded'].'<br /><br /><a href="index.php" />'.$LANG['home'].'</a></div>';
74 74
     } elseif (@$_SESSION['error']['code'] == ERR_VALID_SESSION) {
75 75
         echo '
76
-        <div class="ui-state-error ui-corner-all error" style="text-align:center;" >'.$LANG['error_not_authorized'].'<br /><br /><a href="index.php" />'.$LANG['home'] .'</a></div>';
76
+        <div class="ui-state-error ui-corner-all error" style="text-align:center;" >'.$LANG['error_not_authorized'].'<br /><br /><a href="index.php" />'.$LANG['home'].'</a></div>';
77 77
     }
78 78
 }
79 79
 
Please login to merge, or discard this patch.
ssh.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 ) {
24 24
     die('Hacking attempt...');
25 25
 }
26
-$_SESSION['settings']['enable_server_password_change']  = 1;
26
+$_SESSION['settings']['enable_server_password_change'] = 1;
27 27
 /* do checks */
28 28
 require_once $_SESSION['settings']['cpassman_dir'].'/includes/config/include.php';
29 29
 require_once $_SESSION['settings']['cpassman_dir'].'/sources/checks.php';
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             type    : "server_auto_update_password_frequency",
137 137
             id      : $('#selected_items').val(),
138 138
             freq    : $('#ssh_freq').val(),
139
-            key     : "<?php echo $_SESSION['key'];?>"
139
+            key     : "<?php echo $_SESSION['key']; ?>"
140 140
         },
141 141
         function(data) {
142 142
             if (data[0].error != "") {
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                     .addClass( "ui-state-error" );
148 148
             } else {
149 149
                 $("#cronned_task_error")
150
-                    .html("<?php echo $LANG['alert_message_done'];?>")
150
+                    .html("<?php echo $LANG['alert_message_done']; ?>")
151 151
                     .show()
152 152
                     .removeClass( "ui-state-error" )
153 153
                     .addClass( "ui-state-focus" );
@@ -161,37 +161,37 @@  discard block
 block discarded – undo
161 161
 {
162 162
     // check if new password is set
163 163
     if($("#ausp_pwd").val() == "") {
164
-        $("#dialog_auto_update_server_pwd_info").html('<i class="fa fa-warning"></i>&nbsp;<?php echo $LANG['error_new_pwd_missing'];?>').show();
164
+        $("#dialog_auto_update_server_pwd_info").html('<i class="fa fa-warning"></i>&nbsp;<?php echo $LANG['error_new_pwd_missing']; ?>').show();
165 165
         return false;
166 166
     }
167 167
     // check if new password is set
168 168
     if($("#ausp_ssh_root").val() == "" || $("#ausp_ssh_pwd").val() == "") {
169
-        $("#dialog_auto_update_server_pwd_info").html('<i class="fa fa-warning"></i>&nbsp;<?php echo $LANG['error_ssh_credentials_missing'];?>').show();
169
+        $("#dialog_auto_update_server_pwd_info").html('<i class="fa fa-warning"></i>&nbsp;<?php echo $LANG['error_ssh_credentials_missing']; ?>').show();
170 170
         return false;
171 171
     }
172 172
     // show progress
173
-    $("#dialog_auto_update_server_pwd_status").html('<i class="fa fa-cog fa-spin"></i>&nbsp;<?php echo $LANG['please_wait'];?>&nbsp;...&nbsp;').attr("class","").show();
173
+    $("#dialog_auto_update_server_pwd_status").html('<i class="fa fa-cog fa-spin"></i>&nbsp;<?php echo $LANG['please_wait']; ?>&nbsp;...&nbsp;').attr("class","").show();
174 174
     $("#dialog_auto_update_server_pwd_info").html("").hide();
175 175
     //prepare data
176 176
         var data = '{"currentId":"'+$('#selected_items').val() + '", '+
177 177
         '"new_pwd":"'+$('#ausp_pwd').val()+'", '+
178 178
         '"ssh_root":"'+$('#ausp_ssh_root').val()+'", '+
179 179
         '"ssh_pwd":"'+$('#ausp_ssh_pwd').val()+'", '+
180
-        '"user_id":"<?php echo $_SESSION['user_id'];?>"}';
180
+        '"user_id":"<?php echo $_SESSION['user_id']; ?>"}';
181 181
 
182 182
     $.post(
183 183
         "sources/utils.queries.php",
184 184
         {
185 185
             type        : "server_auto_update_password",
186
-            data        : prepareExchangedData(data, "encode", "<?php echo $_SESSION['key'];?>"),
187
-            key         : "<?php echo $_SESSION['key'];?>"
186
+            data        : prepareExchangedData(data, "encode", "<?php echo $_SESSION['key']; ?>"),
187
+            key         : "<?php echo $_SESSION['key']; ?>"
188 188
         },
189 189
         function(data) {
190
-            data = prepareExchangedData(data , "decode", "<?php echo $_SESSION['key'];?>");
190
+            data = prepareExchangedData(data , "decode", "<?php echo $_SESSION['key']; ?>");
191 191
             //check if format error
192 192
             if (data.error != "") {
193 193
                 $("#dialog_auto_update_server_pwd_info").html("Error: "+data.error).show();
194
-                $("#dialog_auto_update_server_pwd_status").html("<?php echo $LANG['auto_update_server_password_info'];?>");
194
+                $("#dialog_auto_update_server_pwd_status").html("<?php echo $LANG['auto_update_server_password_info']; ?>");
195 195
             } else {
196 196
                 // tbc
197 197
                 $("#dialog_auto_update_server_pwd_status").html("done "+data.text);
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
             numerals   : true
226 226
         },
227 227
         function(data) {
228
-            data = prepareExchangedData(data, "decode", "<?php echo $_SESSION['key'];?>");
228
+            data = prepareExchangedData(data, "decode", "<?php echo $_SESSION['key']; ?>");
229 229
             if (data.error == "true") {
230 230
                 $("#dialog_auto_update_server_pwd_info").html(data.error_msg).show();
231 231
             } else {
Please login to merge, or discard this patch.
install/upgrade_run_encryption_suggestions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
 $dbgDuo = fopen("upgrade.log", "w");
45 45
 $finish = false;
46
-$next = ($_POST['nb']+$_POST['start']);
46
+$next = ($_POST['nb'] + $_POST['start']);
47 47
 
48 48
 $dbTmp = mysqli_connect(
49 49
     $_SESSION['server'],
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         decrypt($record['pw']),
69 69
         strlen($record['pw_iv'])
70 70
     );
71
-    if (isUTF8($tmpData ) && !empty($tmpData)) {
71
+    if (isUTF8($tmpData) && !empty($tmpData)) {
72 72
         $encrypt = cryption_phpCrypt(
73 73
             $tmpData,
74 74
             SALT,
Please login to merge, or discard this patch.
install/upgrade_db_1.08.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -18,42 +18,42 @@  discard block
 block discarded – undo
18 18
 global $k;
19 19
 //ENGLISH
20 20
 $english_vals = array(
21
-    array('at_modification',"Modification"),
22
-    array('at_creation',"Creation"),
23
-    array('at_delete',"Deletion"),
24
-    array('at_pw',"Password changed."),
25
-    array('at_category',"Group"),
26
-    array('at_personnel',"Personnal"),
27
-    array('at_description',"Description"),
28
-    array('at_url',"Url"),
29
-    array('at_login',"Login"),
30
-    array('at_label',"Label")
21
+    array('at_modification', "Modification"),
22
+    array('at_creation', "Creation"),
23
+    array('at_delete', "Deletion"),
24
+    array('at_pw', "Password changed."),
25
+    array('at_category', "Group"),
26
+    array('at_personnel', "Personnal"),
27
+    array('at_description', "Description"),
28
+    array('at_url', "Url"),
29
+    array('at_login', "Login"),
30
+    array('at_label', "Label")
31 31
 );
32 32
 //FRENCH
33 33
 $french_vals = array(
34
-    array('at_modification',"Modification"),
35
-    array('at_creation',"Création"),
36
-    array('at_delete',"Suppression"),
37
-    array('at_pw',"Mot de passe changé."),
38
-    array('at_category',"Group"),
39
-    array('at_personnel',"Personnel"),
40
-    array('at_description',"Description."),
41
-    array('at_url',"Url"),
42
-    array('at_login',"Login"),
43
-    array('at_label',"Label")
34
+    array('at_modification', "Modification"),
35
+    array('at_creation', "Création"),
36
+    array('at_delete', "Suppression"),
37
+    array('at_pw', "Mot de passe changé."),
38
+    array('at_category', "Group"),
39
+    array('at_personnel', "Personnel"),
40
+    array('at_description', "Description."),
41
+    array('at_url', "Url"),
42
+    array('at_login', "Login"),
43
+    array('at_label', "Label")
44 44
 );
45 45
 //SPANISH
46 46
 $spanish_vals = array(
47
-    array('at_modification',"Modificacion"),
48
-    array('at_creation',"Creacion"),
49
-    array('at_delete',"Borrado"),
50
-    array('at_pw',"Contraseéa cambiada."),
51
-    array('at_category',"Grupo"),
52
-    array('at_personnel',"Personal"),
53
-    array('at_description',"Descripcion."),
54
-    array('at_url',"Url"),
55
-    array('at_login',"Login"),
56
-    array('at_label',"Etiqueta")
47
+    array('at_modification', "Modificacion"),
48
+    array('at_creation', "Creacion"),
49
+    array('at_delete', "Borrado"),
50
+    array('at_pw', "Contraseéa cambiada."),
51
+    array('at_category', "Grupo"),
52
+    array('at_personnel', "Personal"),
53
+    array('at_description', "Descripcion."),
54
+    array('at_url', "Url"),
55
+    array('at_login', "Login"),
56
+    array('at_label', "Etiqueta")
57 57
 );
58 58
 
59 59
 changeDB();
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
                 mysqli_query($dbTmp, "UPDATE ".$_SESSION['pre']."log_items SET raison = '".$lang[0]."' WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$data['action']."'");
80 80
                 $found = true;
81 81
             } else
82
-            if ($lang[1] == trim(substr($data['raison'],0,strpos($data['raison'],":"))) && !empty($data['raison'])) {
83
-                $data1= mysqli_fetch_row(mysqli_query($dbTmp, "SELECT action FROM ".$_SESSION['pre']."log_items WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$action."'"));
84
-                mysqli_query($dbTmp, "UPDATE ".$_SESSION['pre']."log_items SET raison = '".$lang[0]." ".substr($data['raison'],strpos($data['raison'],":"))."' WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$data1[0]."'");
82
+            if ($lang[1] == trim(substr($data['raison'], 0, strpos($data['raison'], ":"))) && !empty($data['raison'])) {
83
+                $data1 = mysqli_fetch_row(mysqli_query($dbTmp, "SELECT action FROM ".$_SESSION['pre']."log_items WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$action."'"));
84
+                mysqli_query($dbTmp, "UPDATE ".$_SESSION['pre']."log_items SET raison = '".$lang[0]." ".substr($data['raison'], strpos($data['raison'], ":"))."' WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$data1[0]."'");
85 85
                 $found = true;
86 86
             }
87 87
         }
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
                 mysqli_query($dbTmp, "UPDATE ".$_SESSION['pre']."log_items SET raison = '".$lang[0]."' WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$data['action']."'");
99 99
                 $found = true;
100 100
             } else
101
-            if ($lang[1] == trim(substr($data['raison'],0,strpos($data['raison'],":"))) && !empty($data['raison'])) {
102
-                $data1= mysqli_fetch_row(mysqli_query($dbTmp, "SELECT action FROM ".$_SESSION['pre']."log_items WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$action."'"));
103
-                mysqli_query($dbTmp, "UPDATE ".$_SESSION['pre']."log_items SET raison = '".$lang[0]." ".substr($data['raison'],strpos($data['raison'],":"))."' WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$data1[0]."'");
101
+            if ($lang[1] == trim(substr($data['raison'], 0, strpos($data['raison'], ":"))) && !empty($data['raison'])) {
102
+                $data1 = mysqli_fetch_row(mysqli_query($dbTmp, "SELECT action FROM ".$_SESSION['pre']."log_items WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$action."'"));
103
+                mysqli_query($dbTmp, "UPDATE ".$_SESSION['pre']."log_items SET raison = '".$lang[0]." ".substr($data['raison'], strpos($data['raison'], ":"))."' WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$data1[0]."'");
104 104
                 $found = true;
105 105
             }
106 106
         }
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
                 mysqli_query($dbTmp, "UPDATE ".$_SESSION['pre']."log_items SET raison = '".$lang[0]."' WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$data['action']."'");
118 118
                 $found = true;
119 119
             } else
120
-            if ($lang[1] == trim(substr($data['raison'],0,strpos($data['raison'],":"))) && !empty($data['raison'])) {
121
-                $data1= mysqli_fetch_row(mysqli_query($dbTmp, "SELECT action FROM ".$_SESSION['pre']."log_items WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$action."'"));
122
-                mysqli_query($dbTmp, "UPDATE ".$_SESSION['pre']."log_items SET raison = '".$lang[0]." ".substr($data['raison'],strpos($data['raison'],":"))."' WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$data1[0]."'");
120
+            if ($lang[1] == trim(substr($data['raison'], 0, strpos($data['raison'], ":"))) && !empty($data['raison'])) {
121
+                $data1 = mysqli_fetch_row(mysqli_query($dbTmp, "SELECT action FROM ".$_SESSION['pre']."log_items WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$action."'"));
122
+                mysqli_query($dbTmp, "UPDATE ".$_SESSION['pre']."log_items SET raison = '".$lang[0]." ".substr($data['raison'], strpos($data['raison'], ":"))."' WHERE id_item=".$data['id_item']." AND date =".$data['date']." AND id_user =".$data['id_user']." AND raison ='".$data['raison']."' AND action ='".$data1[0]."'");
123 123
                 $found = true;
124 124
             }
125 125
         }
Please login to merge, or discard this patch.
install/upgrade_run_final.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,8 +101,12 @@
 block discarded – undo
101 101
         }
102 102
 
103 103
         // temp data
104
-        if (!isset($record['login'])) $record['login'] = "";
105
-        if (!isset($resNT['renewal_period'])) $resNT['renewal_period'] = "0";
104
+        if (!isset($record['login'])) {
105
+            $record['login'] = "";
106
+        }
107
+        if (!isset($resNT['renewal_period'])) {
108
+            $resNT['renewal_period'] = "0";
109
+        }
106 110
 
107 111
         // store data
108 112
         $res = mysqli_query($dbTmp,
Please login to merge, or discard this patch.
install/install.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@
 block discarded – undo
18 18
     <body>
19 19
 <?php
20 20
 // define root path
21
-$abs_path = rtrim($_SERVER['DOCUMENT_ROOT'], '/') . substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 20);
22
-if( isset($_SERVER['HTTPS'] ) ) {
21
+$abs_path = rtrim($_SERVER['DOCUMENT_ROOT'], '/').substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 20);
22
+if (isset($_SERVER['HTTPS'])) {
23 23
     $protocol = 'https://';
24 24
 } else {
25 25
     $protocol = 'http://';
Please login to merge, or discard this patch.
install/upgrade_run_encryption_pwd.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
 $dbgDuo = fopen("upgrade.log", "a");
45 45
 $finish = false;
46
-$next = ($_POST['nb']+$_POST['start']);
46
+$next = ($_POST['nb'] + $_POST['start']);
47 47
 
48 48
 
49 49
 $dbTmp = mysqli_connect(
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             $pw = decrypt($data['pw']);
94 94
             if (empty($pw)) {
95 95
                 // used protocol is #1
96
-                $pw = decryptOld($data['pw']);  // decrypt using protocol #1
96
+                $pw = decryptOld($data['pw']); // decrypt using protocol #1
97 97
             }
98 98
 
99 99
             // get key for this pw
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     }
132 132
 
133 133
     // does tables KEYS exists
134
-    if(mysqli_num_rows(mysqli_query("SHOW TABLES LIKE '".$_SESSION['pre']."keys'")) == 1) {
134
+    if (mysqli_num_rows(mysqli_query("SHOW TABLES LIKE '".$_SESSION['pre']."keys'")) == 1) {
135 135
         $table_keys_exists = 1;
136 136
     } else {
137 137
         $table_keys_exists = 0;
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                     fputs($dbgDuo, "\n/ step1 : ".$pw);
163 163
                     if (empty($pw)) {
164 164
                         // used protocol is #1
165
-                        $pw = decryptOld(trim($reason[1]));  // decrypt using protocol #1
165
+                        $pw = decryptOld(trim($reason[1])); // decrypt using protocol #1
166 166
                         fputs($dbgDuo, " / step2 : ".$pw);
167 167
                     }
168 168
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
                     // store new encryption
187 187
                     if (isUTF8($pw) && !empty($pw)) {
188
-                        $encrypt = cryption_phpCrypt($pw , SALT, "", "encrypt");
188
+                        $encrypt = cryption_phpCrypt($pw, SALT, "", "encrypt");
189 189
                         fputs($dbgDuo, " / Final : ".$encrypt['string']);
190 190
                         mysqli_query($dbTmp,
191 191
                             "UPDATE ".$_SESSION['pre']."log_items
@@ -217,8 +217,8 @@  discard block
 block discarded – undo
217 217
 
218 218
         while ($record = mysqli_fetch_array($resData)) {
219 219
             $tmpData = substr(decrypt($record['data']), strlen($record['rndKey']));
220
-            if (isUTF8($tmpData ) && !empty($tmpData )) {
221
-                $encrypt = cryption_phpCrypt($tmpData , SALT, "", "encrypt");
220
+            if (isUTF8($tmpData) && !empty($tmpData)) {
221
+                $encrypt = cryption_phpCrypt($tmpData, SALT, "", "encrypt");
222 222
 
223 223
                 // store Password
224 224
                 $resData_tmp2 = mysqli_query($dbTmp,
Please login to merge, or discard this patch.
install/upgrade_run_defuse_for_files.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     $_SESSION['port']
41 41
 );
42 42
 // are files encrypted? get the setting ongoing in teampass
43
-$set = mysqli_fetch_row(mysqli_query($dbTmp,"SELECT valeur FROM ".$_SESSION['pre']."misc WHERE type='admin' AND intitule='enable_attachment_encryption'"));
43
+$set = mysqli_fetch_row(mysqli_query($dbTmp, "SELECT valeur FROM ".$_SESSION['pre']."misc WHERE type='admin' AND intitule='enable_attachment_encryption'"));
44 44
 $enable_attachment_encryption = $set[0];
45 45
 
46 46
 // if no encryption then stop
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 // get path to upload
54
-$set = mysqli_fetch_row(mysqli_query($dbTmp,"SELECT valeur FROM ".$_SESSION['pre']."misc WHERE type='admin' AND intitule='path_to_upload_folder'"));
54
+$set = mysqli_fetch_row(mysqli_query($dbTmp, "SELECT valeur FROM ".$_SESSION['pre']."misc WHERE type='admin' AND intitule='path_to_upload_folder'"));
55 55
 $path_to_upload_folder = $set[0];
56 56
 
57 57
 // get previous saltkey
58
-$set = mysqli_fetch_row(mysqli_query($dbTmp,"SELECT valeur FROM ".$_SESSION['pre']."misc WHERE type='admin' AND intitule='saltkey_ante_2127'"));
58
+$set = mysqli_fetch_row(mysqli_query($dbTmp, "SELECT valeur FROM ".$_SESSION['pre']."misc WHERE type='admin' AND intitule='saltkey_ante_2127'"));
59 59
 $saltkey_ante_2127 = $set[0];
60 60
 
61 61
 
Please login to merge, or discard this patch.