X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin.php;h=a1801e49eccec45fec75b8d1f2907d33d6c87b0d;hb=f1cd2b7ae65e988f5be106f415136aaf92d60538;hp=8e0abb3736506004d06c1963b0c07ab132c073a9;hpb=f982257568441a433da4cd1bcc5101e8ecf628c0;p=mailer.git diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 8e0abb3736..a1801e49ec 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2016 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -58,18 +58,15 @@ if (!isAdminRegistered()) { if ((isPostRequestElementSet('send_link')) && (isPostRequestElementSet('email'))) { // Output result displayMessage(sendAdminPasswordResetLink(postRequestElement('email'))); - } elseif (isGetRequestElementSet('hash')) { - // Output form for hash validation - loadTemplate('admin_validate_reset_hash_form', FALSE, getRequestElement('hash')); - } elseif ((isPostRequestElementSet('validate_hash')) && (isPostRequestElementSet('admin_login')) && (isPostRequestElementSet('hash'))) { + } elseif ((isPostRequestElementSet('validate_hash')) && (isPostRequestElementSet('admin_login')) && (isGetRequestElementSet('hash'))) { // Validate the login data and hash - $valid = adminResetValidateHashLogin(postRequestElement('hash'), postRequestElement('admin_login')); + $valid = adminResetValidateHashLogin(getRequestElement('hash'), postRequestElement('admin_login')); // Valid? if ($valid === TRUE) { // Prepare content first $content = array( - 'hash' => postRequestElement('hash'), + 'hash' => getRequestElement('hash'), 'admin_login' => postRequestElement('admin_login') ); @@ -88,6 +85,9 @@ if (!isAdminRegistered()) { // Validation failed displayMessage('{--ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED2--}'); } + } elseif (isGetRequestElementSet('hash')) { + // Output form for hash validation + loadTemplate('admin_validate_reset_hash_form', FALSE, getRequestElement('hash')); } else { // Output reset password form loadTemplate('admin_reset_password_send_link'); @@ -136,7 +136,7 @@ if (!isAdminRegistered()) { break; default: // Others will be logged - logDebugMessage(__FILE__, __LINE__, sprintf("Unknown return code %s from ifAdminLoginDataIsValid()", $ret)); + logDebugMessage(__FILE__, __LINE__, sprintf('Unknown return code %s from ifAdminLoginDataIsValid()', $ret)); break; } // END - switch } // END - if @@ -169,10 +169,7 @@ if (!isAdminRegistered()) { // Check for password if (!isPostRequestElementSet('admin_password')) { // No password entered? - $passwdMessage = '{--ADMIN_NO_PASS--}'; - } elseif (strlen(postRequestElement('admin_password')) < getConfig('minium_admin_pass_length')) { - // Or password too short? - $passwdMessage = '{--ADMIN_SHORT_PASS--}'; + $passwdMessage = '{--ADMIN_NO_PASSWORD--}'; } elseif ((!empty($ret)) && (postRequestElement('login') == 'password')) { // An error comes back from login? $passwdMessage = $ret; @@ -202,13 +199,13 @@ if (!isAdminRegistered()) { $register = getRequestElement('setup'); // Special logout redirect for installation of given extension - loadTemplate(sprintf("admin_logout_%s_install", $register)); + loadTemplate(sprintf('admin_logout_%s_install', $register)); } elseif (isGetRequestElementSet('remove')) { // Secure input $remove = getRequestElement('remove'); // Special logout redirect for removal of given extension - loadTemplate(sprintf("admin_logout_%s_remove", $remove)); + loadTemplate(sprintf('admin_logout_%s_remove', $remove)); } else { // Logged out normally loadTemplate('admin_logout'); @@ -265,7 +262,7 @@ if (!isAdminRegistered()) { break; default: // Others will be logged - logDebugMessage(__FILE__, __LINE__, sprintf("Unknown return code %s from ifAdminCookiesAreValid()", $ret)); + logDebugMessage(__FILE__, __LINE__, sprintf('Unknown return code %s from ifAdminCookiesAreValid()', $ret)); break; } // END - switch }