Copyright 2008-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Gunnar Wrobel (wrobel@pardus.de)
Inheritance: extends Horde_Kolab_Server_Object_Inetorgperson
 /**
  * Test ID generation for a person.
  *
  * @return NULL
  */
 public function testGenerateId()
 {
     foreach ($this->servers as $server) {
         $a = new Horde_Kolab_Server_Object_Kolabinetorgperson($server, null, $this->objects[0]);
         $this->assertContains('Frank Mustermann', $a->get(Horde_Kolab_Server_Object_Person::ATTRIBUTE_UID));
     }
 }
Exemple #2
0
 /**
  * Convert the object attributes to a hash.
  *
  * @param string $attrs The attributes to return.
  *
  * @return array|PEAR_Error The hash representing this object.
  */
 public function toHash($attrs = null)
 {
     if (!isset($attrs)) {
         $attrs = array(self::ATTRIBUTE_LNFN);
     }
     return parent::toHash($attrs);
 }
Exemple #3
0
 /**
  * Saves object information.
  *
  * @param array $info The information about the object.
  *
  * @return boolean|PEAR_Error True on success.
  */
 public function save(array $info)
 {
     $admin_group = new Horde_Kolab_Server_Object_Kolabgroupofnames($this->server, null, $this->required_group);
     $save_result = parent::save($info);
     if (!$admin_group->exists()) {
         $data = array_merge($this->required_group, array(Horde_Kolab_Server_Object_Kolabgroupofnames::ATTRIBUTE_MEMBER => array($this->uid)));
     } else {
         $result = $admin_group->isMember($this->uid);
         if ($result === false) {
             $members = $admin_group->getMembers();
             $members[] = $this->uid;
             $data = array(Horde_Kolab_Server_Object_Kolabgroupofnames::ATTRIBUTE_MEMBER => $members);
         } else {
             $data = null;
         }
     }
     if (!empty($data)) {
         return $admin_group->save($data);
     }
     return $save_result;
 }
Exemple #4
0
 /**
  * Convert the object attributes to a hash.
  *
  * @param string $attrs The attributes to return.
  *
  * @return array|PEAR_Error The hash representing this object.
  */
 public function toHash($attrs = null)
 {
     if (!isset($attrs)) {
         $attrs = array(self::ATTRIBUTE_SID, self::ATTRIBUTE_FN, self::ATTRIBUTE_MAIL, self::ATTRIBUTE_USERTYPE);
     }
     return parent::toHash($attrs);
 }