[geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.221,1.222

geeklog-cvs-admin at lists.geeklog.net geeklog-cvs-admin at lists.geeklog.net
Wed May 14 04:13:40 EDT 2003


Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory internal.geeklog.net:/tmp/cvs-serv14452

Modified Files:
	lib-common.php 
Log Message:
Using implode() is really much more elegant ...


Index: lib-common.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.221
retrieving revision 1.222
diff -C2 -d -r1.221 -r1.222
*** lib-common.php	11 May 2003 18:34:39 -0000	1.221
--- lib-common.php	14 May 2003 08:13:37 -0000	1.222
***************
*** 4865,4868 ****
--- 4865,4875 ----
      }
  
+     if( empty( $_GROUPS ))
+     {
+         // this shouldn't really happen, but if it does, handle user
+         // like an anonymous user
+         $uid = 1;
+     }
+ 
      if( SEC_inGroup( 'Root', $uid ))
      {
***************
*** 4876,4887 ****
          $sql .= "(({$table}owner_id = '{$uid}') AND ({$table}perm_owner >= $access)) OR ";
  
!         $groupList = '';
!         foreach( $GROUPS as $grp )
!         {
!             $groupList .= $grp . ',';
!         }
!         $groupList = substr( $groupList, 0, -1 );
!         $sql .= "(({$table}group_id IN ($groupList)) AND ({$table}perm_group >= $access)) OR ";
! 
          $sql .= "({$table}perm_members >= $access)";
      }
--- 4883,4888 ----
          $sql .= "(({$table}owner_id = '{$uid}') AND ({$table}perm_owner >= $access)) OR ";
  
!         $sql .= "(({$table}group_id IN (" . implode (',', $_GROUPS)
!              . ")) AND ({$table}perm_group >= $access)) OR ";
          $sql .= "({$table}perm_members >= $access)";
      }





More information about the geeklog-cvs mailing list