diff --git a/trunk/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/trunk/gosa-plugins/fai/admin/fai/class_faiTemplate.inc
index 5e60e4f80637dd160e17a549b9fe593fac43ad55..10c0bd69c5f8a31266939359b8ba5cb8af4c9aea 100644 (file)
/* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry)
*/
- $res = FAI::get_all_objects_for_given_base($this->dn,"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))");
+ $res = FAI::get_leaf_objects($this->dn, $this->cn, $this->subClass, get_ou('faiTemplateRDN'));
foreach($res as $obj){
-
- /* Skip not relevant objects */
- if(!preg_match("/".preg_quote($this->dn, '/')."$/i",$obj['dn'])) continue;
-
$objects = array();
$objects['status'] = "FreshLoaded";
$objects['dn'] = $obj['dn'];
/* Add new sub object */
if(isset($_POST['AddSubObject']) && !preg_match("/freeze/",$this->FAIstate)){
- $acl_dn = "cn=dummy,".$this->acl_base_for_current_object($this->dn);
+ $acl_dn = $this->acl_base_for_current_object($this->dn);
$acl = $this->ui->get_permissions($acl_dn,"fai/faiTemplateEntry");
if(preg_match("/c/",$acl)){
}
}
+ if (preg_match("/^-/", $this->cn)) {
+ $message[] = sprintf(_("The specified classname '%s' is invalid. Classnames must not start with a dash."), $this->cn);
+ }
+
+ if($this->cn != preg_replace("/ /","",trim($this->cn))){
+ $message[] = msgPool::invalid(_("Name"),preg_replace("/ /","_",$this->cn),"/[^_]/");
+ }
+
return ($message);
}
}
/* Tag object */
- $this->tag_attrs($tmp, $sub_dn, $this->gosaUnitTag);
+ $ui= get_userinfo();
+ $this->tag_attrs($tmp, $sub_dn, $ui->gosaUnitTag);
if($obj['status'] == "delete"){
FAI::prepare_to_save_FAI_object($sub_dn,array(),true);
/* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry)
*/
- $res = FAI::get_all_objects_for_given_base($source['dn'],"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))");
+ $res = FAI::get_leaf_objects($source['dn'], $source['cn'][0], $this->subClass, get_ou('faiTemplateRDN'));
foreach($res as $obj){
-
- /* Skip not relevant objects */
- if(!preg_match("/".preg_quote($source['dn'], '/')."$/i",$obj['dn'])) continue;
-
$objects = array();
$objects['status'] = "edited";
$objects['dn'] = $obj['dn'];