From: Roland Häder Date: Fri, 29 Jul 2011 21:19:17 +0000 (+0000) Subject: Renamed form fields to separate them from others X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=25868bdcc03148f17e204ae741d8b4ab63160bd7;p=mailer.git Renamed form fields to separate them from others --- diff --git a/inc/modules/admin.php b/inc/modules/admin.php index d2b5e4cf24..a7e7831afa 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -52,7 +52,7 @@ $ret = 'init'; // Is no admin registered? if (!isAdminRegistered()) { // Admin is not registered so we have to inform the user - if ((isFormSent()) && ((!isPostRequestParameterSet('login')) || (!isPostRequestParameterSet('pass1')) || (strlen(postRequestParameter('pass1')) < getConfig('minium_admin_pass_length')) || (!isPostRequestParameterSet('pass2')) || (strlen(postRequestParameter('pass2')) < getConfig('minium_admin_pass_length')) || (postRequestParameter('pass1') != postRequestParameter('pass2')))) { + if ((isFormSent()) && ((!isPostRequestParameterSet('admin_login')) || (!isPostRequestParameterSet('admin_pass1')) || (strlen(postRequestParameter('admin_pass1')) < getConfig('minium_admin_pass_length')) || (!isPostRequestParameterSet('admin_pass2')) || (strlen(postRequestParameter('admin_pass2')) < getConfig('minium_admin_pass_length')) || (postRequestParameter('admin_pass1') != postRequestParameter('admin_pass2')))) { setPostRequestParameter('ok', '***'); } // END - if @@ -61,13 +61,13 @@ if (!isAdminRegistered()) { if ((isFormSent()) && (postRequestParameter('ok') != '***')) { // Hash the password with the old function because we are here in install mode - $hashedPass = md5(postRequestParameter('pass1')); + $hashedPass = md5(postRequestParameter('admin_pass1')); // Kill maybe existing session variables destroyAdminSession(false); // Do registration - $ret = addAdminAccount(postRequestParameter('login'), $hashedPass, getWebmaster()); + $ret = addAdminAccount(postRequestParameter('admin_login'), $hashedPass, getWebmaster()); // Check if registration wents fine switch ($ret) { @@ -116,9 +116,9 @@ if (!isAdminRegistered()) { // Whas that action okay? if ($ret != 'done') { // Init login name - $content['login'] = ''; - if (isPostRequestParameterSet('login')) { - $content['login'] = postRequestParameter('login'); + $content['admin_login'] = ''; + if (isPostRequestParameterSet('admin_login')) { + $content['admin_login'] = postRequestParameter('admin_login'); } // END - if // Init array elements @@ -135,7 +135,7 @@ if (!isAdminRegistered()) { $pass2Message = ''; // No login entered? - if (empty($content['login'])) { + if (empty($content['admin_login'])) { $loginMessage = '{--ADMIN_NO_LOGIN--}'; } // END - if @@ -145,21 +145,21 @@ if (!isAdminRegistered()) { } // END - if // No password 1 entered or to short? - if (!isPostRequestParameterSet('pass1')) { + if (!isPostRequestParameterSet('admin_pass1')) { $pass1Message = '{--ADMIN_NO_PASS1--}'; - } elseif (strlen(postRequestParameter('pass1')) < getConfig('minium_admin_pass_length')) { + } elseif (strlen(postRequestParameter('admin_pass1')) < getConfig('minium_admin_pass_length')) { $pass1Message = '{--ADMIN_SHORT_PASS1--}'; } // No password 2 entered or to short? - if (!isPostRequestParameterSet('pass2')) { + if (!isPostRequestParameterSet('admin_pass2')) { $pass2Message = '{--ADMIN_NO_PASS2--}'; - } elseif (strlen(postRequestParameter('pass2')) < getConfig('minium_admin_pass_length')) { + } elseif (strlen(postRequestParameter('admin_pass2')) < getConfig('minium_admin_pass_length')) { $pass2Message = '{--ADMIN_SHORT_PASS2--}'; } // Both didn't match? - if (postRequestParameter('pass1') != postRequestParameter('pass2')) { + if (postRequestParameter('admin_pass1') != postRequestParameter('admin_pass2')) { // No match if (empty($pass1Message)) $pass1Message = '{--ADMIN_PASS1_MISMATCH--}'; if (empty($pass2Message)) $pass2Message = '{--ADMIN_PASS2_MISMATCH--}'; @@ -186,16 +186,16 @@ if (!isAdminRegistered()) { } elseif (isGetRequestParameterSet('hash')) { // Output form for hash validation loadTemplate('admin_validate_reset_hash_form', false, getRequestParameter('hash')); - } elseif ((isPostRequestParameterSet('validate_hash')) && (isPostRequestParameterSet('login')) && (isPostRequestParameterSet('hash'))) { + } elseif ((isPostRequestParameterSet('validate_hash')) && (isPostRequestParameterSet('admin_login')) && (isPostRequestParameterSet('hash'))) { // Validate the login data and hash - $valid = adminResetValidateHashLogin(postRequestParameter('hash'), postRequestParameter('login')); + $valid = adminResetValidateHashLogin(postRequestParameter('hash'), postRequestParameter('admin_login')); // Valid? if ($valid === true) { // Prepare content first $content = array( 'hash' => postRequestParameter('hash'), - 'login' => postRequestParameter('login') + 'admin_login' => postRequestParameter('admin_login') ); // Validation okay so display form for final password change @@ -204,11 +204,11 @@ if (!isAdminRegistered()) { // Cannot validate the login data and hash displayMessage('{--ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED--}'); } - } elseif ((isPostRequestParameterSet('reset_pass')) && (isPostRequestParameterSet('hash')) && (isPostRequestParameterSet('login')) && (isPostRequestParameterSet('pass1')) && (postRequestParameter('pass1') == postRequestParameter('pass2'))) { + } elseif ((isPostRequestParameterSet('reset_pass')) && (isPostRequestParameterSet('hash')) && (isPostRequestParameterSet('admin_login')) && (isPostRequestParameterSet('admin_pass1')) && (postRequestParameter('admin_pass1') == postRequestParameter('admin_pass2'))) { // Okay, we shall the admin password here. So first revalidate the hash - if (adminResetValidateHashLogin(postRequestParameter('hash'), postRequestParameter('login'))) { + if (adminResetValidateHashLogin(postRequestParameter('hash'), postRequestParameter('admin_login'))) { // Output result - loadTemplate('admin_reset_password_done', false, doResetAdminPassword(postRequestParameter('login'), postRequestParameter('pass1'))); + loadTemplate('admin_reset_password_done', false, doResetAdminPassword(postRequestParameter('admin_login'), postRequestParameter('admin_pass1'))); } else { // Validation failed displayMessage('{--ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED2--}'); @@ -233,13 +233,13 @@ if (!isAdminRegistered()) { } // END - if // Check if the admin has submitted data or not - if ((isFormSent()) && ((!isPostRequestParameterSet('login')) || (!isPostRequestParameterSet('password')) || (strlen(postRequestParameter('password')) < getConfig('minium_admin_pass_length')))) { + if ((isFormSent()) && ((!isPostRequestParameterSet('admin_login')) || (!isPostRequestParameterSet('admin_password')) || (strlen(postRequestParameter('admin_password')) < getConfig('minium_admin_pass_length')))) { setPostRequestParameter('ok', '***'); } // END - if if ((isFormSent()) && (postRequestParameter('ok') != '***')) { // All required data was entered so we check his account - $ret = ifAdminLoginDataIsValid(postRequestParameter('login'), postRequestParameter('password')); + $ret = ifAdminLoginDataIsValid(postRequestParameter('admin_login'), postRequestParameter('admin_password')); // Which status do we have? switch ($ret) { @@ -267,7 +267,7 @@ if (!isAdminRegistered()) { case '404': // Administrator login not found setPostRequestParameter('ok', $ret); - $ret = '{%message,ADMIN_ACCOUNT_404=' . postRequestParameter('login') . '%}'; + $ret = '{%message,ADMIN_ACCOUNT_404=' . postRequestParameter('admin_login') . '%}'; destroyAdminSession(); break; @@ -285,9 +285,9 @@ if (!isAdminRegistered()) { // Error detected? if ($ret != 'done') { - $content['login'] = ''; - if (isPostRequestParameterSet('login')) { - $content['login'] = postRequestParameter('login'); + $content['admin_login'] = ''; + if (isPostRequestParameterSet('admin_login')) { + $content['admin_login'] = postRequestParameter('admin_login'); } // END - if // Init array elements @@ -300,7 +300,7 @@ if (!isAdminRegistered()) { $passwdMessage = ''; // Check for login - if (!isPostRequestParameterSet('login')) { + if (!isPostRequestParameterSet('admin_login')) { // No login entered? $loginMessage = '{--ADMIN_NO_LOGIN--}'; } elseif ((!empty($ret)) && (postRequestParameter('ok') == '404')) { @@ -309,10 +309,10 @@ if (!isAdminRegistered()) { } // Check for password - if (!isPostRequestParameterSet('password')) { + if (!isPostRequestParameterSet('admin_password')) { // No password entered? $passwdMessage = '{--ADMIN_NO_PASS--}'; - } elseif (strlen(postRequestParameter('password')) < getConfig('minium_admin_pass_length')) { + } elseif (strlen(postRequestParameter('admin_password')) < getConfig('minium_admin_pass_length')) { // Or password too short? $passwdMessage = '{--ADMIN_SHORT_PASS--}'; } elseif ((!empty($ret)) && (postRequestParameter('ok') == 'password')) { diff --git a/templates/de/emails/admin/admin_reset_password.tpl b/templates/de/emails/admin/admin_reset_password.tpl index beab4d17d7..1fdd94a290 100644 --- a/templates/de/emails/admin/admin_reset_password.tpl +++ b/templates/de/emails/admin/admin_reset_password.tpl @@ -9,7 +9,7 @@ hier ist Ihr angefordeter Reset-Link, den Sie zum Zurücksetzen Ihres Admini Wenn Sie auf diesen Link klicken, ist Ihr Passwort noch nicht zurückgesetzt. Bitte geben Sie zur Bestätigung Ihr Loginname ein. Dann erst können Sie Ihr Passwort ändern. Hier ist Ihr Loginname: -$content[login] +$content[admin_login] Sollten Sie dies nicht gewesen sein, so ignorieren Sie einfach diese Mail. Hier sind die IP-Nummer und Browserbezeichnung: ------------------------------ diff --git a/templates/de/html/admin/admin_login_form.tpl b/templates/de/html/admin/admin_login_form.tpl index 855ad62bfc..0166df915a 100644 --- a/templates/de/html/admin/admin_login_form.tpl +++ b/templates/de/html/admin/admin_login_form.tpl @@ -14,7 +14,7 @@ {--ENTER_ADMIN_LOGIN--}: - + $content[login_message] @@ -26,7 +26,7 @@ - + $content[pass_message] diff --git a/templates/de/html/admin/admin_reg_form.tpl b/templates/de/html/admin/admin_reg_form.tpl index bd841b51d6..59b90a8256 100644 --- a/templates/de/html/admin/admin_reg_form.tpl +++ b/templates/de/html/admin/admin_reg_form.tpl @@ -10,21 +10,21 @@ {--ADMIN_ACCOUNT_FIRST_CREATION_LOGIN--}: - + $content[login_message] {--ADMIN_ACCOUNT_FIRST_CREATION_PASS1--}: - + $content[pass1_message] {--ADMIN_ACCOUNT_FIRST_CREATION_PASS2--}: - + $content[pass2_message] diff --git a/templates/de/html/admin/admin_reset_password_form.tpl b/templates/de/html/admin/admin_reset_password_form.tpl index 48888c25c3..d769ab9803 100644 --- a/templates/de/html/admin/admin_reset_password_form.tpl +++ b/templates/de/html/admin/admin_reset_password_form.tpl @@ -11,7 +11,7 @@ {--ADMIN_SHOW_LOGIN--} -
$content[login]
+
$content[admin_login]
[{--ADMIN_CHANGE_LOGIN--}]
@@ -20,7 +20,7 @@ {--ADMIN_ENTER_PASSWORD1--} - + @@ -28,13 +28,13 @@ {--ADMIN_ENTER_PASSWORD2--} - + - +