Completed
Push — development ( 351bb8...cf7e58 )
by Nils
08:11
created
sources/identify.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -331,7 +331,7 @@
 block discarded – undo
331 331
 		}
332 332
 		$passwordClear = $_SERVER['PHP_AUTH_PW'];
333 333
 		$pwdOldEncryption = encryptOld($_SERVER['PHP_AUTH_PW']);
334
-	}else{
334
+	} else{
335 335
 		$passwordClear = htmlspecialchars_decode($dataReceived['pw']);
336 336
 		$pwdOldEncryption = encryptOld(htmlspecialchars_decode($dataReceived['pw']));
337 337
 		$username = $antiXss->xss_clean(htmlspecialchars_decode($dataReceived['login']));
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -321,26 +321,26 @@
 block discarded – undo
321 321
     $dataReceived = prepareExchangedData($sentData, "decode");
322 322
 
323 323
     // prepare variables
324
-	if (isset($SETTINGS['enable_http_request_login']) === true
324
+    if (isset($SETTINGS['enable_http_request_login']) === true
325 325
         && $SETTINGS['enable_http_request_login'] === '1'
326 326
         && isset($_SERVER['PHP_AUTH_USER']) === true
327 327
         && !(isset($SETTINGS['maintenance_mode']) === true
328 328
         && $SETTINGS['maintenance_mode'] === '1')
329 329
     ) {
330 330
         if (strpos($_SERVER['PHP_AUTH_USER'], '@') !== false) {
331
-			$username = explode("@", $_SERVER['PHP_AUTH_USER'])[0];
332
-		} elseif (strpos($_SERVER['PHP_AUTH_USER'], '\\') !== false) {
333
-			$username = explode("\\", $_SERVER['PHP_AUTH_USER'])[1];
334
-		} else {
335
-			$username = $_SERVER['PHP_AUTH_USER'];
336
-		}
337
-		$passwordClear = $_SERVER['PHP_AUTH_PW'];
338
-		$pwdOldEncryption = encryptOld($_SERVER['PHP_AUTH_PW']);
339
-	}else{
340
-		$passwordClear = htmlspecialchars_decode($dataReceived['pw']);
341
-		$pwdOldEncryption = encryptOld(htmlspecialchars_decode($dataReceived['pw']));
342
-		$username = $antiXss->xss_clean(htmlspecialchars_decode($dataReceived['login']));
343
-	}
331
+            $username = explode("@", $_SERVER['PHP_AUTH_USER'])[0];
332
+        } elseif (strpos($_SERVER['PHP_AUTH_USER'], '\\') !== false) {
333
+            $username = explode("\\", $_SERVER['PHP_AUTH_USER'])[1];
334
+        } else {
335
+            $username = $_SERVER['PHP_AUTH_USER'];
336
+        }
337
+        $passwordClear = $_SERVER['PHP_AUTH_PW'];
338
+        $pwdOldEncryption = encryptOld($_SERVER['PHP_AUTH_PW']);
339
+    }else{
340
+        $passwordClear = htmlspecialchars_decode($dataReceived['pw']);
341
+        $pwdOldEncryption = encryptOld(htmlspecialchars_decode($dataReceived['pw']));
342
+        $username = $antiXss->xss_clean(htmlspecialchars_decode($dataReceived['login']));
343
+    }
344 344
     $logError = "";
345 345
     $userPasswordVerified = false;
346 346
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -336,7 +336,7 @@
 block discarded – undo
336 336
 		}
337 337
 		$passwordClear = $_SERVER['PHP_AUTH_PW'];
338 338
 		$pwdOldEncryption = encryptOld($_SERVER['PHP_AUTH_PW']);
339
-	}else{
339
+	} else {
340 340
 		$passwordClear = htmlspecialchars_decode($dataReceived['pw']);
341 341
 		$pwdOldEncryption = encryptOld(htmlspecialchars_decode($dataReceived['pw']));
342 342
 		$username = $antiXss->xss_clean(htmlspecialchars_decode($dataReceived['login']));
Please login to merge, or discard this patch.
index.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -700,20 +700,20 @@
 block discarded – undo
700 700
             && $SETTINGS['maintenance_mode'] === '1')
701 701
         ) {
702 702
             if (strpos($_SERVER['PHP_AUTH_USER'], '@') !== false) {
703
-				$username = explode("@", $_SERVER['PHP_AUTH_USER'])[0];
704
-			} elseif (strpos($_SERVER['PHP_AUTH_USER'], '\\') !== false) {
705
-				$username = explode("\\", $_SERVER['PHP_AUTH_USER'])[1];
706
-			} else {
707
-				$username = $_SERVER['PHP_AUTH_USER'];
708
-			}
709
-			echo '
703
+                $username = explode("@", $_SERVER['PHP_AUTH_USER'])[0];
704
+            } elseif (strpos($_SERVER['PHP_AUTH_USER'], '\\') !== false) {
705
+                $username = explode("\\", $_SERVER['PHP_AUTH_USER'])[1];
706
+            } else {
707
+                $username = $_SERVER['PHP_AUTH_USER'];
708
+            }
709
+            echo '
710 710
         				<div style="margin-bottom:3px;">
711 711
         			        <label for="login" class="form_label">', isset($SETTINGS['custom_login_text']) && !empty($SETTINGS['custom_login_text']) ? (string) $SETTINGS['custom_login_text'] : $LANG['index_login'], '</label>
712 712
         		            <input type="text" size="10" id="login" name="login" class="input_text text ui-widget-content ui-corner-all" value="' , $username , '" readonly />
713 713
         		            <span id="login_check_wait" style="display:none; float:right;"><i class="fa fa-cog fa-spin fa-1x"></i></span>
714 714
                         </div>';
715
-		} else {
716
-        	echo '
715
+        } else {
716
+            echo '
717 717
                     	    <div style="margin-bottom:3px;">
718 718
                     	        <label for="login" class="form_label">', isset($SETTINGS['custom_login_text']) && !empty($SETTINGS['custom_login_text']) ? (string) $SETTINGS['custom_login_text'] : $LANG['index_login'], '</label>
719 719
                                 <input type="text" size="10" id="login" name="login" class="input_text text ui-widget-content ui-corner-all" value="', empty($post_login) === false ? $post_login : '', '" />
Please login to merge, or discard this patch.
Spacing   +30 added lines, -33 removed lines patch added patch discarded remove patch
@@ -91,34 +91,34 @@  discard block
 block discarded – undo
91 91
 require_once $SETTINGS['cpassman_dir'].'/sources/core.php';
92 92
 
93 93
 // Prepare POST variables
94
-$post_language =        filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
95
-$post_sig_response =    filter_input(INPUT_POST, 'sig_response', FILTER_SANITIZE_STRING);
96
-$post_duo_login =       filter_input(INPUT_POST, 'duo_login', FILTER_SANITIZE_STRING);
97
-$post_duo_data =        filter_input(INPUT_POST, 'duo_data', FILTER_SANITIZE_STRING);
98
-$post_login =           filter_input(INPUT_POST, 'login', FILTER_SANITIZE_STRING);
99
-$post_pw =              filter_input(INPUT_POST, 'pw', FILTER_SANITIZE_STRING);
94
+$post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
95
+$post_sig_response = filter_input(INPUT_POST, 'sig_response', FILTER_SANITIZE_STRING);
96
+$post_duo_login = filter_input(INPUT_POST, 'duo_login', FILTER_SANITIZE_STRING);
97
+$post_duo_data = filter_input(INPUT_POST, 'duo_data', FILTER_SANITIZE_STRING);
98
+$post_login = filter_input(INPUT_POST, 'login', FILTER_SANITIZE_STRING);
99
+$post_pw = filter_input(INPUT_POST, 'pw', FILTER_SANITIZE_STRING);
100 100
 
101 101
 // Prepare superGlobal variables
102
-$session_user_language =        $superGlobal->get("user_language", "SESSION");
103
-$session_user_id =              $superGlobal->get("user_id", "SESSION");
104
-$session_user_flag =            $superGlobal->get("user_language_flag", "SESSION");
105
-$session_user_admin =           $superGlobal->get("user_admin", "SESSION");
102
+$session_user_language = $superGlobal->get("user_language", "SESSION");
103
+$session_user_id = $superGlobal->get("user_id", "SESSION");
104
+$session_user_flag = $superGlobal->get("user_language_flag", "SESSION");
105
+$session_user_admin = $superGlobal->get("user_admin", "SESSION");
106 106
 $session_user_human_resources = $superGlobal->get("user_can_manage_all_users", "SESSION");
107
-$session_user_avatar_thumb =    $superGlobal->get("user_avatar_thumb", "SESSION");
108
-$session_name =                 $superGlobal->get("name", "SESSION");
109
-$session_lastname =             $superGlobal->get("lastname", "SESSION");
110
-$session_user_manager =         $superGlobal->get("user_manager", "SESSION");
111
-$session_user_read_only =       $superGlobal->get("user_read_only", "SESSION");
112
-$session_is_admin =             $superGlobal->get("is_admin", "SESSION");
113
-$session_login =                $superGlobal->get("login", "SESSION");
114
-$session_validite_pw =          $superGlobal->get("validite_pw", "SESSION");
115
-$session_nb_folders =           $superGlobal->get("nb_folders", "SESSION");
116
-$session_nb_roles =             $superGlobal->get("nb_roles", "SESSION");
117
-$session_autoriser =            $superGlobal->get("autoriser", "SESSION");
118
-$session_hide_maintenance =     $superGlobal->get("hide_maintenance", "SESSION");
119
-$session_initial_url =          $superGlobal->get("initial_url", "SESSION");
120
-$server_request_uri =           $superGlobal->get("REQUEST_URI", "SERVER");
121
-$session_nb_users_online =      $superGlobal->get("nb_users_online", "SESSION");
107
+$session_user_avatar_thumb = $superGlobal->get("user_avatar_thumb", "SESSION");
108
+$session_name = $superGlobal->get("name", "SESSION");
109
+$session_lastname = $superGlobal->get("lastname", "SESSION");
110
+$session_user_manager = $superGlobal->get("user_manager", "SESSION");
111
+$session_user_read_only = $superGlobal->get("user_read_only", "SESSION");
112
+$session_is_admin = $superGlobal->get("is_admin", "SESSION");
113
+$session_login = $superGlobal->get("login", "SESSION");
114
+$session_validite_pw = $superGlobal->get("validite_pw", "SESSION");
115
+$session_nb_folders = $superGlobal->get("nb_folders", "SESSION");
116
+$session_nb_roles = $superGlobal->get("nb_roles", "SESSION");
117
+$session_autoriser = $superGlobal->get("autoriser", "SESSION");
118
+$session_hide_maintenance = $superGlobal->get("hide_maintenance", "SESSION");
119
+$session_initial_url = $superGlobal->get("initial_url", "SESSION");
120
+$server_request_uri = $superGlobal->get("REQUEST_URI", "SERVER");
121
+$session_nb_users_online = $superGlobal->get("nb_users_online", "SESSION");
122 122
 
123 123
 
124 124
 /* DEFINE WHAT LANGUAGE TO USE */
@@ -239,10 +239,7 @@  discard block
 block discarded – undo
239 239
         <div style="float:right; margin:-10px 5px 0 0; color:#FFF;">'
240 240
             .$LANG['index_welcome'].'&nbsp;<b>'.$session_name.'&nbsp;'.$session_lastname
241 241
             .'&nbsp;['.$session_login.']</b>&nbsp;-&nbsp;'
242
-            , $session_user_admin === '1' ? $LANG['god'] :
243
-                ($session_user_manager === '1' ? $LANG['gestionnaire'] :
244
-                    ($session_user_read_only === '1' ? $LANG['read_only_account'] :
245
-                        ($session_user_human_resources === '1' ? $LANG['human_resources'] :$LANG['user'])
242
+            , $session_user_admin === '1' ? $LANG['god'] : ($session_user_manager === '1' ? $LANG['gestionnaire'] : ($session_user_read_only === '1' ? $LANG['read_only_account'] : ($session_user_human_resources === '1' ? $LANG['human_resources'] : $LANG['user'])
246 243
                     )
247 244
                 ), '&nbsp;'.strtolower($LANG['index_login']).'</div>';
248 245
 
@@ -709,7 +706,7 @@  discard block
 block discarded – undo
709 706
 			echo '
710 707
         				<div style="margin-bottom:3px;">
711 708
         			        <label for="login" class="form_label">', isset($SETTINGS['custom_login_text']) && !empty($SETTINGS['custom_login_text']) ? (string) $SETTINGS['custom_login_text'] : $LANG['index_login'], '</label>
712
-        		            <input type="text" size="10" id="login" name="login" class="input_text text ui-widget-content ui-corner-all" value="' , $username , '" readonly />
709
+        		            <input type="text" size="10" id="login" name="login" class="input_text text ui-widget-content ui-corner-all" value="' , $username, '" readonly />
713 710
         		            <span id="login_check_wait" style="display:none; float:right;"><i class="fa fa-cog fa-spin fa-1x"></i></span>
714 711
                         </div>';
715 712
 		} else {
@@ -733,7 +730,7 @@  discard block
 block discarded – undo
733 730
                         </div>';
734 731
         }
735 732
 
736
-        if (!(isset($SETTINGS['enable_http_request_login']) === true && $SETTINGS['enable_http_request_login'] === '1' && isset($_SERVER['PHP_AUTH_USER']) === true   && !(isset($SETTINGS['maintenance_mode']) === true && $SETTINGS['maintenance_mode'] === '1')) ) {
733
+        if (!(isset($SETTINGS['enable_http_request_login']) === true && $SETTINGS['enable_http_request_login'] === '1' && isset($_SERVER['PHP_AUTH_USER']) === true && !(isset($SETTINGS['maintenance_mode']) === true && $SETTINGS['maintenance_mode'] === '1'))) {
737 734
             echo '
738 735
                         <div id="connect_pw" style="margin-bottom:3px;">
739 736
                             <label for="pw" class="form_label" id="user_pwd">'.$LANG['index_password'].'</label>
@@ -788,7 +785,7 @@  discard block
 block discarded – undo
788 785
         	<script>
789 786
         		var seconds = 3;
790 787
         		function updateLogonButton(timeToGo){
791
-				    document.getElementById("but_identify_user").value = "' . $LANG['duration_login_attempt'] . ' " + timeToGo;
788
+				    document.getElementById("but_identify_user").value = "' . $LANG['duration_login_attempt'].' " + timeToGo;
792 789
 				}
793 790
 				$( window ).on( "load", function() {
794 791
 				    updateLogonButton(seconds);
@@ -842,7 +839,7 @@  discard block
 block discarded – undo
842 839
             <a href="https://www.reddit.com/r/TeamPass/" target="_blank" style="color:#F0F0F0;" class="tip" title="'.addslashes($LANG['admin_help']).'"><i class="fa fa-reddit-alien"></i></a>
843 840
             &nbsp;
844 841
             ', ($session_user_id !== null && empty($session_user_id) === false) ? '
845
-            <a href="#" style="color:#F0F0F0;" class="tip" title="'.addslashes($LANG['bugs_page']).'" onclick="generateBugReport()"><i class="fa fa-bug"></i></a>' : '' ,'
842
+            <a href="#" style="color:#F0F0F0;" class="tip" title="'.addslashes($LANG['bugs_page']).'" onclick="generateBugReport()"><i class="fa fa-bug"></i></a>' : '', '
846 843
         </div>
847 844
         <div style="float:left;width:32%;text-align:center;">
848 845
             ', ($session_user_id !== null && empty($session_user_id) === false) ? '<i class="fa fa-users"></i>&nbsp;'.$session_nb_users_online.'&nbsp;'.$LANG['users_online'].'&nbsp;|&nbsp;<i class="fa fa-hourglass-end"></i>&nbsp;'.$LANG['index_expiration_in'].'&nbsp;<div style="display:inline;" id="countdown"></div>' : '', '
Please login to merge, or discard this patch.
includes/language/english.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 14
  */
15 15
 global $LANG;
16
-$LANG = array (
16
+$LANG = array(
17 17
     'enable_http_request_login' => 'Automatic login using http header credentials',
18 18
     'duration_login_attempt' => 'Seconds till auto login:',
19 19
     'newly_created_user_role' => 'Newly created user has role',
Please login to merge, or discard this patch.