// 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
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) {
// 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
$pass2Message = '';
// No login entered?
- if (empty($content['login'])) {
+ if (empty($content['admin_login'])) {
$loginMessage = '{--ADMIN_NO_LOGIN--}';
} // END - if
} // 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--}';
} 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
// 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--}');
} // 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) {
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;
// 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
$passwdMessage = '';
// Check for login
- if (!isPostRequestParameterSet('login')) {
+ if (!isPostRequestParameterSet('admin_login')) {
// No login entered?
$loginMessage = '{--ADMIN_NO_LOGIN--}';
} elseif ((!empty($ret)) && (postRequestParameter('ok') == '404')) {
}
// 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')) {