[Mapbender-commits] r7706 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Mar 15 09:44:54 EDT 2011


Author: armin11
Date: 2011-03-15 06:44:54 -0700 (Tue, 15 Mar 2011)
New Revision: 7706

Modified:
   trunk/mapbender/http/php/mod_group_user.php
   trunk/mapbender/http/php/mod_user_group.php
Log:
Bugfix for new role concept - don't show entries which are not standard role or no role.

Modified: trunk/mapbender/http/php/mod_group_user.php
===================================================================
--- trunk/mapbender/http/php/mod_group_user.php	2011-03-15 13:27:30 UTC (rev 7705)
+++ trunk/mapbender/http/php/mod_group_user.php	2011-03-15 13:44:54 UTC (rev 7706)
@@ -136,7 +136,7 @@
 	if(count($selected_user)>0){
 		for($i=0; $i<count($selected_user); $i++){
 			$exists = false;
-			$sql = "SELECT * from mb_user_mb_group where fkey_mb_group_id = $1 and fkey_mb_user_id = $2";
+			$sql = "SELECT * from mb_user_mb_group where fkey_mb_group_id = $1 and fkey_mb_user_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($selected_group,$selected_user[$i]);
 			$t = array('i','i');
 			$res_insert = db_prep_query($sql,$v,$t);
@@ -155,7 +155,7 @@
 	if(count($remove_user)>0){
 		for($i=0; $i<count($remove_user); $i++){
 			$sql_remove = "DELETE FROM mb_user_mb_group WHERE ";
-			$sql_remove .= "fkey_mb_user_id = $1 and fkey_mb_group_id = $2";
+			$sql_remove .= "fkey_mb_user_id = $1 and fkey_mb_group_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($remove_user[$i],$selected_group);
 			$t = array('i','i');
 			db_prep_query($sql_remove,$v,$t);
@@ -186,7 +186,7 @@
 /*get all user from selected group******************************************************************************/
 $sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user.mb_user_email, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
 $sql_mb_user_mb_group .= "INNER JOIN mb_user ON mb_user_mb_group.fkey_mb_user_id = mb_user.mb_user_id ";
-$sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id= $1 ";
+$sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id= $1 AND (mb_user_mb_group.mb_user_mb_group_type = 1 or mb_user_mb_group.mb_user_mb_group_type IS NULL)";
 $sql_mb_user_mb_group .= " ORDER BY mb_user.mb_user_name";
 
 if(!$selected_group){$v = array($group_id[0]);}
@@ -272,4 +272,4 @@
 // -->
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/mapbender/http/php/mod_user_group.php
===================================================================
--- trunk/mapbender/http/php/mod_user_group.php	2011-03-15 13:27:30 UTC (rev 7705)
+++ trunk/mapbender/http/php/mod_user_group.php	2011-03-15 13:44:54 UTC (rev 7706)
@@ -136,7 +136,7 @@
 	if(count($selected_group)>0){
 		for($i=0; $i<count($selected_group); $i++){
 			$exists = false;
-			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_user_id = $1 and fkey_mb_group_id = $2 ";
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_user_id = $1 and fkey_mb_group_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($selected_user,$selected_group[$i]);
 			$t = array('i','i');
 			$res_insert = db_prep_query($sql_insert,$v,$t);
@@ -153,7 +153,7 @@
 if($remove){
 	if(count($remove_group)>0){
 		for($i=0; $i<count($remove_group); $i++){
-			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_group_id = $1 and fkey_mb_user_id = $2";
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_group_id = $1 and fkey_mb_user_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($remove_group[$i],$selected_user);
 			$t = array('i','i');
 			db_prep_query($sql_remove,$v,$t);
@@ -183,7 +183,7 @@
 /*get all group from selected_user******************************************************************************/
 $sql_user_mb_group = "SELECT mb_group.mb_group_id, mb_group.mb_group_name, mb_user_mb_group.fkey_mb_user_id FROM mb_user_mb_group ";
 $sql_user_mb_group .= "INNER JOIN mb_group ON mb_user_mb_group.fkey_mb_group_id = mb_group.mb_group_id ";
-$sql_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_user_id = $1 ";
+$sql_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_user_id = $1 AND (mb_user_mb_group.mb_user_mb_group_type = 1 or mb_user_mb_group.mb_user_mb_group_type IS NULL)";
 $sql_user_mb_group .= " ORDER BY mb_group.mb_group_name";
 
 if(!$selected_user){$v = array($user_id[0]);}
@@ -258,4 +258,4 @@
 // -->
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>



More information about the Mapbender_commits mailing list