X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fadmin-inc.php;h=c9f941dbd568b1277a4b9b82d658bb71d375b5f3;hp=67e137654726bdc04ba7fc90c8e64d01d3190bf3;hb=1d22c70e65e858422ee0d17a7612f4b5c0757a42;hpb=5db6eec1f733feda6977091029680a8b12396560 diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 67e1376547..c9f941dbd5 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -1594,16 +1594,18 @@ function registerFirstAdmin () { assert(!isAdminRegistered()); // Admin is not registered so we have to inform the user - if ((isFormSent('add_first_admin')) && ((!isPostRequestElementSet('admin_login')) || (!isPostRequestElementSet('admin_pass1')) || (strlen(postRequestElement('admin_pass1')) < getConfig('minium_admin_pass_length')) || (!isPostRequestElementSet('admin_pass2')) || (strlen(postRequestElement('admin_pass2')) < getConfig('minium_admin_pass_length')) || (postRequestElement('admin_pass1') != postRequestElement('admin_pass2')))) { + if ((isFormSent('add_first_admin')) && ((!isPostRequestElementSet('admin_login')) || (!isPostRequestElementSet('admin_password1')) || (strlen(postRequestElement('admin_password1')) < getConfig('minium_admin_pass_length')) || (!isPostRequestElementSet('admin_password2')) || (strlen(postRequestElement('admin_password2')) < getConfig('minium_admin_pass_length')) || (postRequestElement('admin_password1') != postRequestElement('admin_password2')))) { setPostRequestElement('add_first_admin', '***'); } // END - if // Clear error message $errorMessage = ''; + $ret = 'init'; + // Is form for first admin sent? if ((isFormSent('add_first_admin')) && (postRequestElement('add_first_admin') != '***')) { // Hash the password with the old function because we are here in install mode - $hashedPass = md5(postRequestElement('admin_pass1')); + $hashedPass = md5(postRequestElement('admin_password1')); // Kill maybe existing session variables destroyAdminSession(); @@ -1665,16 +1667,16 @@ function registerFirstAdmin () { // Init array elements $content['login_message'] = ''; - $content['pass1_message'] = ''; - $content['pass2_message'] = ''; + $content['password1_message'] = ''; + $content['password2_message'] = ''; $content['error_message'] = ''; // Yet-another notice-fix if ((isFormSent('add_first_admin')) && (postRequestElement('add_first_admin') == '***')) { // Init variables $loginMessage = ''; - $pass1Message = ''; - $pass2Message = ''; + $password1Message = ''; + $password2Message = ''; // No login entered? if (empty($content['admin_login'])) { @@ -1687,30 +1689,30 @@ function registerFirstAdmin () { } // END - if // No password 1 entered or to short? - if (!isPostRequestElementSet('admin_pass1')) { - $pass1Message = '{--ADMIN_NO_PASSWORD1--}'; - } elseif (strlen(postRequestElement('admin_pass1')) < getConfig('minium_admin_pass_length')) { - $pass1Message = '{--ADMIN_SHORT_PASSWORD1--}'; + if (!isPostRequestElementSet('admin_password1')) { + $password1Message = '{--ADMIN_NO_PASSWORD1--}'; + } elseif (strlen(postRequestElement('admin_password1')) < getConfig('minium_admin_pass_length')) { + $password1Message = '{--ADMIN_SHORT_PASSWORD1--}'; } // No password 2 entered or to short? - if (!isPostRequestElementSet('admin_pass2')) { - $pass2Message = '{--ADMIN_NO_PASSWORD2--}'; - } elseif (strlen(postRequestElement('admin_pass2')) < getConfig('minium_admin_pass_length')) { - $pass2Message = '{--ADMIN_SHORT_PASSWORD2--}'; + if (!isPostRequestElementSet('admin_password2')) { + $password2Message = '{--ADMIN_NO_PASSWORD2--}'; + } elseif (strlen(postRequestElement('admin_password2')) < getConfig('minium_admin_pass_length')) { + $password2Message = '{--ADMIN_SHORT_PASSWORD2--}'; } // Both didn't match? - if (postRequestElement('admin_pass1') != postRequestElement('admin_pass2')) { + if (postRequestElement('admin_password1') != postRequestElement('admin_password2')) { // No match - if (empty($pass1Message)) $pass1Message = '{--ADMIN_PASSWORD1_MISMATCH--}'; - if (empty($pass2Message)) $pass2Message = '{--ADMIN_PASSWORD2_MISMATCH--}'; + if (empty($password1Message)) $password1Message = '{--ADMIN_PASSWORD1_MISMATCH--}'; + if (empty($password2Message)) $password2Message = '{--ADMIN_PASSWORD2_MISMATCH--}'; } // END - if // Output error messages $content['login_message'] = loadTemplate('admin_login_msg', TRUE, $loginMessage); - $content['pass1_message'] = loadTemplate('admin_login_msg', TRUE, $pass1Message); - $content['pass2_message'] = loadTemplate('admin_login_msg', TRUE, $pass2Message); + $content['password1_message'] = loadTemplate('admin_login_msg', TRUE, $password1Message); + $content['password2_message'] = loadTemplate('admin_login_msg', TRUE, $password2Message); $content['error_message'] = loadTemplate('admin_login_msg', TRUE, $errorMessage); } // END - if