[geeklog-cvs] Geeklog-1.x/system lib-user.php,1.40,1.41
Blaine Lang
blaine at qs1489.pair.com
Sat Jun 9 16:43:43 EDT 2007
Update of /cvsroot/geeklog/Geeklog-1.x/system
In directory qs1489.pair.com:/tmp/cvs-serv25248/system
Modified Files:
lib-user.php
Log Message:
Mail to a group will now check for sub-groups so all users including those in sub-groups will be sent the email.
Added function USER_getChildGroups to system/lib-user.php
Index: lib-user.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/lib-user.php,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** lib-user.php 26 May 2007 19:31:59 -0000 1.40
--- lib-user.php 9 Jun 2007 20:43:41 -0000 1.41
***************
*** 636,638 ****
}
! ?>
--- 636,672 ----
}
!
! /**
! * Used to return an array of groups that a base group contains
! * GL supports hierarchical groups and this will return all the child groups
! *
! * @param int $groupid Group id to get list of groups for
! * @return array Array of child groups
! *
! */
! function USER_getChildGroups($groupid) {
! global $_TABLES;
! $to_check = array ();
! array_push ($to_check, $groupid);
! $groups = array ();
! while (sizeof ($to_check) > 0) {
! $thisgroup = array_pop ($to_check);
! if ($thisgroup > 0) {
! $result = DB_query ("SELECT ug_grp_id FROM {$_TABLES['group_assignments']} WHERE ug_main_grp_id = $thisgroup");
! $numGroups = DB_numRows ($result);
! for ($i = 0; $i < $numGroups; $i++) {
! $A = DB_fetchArray ($result);
! if (!in_array ($A['ug_grp_id'], $groups)) {
! if (!in_array ($A['ug_grp_id'], $to_check)) {
! array_push ($to_check, $A['ug_grp_id']);
! }
! }
! }
! $groups[] = $thisgroup;
! }
! }
! return $groups;
! }
!
!
! ?>
\ No newline at end of file
More information about the geeklog-cvs
mailing list