[Fusionforge-commits] r10565 - trunk/src/www/project/admin

Roland Mas lolando at libremir.placard.fr.eu.org
Mon Sep 20 22:39:33 CEST 2010


Author: lolando
Date: 2010-09-20 22:39:33 +0200 (Mon, 20 Sep 2010)
New Revision: 10565

Modified:
   trunk/src/www/project/admin/roleedit.php
   trunk/src/www/project/admin/users.php
Log:
Minimal UI to create a new role in a project

Modified: trunk/src/www/project/admin/roleedit.php
===================================================================
--- trunk/src/www/project/admin/roleedit.php	2010-09-20 20:38:24 UTC (rev 10564)
+++ trunk/src/www/project/admin/roleedit.php	2010-09-20 20:39:33 UTC (rev 10565)
@@ -3,24 +3,22 @@
  * Role Editing Page
  *
  * Copyright 2004 (c) GForge LLC
+ * Copyright 2010, Roland Mas
  *
- * @author Tim Perdue tim at gforge.org
- * @date 2004-03-16
+ * This file is part of FusionForge.
  *
- * This file is part of GForge.
- *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
@@ -62,7 +60,13 @@
 	}
 } else {
 	if (USE_PFO_RBAC) {
-		$role = RBACEngine::getInstance()->getRoleById($role_id) ;
+		if (getStringFromRequest('add')) {
+			$role_name = trim(getStringFromRequest('role_name')) ;
+			$role = new Role ($group) ;
+			$role_id=$role->createDefault($role_name) ;
+		} else {
+			$role = RBACEngine::getInstance()->getRoleById($role_id) ;
+		}
 	} else {
 		$role = new Role($group,$role_id);
 	}

Modified: trunk/src/www/project/admin/users.php
===================================================================
--- trunk/src/www/project/admin/users.php	2010-09-20 20:38:24 UTC (rev 10564)
+++ trunk/src/www/project/admin/users.php	2010-09-20 20:39:33 UTC (rev 10565)
@@ -236,9 +236,11 @@
 		echo role_box($group_id,'role_id','',false);
 		echo '&nbsp;<input type="submit" name="edit" value="'._("Edit Role").'" /></p></form>';
 
-		echo '<p><a href="roleedit.php?group_id='.$group_id.'">'._("Add Role").'</a>';
-		echo '</p>';
 
+		echo '<form action="roleedit.php?group_id='. $group_id .'" method="post"><p>';
+		echo '<input type="text" name="role_name" size="10" value="" />';
+		echo '&nbsp;<input type="submit" name="add" value="'._("Add Role").'" /></p></form>';
+
 		echo $HTML->boxBottom();
 
 		?></td>




More information about the Fusionforge-commits mailing list