diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 98bd99a04..86c02beed 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -178,13 +178,16 @@ class Pref_Prefs extends Handler_Protected { $_SESSION["prefs_op_result"] = ""; - print "
"; - print "
"; + print "
person ".__('Personal data / Authentication')."\">"; - print "
"; + print "
"; + print "
"; - print ""; - print ""; - - print "

" . __("Personal data") . "

"; - $sth = $this->pdo->prepare("SELECT email,full_name,otp_enabled, access_level FROM ttrss_users WHERE id = ?"); @@ -212,30 +211,38 @@ class Pref_Prefs extends Handler_Protected { $full_name = htmlspecialchars($row["full_name"]); $otp_enabled = sql_bool_to_bool($row["otp_enabled"]); - print ""; - print ""; + print "
"; + print ""; + print ""; + print "
"; - print ""; - print ""; + print "
"; + print ""; + print ""; + print "
"; if (!SINGLE_USER_MODE && !$_SESSION["hide_hello"]) { $access_level = $row["access_level"]; - print ""; - print ""; + print "
"; + print ""; + print $access_level_names[$access_level]; + print "
"; } - print "
".__('Full name')."
".__('E-mail')."
".__('Access level')."" . $access_level_names[$access_level] . "
"; - print_hidden("op", "pref-prefs"); print_hidden("method", "changeemail"); - print "

"; print "

"; + print "
"; # content pane + print "
"; + if ($_SESSION["auth_module"]) { $authenticator = PluginHost::getInstance()->get_plugin($_SESSION["auth_module"]); } else { @@ -244,13 +251,11 @@ class Pref_Prefs extends Handler_Protected { if ($authenticator && method_exists($authenticator, "change_password")) { - print "

" . __("Password") . "

"; - print ""; - print "
"; + print ""; - print ""; - new Ajax.Request('backend.php', { - parameters: dojo.objectToQuery(this.getValues()), - onComplete: function(transport) { - Notify.close(); - if (transport.responseText.indexOf('ERROR: ') == 0) { - Notify.error(transport.responseText.replace('ERROR: ', '')); - } else { - window.location.reload(); - } - }}); - this.reset(); - } - "; + print "
"; + print ""; + print ""; + print "
"; - print ""; + print_hidden("op", "pref-prefs"); + print_hidden("method", "otpdisable"); - print ""; + print "
"; - print ""; + print ""; - print "
".__("Enter your password")."
"; - - print_hidden("op", "pref-prefs"); - print_hidden("method", "otpdisable"); - - print "

"; - - print "

"; + print ""; } else if (function_exists("imagecreatefromstring")) { - print "

" . __("You will need a compatible Authenticator to use this. Changing your password would automatically disable OTP.") . "

"; - - print "

".__("Scan the following code by the Authenticator application:")."

"; + print_warning("You will need a compatible Authenticator to use this. Changing your password would automatically disable OTP."); + print_notice("Scan the following code by the Authenticator application:"); $csrf_token = $_SESSION["csrf_token"]; - print ""; + print "otp qr-code"; - print "
"; + print ""; print_hidden("op", "pref-prefs"); print_hidden("method", "otpenable"); - print ""; - print ""; + print "
"; + print ""; + print ""; + print "
"; - print ""; + print "
"; + print ""; + print ""; + print "
"; - print ""; - - print ""; - - print ""; - - print ""; - print "
".__("Enter your password")."
".__("Enter the generated one time password")."
"; - - print "
"; - - print "
"; - - print "

"; print "

"; } else { - - print_notice(__("PHP GD functions are required for OTP support.")); - + print_notice("PHP GD functions are required for OTP support."); } - } + + print "
"; # content pane + print "
"; # tab container + } PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, @@ -426,12 +424,12 @@ class Pref_Prefs extends Handler_Protected { print "
"; #pane - print "
settings ".__('Preferences')."\">"; - print "
"; + print ""; - print "