[Fusionforge-commits] FusionForge branch master updated. bbd5aada1e4d6d31f3c0691938e216583b03ec3b

Franck VILLAUME nerville at fusionforge.org
Sun Aug 25 18:16:11 CEST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  bbd5aada1e4d6d31f3c0691938e216583b03ec3b (commit)
      from  f981000d48f015b237f7f05a3c82846703e354d0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bbd5aada1e4d6d31f3c0691938e216583b03ec3b
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Aug 25 18:15:47 2013 +0200

    account: patch #530 add control in resending confirmation to a pending account

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 '<p>'. _('Your email confirmation has been resent. Visit the link in this email to complete the registration process.'). '</p>';
+			$HTML->footer(array());
+			exit;
+		}
 	}
-	$u->sendRegistrationEmail();
-	$HTML->header(array('title'=>"Account Pending Verification"));
-
-	?>
-
-	<h2><?php echo _('Pending Account')?></h2>
-	<p>
-	<?php echo _('Your email confirmation has been resent. Visit the link in this email to complete the registration process.');?>
-	</p>
-
-<?php
-	exit;
 }
 
 $HTML->header(array('title'=>_('Resend confirmation email to a pending account')));

-----------------------------------------------------------------------

Summary of changes:
 src/www/account/pending-resend.php |   50 +++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list