Changeset 1515
- Timestamp:
- 01/16/08 11:29:48 (11 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/mod/community/lib/communities_access_level_sql_check.php
r1080 r1515 22 22 if (count($communitieslist) > 0) { 23 23 $communitieslist = array_unique($communitieslist); 24 $run_result .= " or access IN ('community" . implode("', 'community", $communitieslist) . "') "; 24 if (!empty($run_result)) 25 $run_result .= " OR"; 26 $run_result .= " access IN ('community" . implode("', 'community", $communitieslist) . "') "; 25 27 } 26 28 } devel/mod/groups/lib/function_access_level_sql_where.php
r1251 r1515 3 3 // Returns an SQL "where" clause containing all the access codes that the user can see 4 4 5 if (logged_on) {5 if (isloggedin()) { 6 6 7 $groupslist = array(); 8 9 if ($groups = run("groups:getmembership",array($_SESSION['userid']))) { 10 foreach($groups as $group) { 11 $groupslist[] = $group->ident; 12 } 13 $run_result .= "or access IN ('group" . implode("', 'group", $groupslist) . "')"; 7 $groupslist = array(); 8 9 if ($groups = run("groups:getmembership",array($_SESSION['userid']))) { 10 foreach($groups as $group) { 11 $groupslist[] = $group->ident; 12 } 13 if (empty($run_result)) { 14 $run_result = ''; 15 } else { 16 $run_result .= ' OR '; 14 17 } 15 16 } 18 19 $run_result .= " access IN ('group" . implode("', 'group", $groupslist) . "')"; 20 } 21 22 } 17 23 18 24 ?> devel/mod/users/lib/function_access_level_sql_where.php
r1322 r1515 3 3 // Returns an SQL "where" clause containing all the access codes that the user can see 4 4 5 $run_result = " access = 'PUBLIC' ";6 5 7 6 if (isloggedin() && isadmin($_SESSION['userid'])) { … … 10 9 elseif (isloggedin()) { 11 10 12 $run_result = " owner = " . $_SESSION['userid'] . " "; 11 if (empty($run_result)) { 12 $run_result = ''; 13 } else { 14 $run_result .= ' OR '; 15 } 16 17 $run_result .= " owner = " . $_SESSION['userid'] . " "; 13 18 $run_result .= " OR access IN ('PUBLIC', 'LOGGED_IN', 'user" . $_SESSION['userid'] . "') "; 14 19
