root/devel/mod/groups/lib/function_access_level_sql_where.php

Revision 1539, 0.5 kB (checked in by renato, 1 year ago)

Setting prop svn:eol-style in LOTS of files.

  • Property svn:mime-type set to text/plain
  • Property svn:eol-style set to native
Line 
1 <?php
2
3     // Returns an SQL "where" clause containing all the access codes that the user can see
4    
5 if (isloggedin()) {
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     if (empty($run_result)) {
14                 $run_result = '';
15             } else {
16                 $run_result .= ' OR ';
17             }
18    
19     $run_result .= " access IN ('group" . implode("', 'group", $groupslist) . "')";
20   }
21  
22  }
23
24 ?>
Note: See TracBrowser for help on using the browser.