diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc
index e7bdf678d109cfd848982d612b0bb4be3f4402de..9aecbccdff2cb3d39578dc59596a449b74e37625 100644 (file)
$message= plugin::check();
/* Permissions for that base? */
$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();
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.");
$message[]= _("Department with that 'Name' already exists.");
} elseif ($this->orig_dn != $this->dn && !($attrs === FALSE)){
$message[]= _("Department with that 'Name' already exists.");
$message[]= sprintf(_("The field 'Name' contains the reserved word '%s'. Please choose another name."),$this->ou);
}
$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)){
$message[]= _("The field 'Name' contains invalid characters.");
}
if (!is_phone_nr($this->telephoneNumber)){
function ShowMoveFrame()
{
$smarty = get_smarty();
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);
$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);
function ShowTagFrame()
{
$smarty = get_smarty();
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);
$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);
{
if(!$OnlySetTagFlag){
$smarty= get_smarty();
{
if(!$OnlySetTagFlag){
$smarty= get_smarty();
- echo "<!-- headers.tpl-->".$smarty->fetch(get_template_path('headers.tpl'));
- echo "<body style='background-image:none;margin:3px;color:black'>";
+
+ /* Print out html introduction */
+ echo ' <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+ <html>
+ <head>
+ <title></title>
+ <style type="text/css">@import url("themes/default/style.css");</style>
+ <script language="javascript" src="include/focus.js" type="text/javascript"></script>
+ </head>
+ <body style="background-image:none;margin:3px;color:black" id="body" >
+ ';
+
echo "<h3>".sprintf(_("Tagging '%s'."),"<i>".@LDAP::fix($this->dn)."</i>")."</h3>";
}
echo "<h3>".sprintf(_("Tagging '%s'."),"<i>".@LDAP::fix($this->dn)."</i>")."</h3>";
}
return;
}
$this->handle_object_tagging($attrs['dn'], $this->gosaUnitTag, TRUE );
return;
}
$this->handle_object_tagging($attrs['dn'], $this->gosaUnitTag, TRUE );
+ echo "<script language=\"javascript\" type=\"text/javascript\">scrollDown2();</script>" ;
}
}
if(!$OnlySetTagFlag){
}
}
if(!$OnlySetTagFlag){
/* Print header to have styles included */
$smarty= get_smarty();
/* Print header to have styles included */
$smarty= get_smarty();
- echo "<!-- headers.tpl-->".$smarty->fetch(get_template_path('headers.tpl'));
- echo "<body style='background-image:none;margin:3px;color:black'>";
- echo "<h3>".sprintf(_("Moving '%s' to '%s'"),"<i>".@LDAP::fix($src_dn)."</i>","<i>".@LDAP::fix($dst_dn)."</i>")."</h3>";
+ /* Print out html introduction */
+ echo ' <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+ <html>
+ <head>
+ <title></title>
+ <style type="text/css">@import url("themes/default/style.css");</style>
+ <script language="javascript" src="include/focus.js" type="text/javascript"></script>
+ </head>
+ <body style="background: none; margin:4px;" id="body" >
+ ';
+ echo "<h3>".sprintf(_("Moving '%s' to '%s'"),"<i>".@LDAP::fix($src_dn)."</i>","<i>".@LDAP::fix($dst_dn)."</i>")."</h3>";
/* Check if the destination entry exists */
$ldap= $this->config->get_ldap_link();
/* Check if the destination entry exists */
$ldap= $this->config->get_ldap_link();
/* Copy objects from small to big indent levels by replacing src_dn by dst_dn */
foreach ($objects as $object => $len){
/* 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 "<b>"._("Object").":</b> ".@LDAP::fix($src)."<br>";
$src= str_replace("\\","\\\\",$object);
$dst= preg_replace("/".str_replace("\\","\\\\",$src_dn)."$/", "$dst_dn", $object);
$dst= str_replace($src_dn,$dst_dn,$object);
echo "<b>"._("Object").":</b> ".@LDAP::fix($src)."<br>";
- if (!$this->copy($src, $dst)){
+ if (!$this->copy($src, $dst)){
echo "<font color='#FF0000'><br>".sprintf(_("FAILED to copy %s, aborting operation"),@LDAP::fix($src))."</font>";
return (FALSE);
}
echo "<font color='#FF0000'><br>".sprintf(_("FAILED to copy %s, aborting operation"),@LDAP::fix($src))."</font>";
return (FALSE);
}
+ echo "<script language=\"javascript\" type=\"text/javascript\">scrollDown2();</script>" ;
flush();
}
flush();
}
<br><input type='submit' name='back' value='"._("Continue")."'>
</form></div>";
<br><input type='submit' name='back' value='"._("Continue")."'>
</form></div>";
+ echo "<script language=\"javascript\" type=\"text/javascript\">scrollDown2();</script>" ;
echo "</body></html>";
return (TRUE);
echo "</body></html>";
return (TRUE);