Index: www/account/verify.php =================================================================== --- www/account/verify.php (revision 95) +++ www/account/verify.php (revision 96) @@ -27,57 +27,48 @@ require_once('../env.inc.php'); require_once $gfcommon.'include/pre.php'; +global $error_msg; $confirm_hash = getStringFromRequest('confirm_hash'); + if (getStringFromRequest('submit')) { $loginname = getStringFromRequest('loginname'); $passwd = getStringFromRequest('passwd'); if (!$loginname) { - exit_missing_param('',array(_('UserName')),'my'); + $error_msg = _('Missing required parameters : ')._('UserName'); } - $u = user_get_object_by_name($loginname); if (!$u && forge_get_config('require_unique_email')) { $u = user_get_object_by_email ($loginname); } + $confirm_hash = html_clean_hash_string($confirm_hash); if (!$u || !is_object($u)) { - exit_error(_('Could Not Get User'),'home'); + $error_msg = _('Invalid Password Or User Name'); } elseif ($u->isError()) { - exit_error($u->getErrorMessage(),'my'); - } - - if ($u->getStatus()=='A'){ - exit_error(_('Account already active.'),'my'); - } - - $confirm_hash = html_clean_hash_string($confirm_hash); - - if ($confirm_hash != $u->getConfirmHash()) { - exit_error(_('Cannot confirm account identity - invalid confirmation hash (or login name)'),'my'); - } - - if (!session_login_valid($loginname, $passwd, 1)) { - exit_permission_denied(_('Credentials you entered do not correspond to valid account.'),'my'); - } - - if (!$u->setStatus('A')) { - exit_error( _('Error while activiting account').': '.$u->getErrorMessage(),'my'); + $error_msg = $u->getErrorMessage(); + }elseif ($u->getStatus()=='A'){ + $error_msg = _('Account already active.'); + }elseif ($confirm_hash != $u->getConfirmHash()) { + $error_msg = _('Cannot confirm account identity - invalid confirmation hash (or login name)'); + }elseif (!session_login_valid($loginname, $passwd, 1)) { + $error_msg = _('Credentials you entered do not correspond to valid account.'); + }elseif (!$u->setStatus('A')) { + $error_msg = _('Error while activiting account').': '.$u->getErrorMessage(); + }else{ + session_redirect("/account/first.php"); } - - session_redirect("/account/first.php"); } -$HTML->header(array('title'=>'Verify')); - +$HTML->header(array('title'=>_('Verify'))); echo '
' . _('In order to complete your registration, login now. Your account will then be activated for normal logins.') . '
'; -if (isset($GLOBALS['error_msg']) && $GLOBALS['error_msg'] != '') { +/*if (isset($GLOBALS['error_msg']) && $GLOBALS['error_msg'] != '') { print ''.$GLOBALS['error_msg'].'
'; -} +}*/ ?> -