*/
function checkPerm($lvl, $au)
{
- return $au->hasPerm("Core.".$this->tableName(), $lvl);
+ return $au->hasPerm("Core.Groups", $lvl);
}
function onUpdate($old, $req, $roo)
{
return true;
}
- $pi = DB_DataObject::factory('Person');
+ $pi = DB_DataObject::factory(empty($ff->Pman['authTable']) ? 'Person' : $ff->Pman['authTable']);
$pi->get($this->leader);
$p = DB_DataObject::factory('Group_Members');
}
+
+ function addMember($person)
+ {
+ $gm = DB_Dataobject::factory('Group_Members');
+ $gm->group_id = $this->id;
+ $gm->user_id = $person->id;
+ if (!$gm->count()) {
+ $gm->insert();
+ }
+ }
+
function members()
{
if (!$ids) {
return array();
}
- $p = DB_Dataobject::factory('Person');
+ $p = DB_Dataobject::factory(empty($ff->Pman['authTable']) ? 'Person' : $ff->Pman['authTable']);
$p->whereAdd('id IN ('. implode(',', $ids) .')');
return $p->fetchAll();
}
-
+ function postListFilter($ar, $au, $req)
+ {
+
+ $ret[] = array( 'id' => 0, 'name' => 'EVERYONE');
+ $ret[] = array( 'id' => -1, 'name' => 'NOT_IN_GROUP');
+ return array_merge($ret, $ar);
+ //$ret[] = array( 'id' => 999999, 'name' => 'ADMINISTRATORS');
+
+ }
+
+
}