X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fdepartments%2Fclass_departmentGeneric.inc;h=9aecbccdff2cb3d39578dc59596a449b74e37625;hb=206abcab698395b6c61297782e8c304c4e77dc56;hp=e7bdf678d109cfd848982d612b0bb4be3f4402de;hpb=3d426e35a690a98d8ea12a40a13024b31046933c;p=gosa.git diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index e7bdf678d..9aecbccdf 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -214,15 +214,14 @@ class department extends plugin $message= plugin::check(); /* Permissions for that base? */ - // $this->dn= "ou=$this->ou,".$this->base; if (chkacl($this->acl, "create") != ""){ $message[]= _("You have no permissions to create a department on this 'Base'."); } /* Check for presence of this department */ $ldap= $this->config->get_ldap_link(); - $attrs= $ldap->cat ($this->dn, array('dn')); - if ($this->orig_dn == "new" && !($attrs === FALSE)){ + $ldap->ls ("(&(ou=".$this->ou.")(objectClass=organizationalUnit))", $this->base, array('dn')); + if ($this->orig_dn == "new" && $ldap->count()){ $message[]= _("Department with that 'Name' already exists."); } elseif ($this->orig_dn != $this->dn && !($attrs === FALSE)){ $message[]= _("Department with that 'Name' already exists."); @@ -240,7 +239,7 @@ class department extends plugin $message[]= sprintf(_("The field 'Name' contains the reserved word '%s'. Please choose another name."),$this->ou); } - if (preg_match ('/[#+:=>\\\\\/]/', $this->ou)){ + if (preg_match ('/["+>\\\\]/', $this->ou)){ $message[]= _("The field 'Name' contains invalid characters."); } if (!is_phone_nr($this->telephoneNumber)){ @@ -348,7 +347,7 @@ class department extends plugin function ShowMoveFrame() { $smarty = get_smarty(); - $smarty->assign("src","?plug=".$_GET['plug']."&PerformRecMove"); + $smarty->assign("src","?plug=".$_GET['plug']."&PerformRecMove"); $smarty->assign("message","As soon as the move operation has finished, you can scroll down to end of the page and press the 'Continue' button to continue with the department management dialog."); $display= $smarty->fetch(get_template_path("dep_iframe.tpl",TRUE)); return($display); @@ -357,7 +356,7 @@ class department extends plugin function ShowTagFrame() { $smarty = get_smarty(); - $smarty->assign("src","?plug=".$_GET['plug']."&TagDepartment"); + $smarty->assign("src","?plug=".$_GET['plug']."&TagDepartment"); $smarty->assign("message","As soon as the tag operation has finished, you can scroll down to end of the page and press the 'Continue' button to continue with the department management dialog."); $display= $smarty->fetch(get_template_path("dep_iframe.tpl",TRUE)); return($display); @@ -368,8 +367,18 @@ class department extends plugin { if(!$OnlySetTagFlag){ $smarty= get_smarty(); - echo "".$smarty->fetch(get_template_path('headers.tpl')); - echo ""; + + /* Print out html introduction */ + echo ' + + + + + + + + '; + echo "

".sprintf(_("Tagging '%s'."),"".@LDAP::fix($this->dn)."")."

"; } @@ -413,6 +422,7 @@ class department extends plugin return; } $this->handle_object_tagging($attrs['dn'], $this->gosaUnitTag, TRUE ); + echo "" ; } } if(!$OnlySetTagFlag){ @@ -445,11 +455,19 @@ class department extends plugin /* Print header to have styles included */ $smarty= get_smarty(); - echo "".$smarty->fetch(get_template_path('headers.tpl')); - echo ""; - echo "

".sprintf(_("Moving '%s' to '%s'"),"".@LDAP::fix($src_dn)."","".@LDAP::fix($dst_dn)."")."

"; + /* Print out html introduction */ + echo ' + + + + + + + + '; + echo "

".sprintf(_("Moving '%s' to '%s'"),"".@LDAP::fix($src_dn)."","".@LDAP::fix($dst_dn)."")."

"; /* Check if the destination entry exists */ $ldap= $this->config->get_ldap_link(); @@ -478,19 +496,18 @@ class department extends plugin /* Copy objects from small to big indent levels by replacing src_dn by dst_dn */ foreach ($objects as $object => $len){ - - $src= str_replace("\\","\\\\",$object); $dst= preg_replace("/".str_replace("\\","\\\\",$src_dn)."$/", "$dst_dn", $object); $dst= str_replace($src_dn,$dst_dn,$object); echo ""._("Object").": ".@LDAP::fix($src)."
"; - if (!$this->copy($src, $dst)){ + if (!$this->copy($src, $dst)){ echo "
".sprintf(_("FAILED to copy %s, aborting operation"),@LDAP::fix($src))."
"; return (FALSE); } + echo "" ; flush(); } @@ -506,6 +523,7 @@ class department extends plugin
"; + echo "" ; echo ""; return (TRUE);