From bbd5aada1e4d6d31f3c0691938e216583b03ec3b Mon Sep 17 00:00:00 2001 From: Franck Villaume Date: Sun, 25 Aug 2013 18:15:47 +0200 Subject: [PATCH] account: patch #530 add control in resending confirmation to a pending account --- src/www/account/pending-resend.php | 50 ++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/src/www/account/pending-resend.php b/src/www/account/pending-resend.php index f31a1e9..c194dda 100644 --- a/src/www/account/pending-resend.php +++ b/src/www/account/pending-resend.php @@ -3,7 +3,8 @@ * Resend account activation email with confirmation URL * * Copyright 1999-2001 (c) VA Linux Systems - * Copyright 2010 (c), Franck Villaume + * Copyright 2010-2013, Franck Villaume - TrivialDev + * Copyright 2013, French Ministry of National Education * * This file is part of FusionForge. FusionForge is free software; * you can redistribute it and/or modify it under the terms of the @@ -25,33 +26,28 @@ require_once '../env.inc.php'; require_once $gfcommon.'include/pre.php'; if (getStringFromRequest('submit')) { - $loginname = getStringFromRequest('loginname'); - - $u = user_get_object_by_name($loginname); - if (!$u && forge_get_config('require_unique_email')) { - $u = user_get_object_by_email ($loginname); - } - if (!$u || !is_object($u)) { - exit_error(_('Could Not Get User'),'home'); - } elseif ($u->isError()) { - exit_error($u->getErrorMessage(),'home'); - } - - if ($u->getStatus() != 'P') { - exit_error(_('Your account is already active.'),'my'); + $loginname = trim(getStringFromRequest('loginname')); + if (!strlen($loginname)) { + $error_msg = _('Missing Parameter. You must provide a login name or an email address.'); + } else { + $u = user_get_object_by_name($loginname); + if (!$u && forge_get_config('require_unique_email')) { + $u = user_get_object_by_email($loginname); + } + if (!$u || !is_object($u)) { + $error_msg = _('That user does not exist.'); + } elseif ($u->isError()) { + $error_msg = $u->getErrorMessage(); + } elseif ($u->getStatus() != 'P') { + $warning_msg = _('Your account is already active.'); + } else{ + $u->sendRegistrationEmail(); + $HTML->header(array('title'=>_('Pending Account'))); + echo '

'. _('Your email confirmation has been resent. Visit the link in this email to complete the registration process.'). '

'; + $HTML->footer(array()); + exit; + } } - $u->sendRegistrationEmail(); - $HTML->header(array('title'=>"Account Pending Verification")); - - ?> - -

-

- -

- -header(array('title'=>_('Resend confirmation email to a pending account'))); -- 2.1.4