config->get_ldap_link(); $ldap->ls ("(&(c=".$this->c.")(objectClass=country))", $this->base, array('dn')); if ($this->orig_c == "new" && $ldap->count()){ $message[]= msgPool::duplicated(_("Name")); } elseif ($this->orig_dn != $this->dn && $ldap->count()){ $message[]= msgPool::duplicated(_("Name")); } /* All required fields are set? */ if ($this->c == ""){ $message[]= msgPool::required(_("Name")); }elseif(tests::is_department_name_reserved($this->c,$this->base)){ $message[]= msgPool::reserved(_("Name")); }elseif(preg_match ('/[#+:=>\\\\\/]/', $this->c)){ $message[]= msgPool::invalid(_("Name"), $this->c, "/[^#+:=>\\\\\/]/"); } /* Check description */ if ($this->description == ""){ $message[]= msgPool::required(_("Description")); } /* Check if we are allowed to create or move this object */ if($this->orig_dn == "new" && !$this->acl_is_createable($this->base)){ $message[] = msgPool::permCreate(); }elseif($this->orig_dn != "new" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){ $message[] = msgPool::permMove(); } return($message); } /* Return plugin informations for acl handling */ static function plInfo() { return (array( "plShortName" => _("Country"), "plDescription" => _("Country"), "plSelfModify" => FALSE, "plPriority" => 2, "plDepends" => array(), "plSection" => array("admin"), "plCategory" => array("department"), "plProvidedAcls" => array( "c" => _("Country name"), "description" => _("Description"), "base" => _("Base"), "gosaUnitTag" => _("Administrative settings")) )); } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>