[Fusionforge-commits] r13087 - in trunk/src: common/include www/admin

Julien HEYMAN jheyman at fusionforge.org
Tue Apr 12 16:44:50 CEST 2011


Author: jheyman
Date: 2011-04-12 16:44:50 +0200 (Tue, 12 Apr 2011)
New Revision: 13087

Modified:
   trunk/src/common/include/User.class.php
   trunk/src/www/admin/useredit.php
Log:
Can't set pending status if user is suspended or active

Modified: trunk/src/common/include/User.class.php
===================================================================
--- trunk/src/common/include/User.class.php	2011-04-12 14:37:31 UTC (rev 13086)
+++ trunk/src/common/include/User.class.php	2011-04-12 14:44:50 UTC (rev 13087)
@@ -679,6 +679,10 @@
 			$this->setError(_('ERROR: Invalid status value'));
 			return false;
 		}
+		if ($this->getStatus() != 'P' && $status == 'P') {
+			$this->setError('ERROR: You can\'t set pending status if user is suspend or active');
+			return false;
+		}
 
 		db_begin();
 		$res = db_query_params ('UPDATE users SET status=$1 WHERE user_id=$2',

Modified: trunk/src/www/admin/useredit.php
===================================================================
--- trunk/src/www/admin/useredit.php	2011-04-12 14:37:31 UTC (rev 13086)
+++ trunk/src/www/admin/useredit.php	2011-04-12 14:44:50 UTC (rev 13087)
@@ -133,11 +133,15 @@
 		_('Active (A)'),
 		_('Suspended (S)'),
 		_('Deleted (D)'));
-} else {
+} else if ($u->getStatus() == 'P') {
 	$status_letter = array('P','A','S');
 	$status_text   = array(_('Pending (P)'),
 		_('Active (A)'),
 		_('Suspended (S)'));
+} else {
+	$status_letter = array('A','S');
+	$status_text   = array(_('Active (A)'),
+		_('Suspended (S)'));
 }
 echo html_build_select_box_from_arrays(
 	$status_letter,	$status_text,'status', $u->getStatus(), false);




More information about the Fusionforge-commits mailing list