[Fusionforge-commits] r13088 - in branches/Branch_5_1/src: common/include www/admin

Julien HEYMAN jheyman at fusionforge.org
Tue Apr 12 18:03:57 CEST 2011


Author: jheyman
Date: 2011-04-12 18:03:57 +0200 (Tue, 12 Apr 2011)
New Revision: 13088

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

Modified: branches/Branch_5_1/src/common/include/User.class.php
===================================================================
--- branches/Branch_5_1/src/common/include/User.class.php	2011-04-12 14:44:50 UTC (rev 13087)
+++ branches/Branch_5_1/src/common/include/User.class.php	2011-04-12 16:03:57 UTC (rev 13088)
@@ -659,6 +659,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: branches/Branch_5_1/src/www/admin/useredit.php
===================================================================
--- branches/Branch_5_1/src/www/admin/useredit.php	2011-04-12 14:44:50 UTC (rev 13087)
+++ branches/Branch_5_1/src/www/admin/useredit.php	2011-04-12 16:03:57 UTC (rev 13088)
@@ -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