[Fusionforge-commits] r10733 - trunk/src/common/include

Roland Mas lolando at libremir.placard.fr.eu.org
Mon Sep 27 17:29:03 CEST 2010


Author: lolando
Date: 2010-09-27 17:29:02 +0200 (Mon, 27 Sep 2010)
New Revision: 10733

Modified:
   trunk/src/common/include/Role.class.php
Log:
Check for empty names when creating a role

Modified: trunk/src/common/include/Role.class.php
===================================================================
--- trunk/src/common/include/Role.class.php	2010-09-27 14:48:10 UTC (rev 10732)
+++ trunk/src/common/include/Role.class.php	2010-09-27 15:29:02 UTC (rev 10733)
@@ -82,6 +82,10 @@
 	 *      @return boolean True if updated OK
 	 */
 	function setName ($role_name) { // From the PFO spec
+		if ($role_name == '') {
+			$this->setError('Cannot set a role name to empty');
+			return false;
+		}
 		if ($this->getName() != stripslashes($role_name)) {
 			if (USE_PFO_RBAC) {
 				db_begin();
@@ -181,6 +185,10 @@
 				$this->setPermissionDeniedError();
 				return false;
 			}			
+			if ($role_name == '') {
+				$this->setError('Cannot create a role with an empty name');
+				return false;
+			}
 			
 			db_begin();
 			if ($this->Group == NULL) {




More information about the Fusionforge-commits mailing list