Пример #1
0
 function getAll() {
     SecurityGroup::requirePermission("VIEW");
     $sql = "SELECT * from security_group";
     $result = Database::query($sql);
     $groups = array();
     while($line = $result->next()) {
         array_push($groups, SecurityGroup::build($line));
     }
     return $groups;
 }
Пример #2
0
 function getGroups()
 {
     $id = $this->id;
     $sql = "SELECT security_group.* from security_group, security_group_member WHERE security_group.id = security_group_member.group_id AND security_group_member.user_id = " . Database::sqlValue($id);
     $result = Database::query($sql);
     $groups = array();
     while ($line = $result->next()) {
         array_push($groups, SecurityGroup::build($line));
     }
     return $groups;
 }