svn commit: r585 - trunk/mapbender/http/php/mod_createUser.php

astrid_emde at osgeo.org astrid_emde at osgeo.org
Tue Jun 20 10:33:58 EDT 2006


Author: astrid_emde
Date: 2006-06-20 14:33:58+0000
New Revision: 585

Modified:
   trunk/mapbender/http/php/mod_createUser.php

Log:
new guis gui2 and gui_digitize added

Modified: trunk/mapbender/http/php/mod_createUser.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_createUser.php?view=diff&rev=585&p1=trunk/mapbender/http/php/mod_createUser.php&p2=trunk/mapbender/http/php/mod_createUser.php&r1=584&r2=585
==============================================================================
--- trunk/mapbender/http/php/mod_createUser.php	(original)
+++ trunk/mapbender/http/php/mod_createUser.php	2006-06-20 14:33:58+0000
@@ -158,8 +158,12 @@
 		//create new name for gui
 		$gui_id1 = $admin->getGuiIdByGuiName("gui");
 		$gui_id2 = $admin->getGuiIdByGuiName("gui1");
+		$gui_id3 = $admin->getGuiIdByGuiName("gui2");
+		$gui_id4 = $admin->getGuiIdByGuiName("gui_digitize");
 		$gui_newName1 = $name . "_gui";
 		$gui_newName2 = $name . "_gui1";
+		$gui_newName3 = $name . "_gui2";
+		$gui_newName4 = $name . "_gui_digitize";
 		//check if new gui names are already taken
 		while ($gui->guiExists($gui_newName1)) {
 			$gui_newName1 .= "_1";
@@ -167,21 +171,35 @@
 		while ($gui->guiExists($gui_newName2)) {
 			$gui_newName2 .= "_1";
 		}
+		while ($gui->guiExists($gui_newName2)) {
+			$gui_newName3 .= "_1";
+		}
+		while ($gui->guiExists($gui_newName2)) {
+			$gui_newName4 .= "_1";
+		}
 		//create gui_(name) and gui1_(name)
 		$gui->copyGui($gui_id1[0], $gui_newName1,true);
 		$gui->copyGui($gui_id2[0], $gui_newName2,true);
+		$gui->copyGui($gui_id3[0], $gui_newName3,true);
+		$gui->copyGui($gui_id4[0], $gui_newName4,true);
 		$new_guiId1 = $admin->getGuiIdByGuiName($gui_newName1);
 		$new_guiId2 = $admin->getGuiIdByGuiName($gui_newName2);
+		$new_guiId3 = $admin->getGuiIdByGuiName($gui_newName3);
+		$new_guiId4 = $admin->getGuiIdByGuiName($gui_newName4);
 		//grant owner rights for new guis to this user only!
 		$admin->delAllUsersOfGui($new_guiId1[0]);
 		$admin->delAllUsersOfGui($new_guiId2[0]);
+		$admin->delAllUsersOfGui($new_guiId3[0]);
+		$admin->delAllUsersOfGui($new_guiId4[0]);
 		$admin->insertUserAsGuiOwner($new_guiId1[0], $selected_user);
 		$admin->insertUserAsGuiOwner($new_guiId2[0], $selected_user);
+		$admin->insertUserAsGuiOwner($new_guiId3[0], $selected_user);
+		$admin->insertUserAsGuiOwner($new_guiId4[0], $selected_user);
 		// delete gui from groups
 		// (gui and gui1 are associated with groups 20 and 21, new guis belong to mb_user only)
-		$sql_del_from_group = "DELETE FROM gui_mb_group WHERE fkey_gui_id = $1 OR fkey_gui_id = $2 ";
-		$v = array($new_guiId1[0],$new_guiId2[0]);
-		$t = array('s','s');
+		$sql_del_from_group = "DELETE FROM gui_mb_group WHERE fkey_gui_id = $1 OR fkey_gui_id = $2 OR fkey_gui_id = $3 OR fkey_gui_id = $4";
+		$v = array($new_guiId1[0],$new_guiId2[0],$new_guiId3[0],$new_guiId4[0]);
+		$t = array('s','s','s','s');
 		$res_del_from_group = db_prep_query($sql_del_from_group,$v,$t);	 
 	}
 }




More information about the Mapbender_commits mailing list