From: <sy...@us...> - 2004-10-19 17:32:15
|
Update of /cvsroot/tikiwiki/tiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2540/lib Modified Files: Tag: BRANCH-1-9 userslib.php Log Message: if a user belongs to several groups with homepage, choose the home page of one of the most englobing group Index: userslib.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/userslib.php,v retrieving revision 1.133.2.19 retrieving revision 1.133.2.20 diff -u -d -r1.133.2.19 -r1.133.2.20 --- userslib.php 15 Oct 2004 10:42:48 -0000 1.133.2.19 +++ userslib.php 19 Oct 2004 17:32:03 -0000 1.133.2.20 @@ -1163,13 +1163,19 @@ if ($home != '') return $home; } - $query = "select g.`groupHome` from `users_usergroups` as gu, `users_users` as u, `users_groups`as g where gu.`userId`= u.`userId` and u.`login`=? and gu.`groupName`= g.`groupName` and g.`groupHome` != '' and g.`groupHome` is not null"; + $query = "select g.`groupHome`, g.`groupName` from `users_usergroups` as gu, `users_users` as u, `users_groups`as g where gu.`userId`= u.`userId` and u.`login`=? and gu.`groupName`= g.`groupName` and g.`groupHome` != '' and g.`groupHome` is not null"; $result = $this->query($query,array($user)); $home = ''; while ($res = $result->fetchRow()) { - if ($home != '') - return ''; + if ($home != '') { + $groups = $this->get_included_groups($res["groupName"]); + if (in_array($group, $groups)) { + $home = $res["groupHome"]; + $group = $res["groupName"]; + } + } $home = $res["groupHome"]; + $group = $res["groupName"]; } return $home; } |