Example #1
0
 /**
  * add default users and groups
  * @return void
  */
 protected function setupUsersGroups()
 {
     $groups = array('Administrators', 'Lawyers');
     foreach ($groups as $group) {
         echo "creating group '{$group}' .. ";
         $id = DM\Group::getIdByName($group);
         if (empty($id)) {
             DM\Group::create(array('name' => $group));
         }
         echo "ok\n";
     }
 }
Example #2
0
 /**
  * Retreive a system group id by its name
  * (only everyone left after removing "system" group)
  *
  * @return int
  */
 public static function getSystemGroupId($groupName)
 {
     if (!Cache::exist('group_id_' . $groupName)) {
         $id = DM\Group::getIdByName($groupName);
         Cache::set('group_id_' . $groupName, $id);
     }
     return Cache::get('group_id_' . $groupName);
 }