diff --git a/functions.php b/functions.php index 7d23a4093..f95c7ebc4 100644 --- a/functions.php +++ b/functions.php @@ -1508,11 +1508,11 @@ print ""; foreach ($values as $v) { if ($v == $default) - $sel = " selected"; + $sel = "selected=\"1\""; else $sel = ""; - print "$v"; + print "$v"; } print ""; } diff --git a/modules/pref-prefs.php b/modules/pref-prefs.php index e0d4c232f..98211aa0d 100644 --- a/modules/pref-prefs.php +++ b/modules/pref-prefs.php @@ -30,9 +30,9 @@ if ($subop == "change-password") { - $old_pw = $_POST["OLD_PASSWORD"]; - $new_pw = $_POST["NEW_PASSWORD"]; - $con_pw = $_POST["CONFIRM_PASSWORD"]; + $old_pw = $_POST["old_password"]; + $new_pw = $_POST["new_password"]; + $con_pw = $_POST["confirm_password"]; if ($old_pw == "") { print "ERROR: ".__("Old password cannot be blank."); @@ -49,12 +49,9 @@ return; } - $old_pw_hash1 = encrypt_password($_POST["OLD_PASSWORD"]); - $old_pw_hash2 = encrypt_password($_POST["OLD_PASSWORD"], - $_SESSION["name"]); - - $new_pw_hash = encrypt_password($_POST["NEW_PASSWORD"], - $_SESSION["name"]); + $old_pw_hash1 = encrypt_password($old_pw); + $old_pw_hash2 = encrypt_password($old_pw, $_SESSION["name"]); + $new_pw_hash = encrypt_password($new_pw, $_SESSION["name"]); $active_uid = $_SESSION["uid"]; @@ -160,15 +157,6 @@ if (!SINGLE_USER_MODE) { - $result = db_query($link, "SELECT id FROM ttrss_users - WHERE id = ".$_SESSION["uid"]." AND pwd_hash - = 'SHA1:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8'"); - - if (db_num_rows($result) != 0) { - print format_warning(__("Your password is at default value, - please change it."), "default_pass_warning"); - } - /* if ($_SESSION["pwd_change_result"] == "failed") { print format_warning("Could not change the password."); } @@ -192,8 +180,22 @@ print "
". + __("Save data").""; print "
". - __("Save data").""; - print "
". + print "". __("Change password").""; + print ""; print "
". __("Change password").""; + print ""; print "
". + print "". __('Save configuration')." "; - print "". + print "". __('Manage profiles')." "; - print "". + print "". __('Reset to defaults').""; print ""; diff --git a/prefs.js b/prefs.js index b613aec36..33e0ccf46 100644 --- a/prefs.js +++ b/prefs.js @@ -1284,88 +1284,6 @@ function showFeedsWithErrors() { displayDlg('feedUpdateErrors'); } -function changeUserPassword() { - - try { - - var f = document.forms["change_pass_form"]; - - if (f) { - if (f.OLD_PASSWORD.value == "") { - new Effect.Highlight(f.OLD_PASSWORD); - notify_error("Old password cannot be blank."); - return false; - } - - if (f.NEW_PASSWORD.value == "") { - new Effect.Highlight(f.NEW_PASSWORD); - notify_error("New password cannot be blank."); - return false; - } - - if (f.CONFIRM_PASSWORD.value == "") { - new Effect.Highlight(f.CONFIRM_PASSWORD); - notify_error("Entered passwords do not match."); - return false; - } - - if (f.CONFIRM_PASSWORD.value != f.NEW_PASSWORD.value) { - new Effect.Highlight(f.CONFIRM_PASSWORD); - new Effect.Highlight(f.NEW_PASSWORD); - notify_error("Entered passwords do not match."); - return false; - } - - } - - var query = Form.serialize("change_pass_form"); - - notify_progress("Changing password..."); - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - if (transport.responseText.indexOf("ERROR: ") == 0) { - notify_error(transport.responseText.replace("ERROR: ", "")); - } else { - notify_info(transport.responseText); - var warn = $("default_pass_warning"); - if (warn) warn.style.display = "none"; - } - - document.forms['change_pass_form'].reset(); - } }); - - - } catch (e) { - exception_error("changeUserPassword", e); - } - - return false; -} - -function changeUserEmail() { - - try { - - var query = Form.serialize("change_email_form"); - - notify_progress("Saving..."); - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - notify_callback2(transport); - } }); - - } catch (e) { - exception_error("changeUserPassword", e); - } - - return false; - -} - function opmlRegenKey() { try { @@ -1402,36 +1320,6 @@ function opmlRegenKey() { } return false; } -function validatePrefsSave() { - try { - - var ok = confirm(__("Save current configuration?")); - - if (ok) { - - var query = Form.serialize("pref_prefs_form"); - query = query + "&subop=save-config"; - console.log(query); - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - var msg = transport.responseText; - if (msg.match("PREFS_THEME_CHANGED")) { - window.location.reload(); - } else { - notify_info(msg); - } - } }); - - } - - } catch (e) { - exception_error("validatePrefsSave", e); - } - - return false; -} function feedActionChange() { try {
". __('Save configuration')." "; - print "". + print "". __('Manage profiles')." "; - print "". + print "". __('Reset to defaults')."