diff --git a/conf/config.inc.php b/conf/config.inc.php index 8fc191d8..9367fdf9 100644 --- a/conf/config.inc.php +++ b/conf/config.inc.php @@ -120,6 +120,9 @@ # above - the form # below - the form $pwd_show_policy_pos = "above"; +# Use statically formulated policy +# instead of dynamically generated one +#$pwd_static_policy = "conf/policy.inc.html"; # disallow use of the only special character as defined in `$pwd_special_chars` at the beginning and end $pwd_no_special_at_ends = false; @@ -222,6 +225,8 @@ $sms_attribute = "mobile"; # Partially hide number $sms_partially_hide_number = true; +# Display full name +$sms_display_full_name = true; # Send SMS mail to address $smsmailto = "{sms_attribute}@service.provider.com"; # Subject when sending email to SMTP to SMS provider diff --git a/index.php b/index.php index 10a4a40d..c7f26d8c 100644 --- a/index.php +++ b/index.php @@ -140,6 +140,7 @@ "pwd_no_reuse" => $pwd_no_reuse, "pwd_diff_login" => $pwd_diff_login, "pwd_complexity" => $pwd_complexity, + "pwd_static_policy" => $pwd_static_policy, "use_pwnedpasswords" => $use_pwnedpasswords, "pwd_no_special_at_ends" => $pwd_no_special_at_ends ); diff --git a/lib/functions.inc.php b/lib/functions.inc.php index a3eb0bbf..99a0bd0a 100644 --- a/lib/functions.inc.php +++ b/lib/functions.inc.php @@ -177,22 +177,32 @@ function show_policy( $messages, $pwd_policy_config, $result ) { if ( !preg_match( "/tooshort|toobig|minlower|minupper|mindigit|minspecial|forbiddenchars|sameasold|notcomplex|sameaslogin|pwned|specialatends/" , $result) ) { return; } } + if ( isset( $pwd_static_policy ) ) { + $fp = fopen ($pwd_static_policy, 'rb'); + } else { + $fp = FALSE; + } + # Display bloc echo "
\n"; echo "

".$messages["policy"]."

\n"; echo "\n"; echo "
\n"; } diff --git a/pages/sendsms.php b/pages/sendsms.php index 90597625..5a28dd0c 100644 --- a/pages/sendsms.php +++ b/pages/sendsms.php @@ -329,12 +329,14 @@
-
- -
-

+ +
+ +
+

+
-
+
diff --git a/pages/sendtoken.php b/pages/sendtoken.php index bb3d872a..13e8aa07 100644 --- a/pages/sendtoken.php +++ b/pages/sendtoken.php @@ -177,6 +177,10 @@ $server_port = $_SERVER['SERVER_PORT']; $script_name = $_SERVER['SCRIPT_NAME']; + # Handle being behind revproxy + if ( $_SERVER['HTTP_X_FORWARDED_PROTO'] == "https" ) { $method .= "s"; } + if ( isset($_SERVER['HTTP_X_FORWARDED_PORT']) ) { $server_port = $_SERVER['HTTP_X_FORWARDED_PORT']; } + # Force server port if non standard port if ( ( $method === "http" and $server_port != "80" ) or ( $method === "https" and $server_port != "443" )