示例#1
0
 /**
  * Add a group to the database
  *
  * @access public
  * @param  string  name of group
  * @param  boolean description of group
  * @param  boolean activate group?
  * @param  integer owner_user_id of group
  * @param  integer owner_group_id of group
  * @param  array  Array of custom fields to be added
  * @return mixed integer (group_id) or DB Error object
  */
 function addGroup($group_name, $group_description = null, $active = false, $owner_user = null, $owner_group = null, $customFields = array())
 {
     $owner_user === null ? $owner_user = '******' : ($owner_user = (int) $owner_user);
     $owner_group === null ? $owner_group = 'null' : ($owner_group = (int) $owner_group);
     $customFields[] = array('name' => 'owner_user_id', 'value' => $owner_user);
     $customFields[] = array('name' => 'owner_group_id', 'value' => $owner_group);
     $group_id = parent::addGroup($group_name, $group_description, $active, $customFields);
     return $group_id;
 }
示例#2
0
 /**
  * Add a group to the database
  *
  * @access public
  * @param  string  name of group
  * @param  string description of group
  * @param  boolean activate group?
  * @param  integer group type (one of LIVEUSER_GROUP_TYPE_*)
  * @param  string define name for the group
  * @param  integer owner_user_id of group
  * @param  integer owner_group_id of group
  * @param  array custom fields array => 'name'=>array('value'=>'foo'))
  * @return mixed integer (group_id) or DB Error object
  */
 function addGroup($group_name, $group_description = null, $active = false, $define_name = null, $group_type = null, $owner_user = null, $owner_group = null, $customFields = array())
 {
     is_null($owner_user) ? $owner_user = '******' : ($owner_user = (int) $owner_user);
     is_null($owner_group) ? $owner_group = 'NULL' : ($owner_group = (int) $owner_group);
     $customFields['owner_user_id'] = array('value' => $owner_user);
     $customFields['owner_group_id'] = array('value' => $owner_group);
     $group_id = parent::addGroup($group_name, $group_description, $active, $define_name, $group_type, $customFields);
     return $group_id;
 }