inAdmin = false; $t = clone($this); //DB_DataObject::debugLevel(1); $t->joinAdd(DB_DataObject::factory('Groups'), 'LEFT'); //$person->id = (int)$person->id; $t->whereAdd(" user_id = {$person->id} "); $t->selectAdd(); $t->selectAdd('distinct(group_id), Groups.name as name'); $t->find(); $ret = $arrayof == 'group_id' ? array(0) : array(); // default member of 'All groups'!! while ($t->fetch()) { $ret[] = $t->$arrayof; if ($t->name == 'Administrators') { /// mmh... bit risky? $this->inAdmin = true; } } return $ret; } function checkPerm($lvl, $au) { return false; } function fetchAll($k= false) { if ($k !== false) { $this->selectAdd(); $this->selectAdd($k); } $this->find(); $ret = array(); while ($this->fetch()) { $ret[] = $k === false ? clone($this) : $this->$k; } return $ret; } }