Author: Jan Schneider (jan@horde.org)
示例#1
0
文件: Ldap.php 项目: horde/horde
 /**
  * Constructor.
  *
  * @throws Horde_Group_Exception
  */
 public function __construct($params)
 {
     parent::__construct($params);
     $params = array_merge(array('binddn' => '', 'bindpw' => '', 'gid' => 'cn', 'memberuid' => 'memberUid', 'objectclass' => array('posixGroup'), 'newgroup_objectclass' => array('posixGroup')), $params);
     /* Check mandatory parameters. */
     foreach (array('ldap', 'basedn') as $param) {
         if (!isset($params[$param])) {
             throw new Horde_Group_Exception('The \'' . $param . '\' parameter is missing.');
         }
     }
     /* Set Horde_Ldap object. */
     $this->_ldap = $params['ldap'];
     unset($params['ldap']);
     /* Lowercase attribute names. */
     $params['gid'] = Horde_String::lower($params['gid']);
     $params['memberuid'] = Horde_String::lower($params['memberuid']);
     if (!is_array($params['newgroup_objectclass'])) {
         $params['newgroup_objectclass'] = array($params['newgroup_objectclass']);
     }
     foreach ($params['newgroup_objectclass'] as &$objectClass) {
         $objectClass = Horde_String::lower($objectClass);
     }
     /* Generate LDAP search filter. */
     try {
         $this->_filter = Horde_Ldap_Filter::build($params['search']);
     } catch (Horde_Ldap_Exception $e) {
         throw new Horde_Group_Exception($e);
     }
     $this->_params = $params;
 }
示例#2
0
文件: Sql.php 项目: horde/horde
 /**
  * Constructor.
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (!isset($params['db'])) {
         throw new Horde_Group_Exception('The \'db\' parameter is missing.');
     }
     $this->_db = $params['db'];
 }
示例#3
0
文件: Group.php 项目: horde/horde
 /**
  * Constructor.
  *
  * @param integer $permission       The folder permission as provided by
  *                                  Horde.
  * @param string $id                The group id.
  * @param Horde_Group_Base $groups  The horde group handler.
  */
 public function __construct($permission, $id, Horde_Group_Base $groups)
 {
     $this->_horde_id = $id;
     $this->_kolab_id = 'group:' . $groups->getName($id);
     parent::__construct($permission);
 }