From 2b3b845efed3e8cba2ec1fb3c2162807e998c23e Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 22 Jan 2007 09:48:54 +0000 Subject: [PATCH] Some fixes for trunk from 2.5 5377 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5587 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiHook.inc | 3 ++- plugins/admin/fai/class_faiPartitionTableEntry.inc | 3 ++- plugins/admin/fai/class_faiScript.inc | 3 ++- plugins/admin/fai/class_faiTemplate.inc | 3 ++- plugins/admin/fai/faiNewBranch.tpl | 2 ++ plugins/admin/groups/class_groupApplication.inc | 2 +- plugins/admin/groups/class_groupMail.inc | 4 ++-- plugins/admin/ogroups/class_ogroupManagement.inc | 2 +- plugins/admin/systems/class_printGeneric.inc | 13 +++++++++++++ plugins/admin/systems/class_terminalGeneric.inc | 7 ++++--- plugins/admin/systems/class_terminalStartup.inc | 4 +++- plugins/admin/systems/class_workstationStartup.inc | 5 +++++ plugins/gofon/macro/class_divListMacros.inc | 2 +- plugins/personal/mail/class_mailAccount.inc | 1 + plugins/personal/mail/copypaste.tpl | 2 +- plugins/personal/posix/class_posixAccount.inc | 3 ++- 16 files changed, 44 insertions(+), 15 deletions(-) diff --git a/plugins/admin/fai/class_faiHook.inc b/plugins/admin/fai/class_faiHook.inc index 926ce5dda..9fdb2b15d 100644 --- a/plugins/admin/fai/class_faiHook.inc +++ b/plugins/admin/fai/class_faiHook.inc @@ -184,7 +184,8 @@ class faiHook extends plugin if(preg_match("/d/",$acl)){ $once = false; - if(($this->SubObjects[$entry]['status'] == "edited")||($this->SubObjects[$entry]['status'] == "FreshLoaded")){ + $status = $this->SubObjects[$entry]['status']; + if($status == "edited" || $status == "FreshLoaded"){ $this->SubObjects[$entry]['status']= "delete"; }else{ unset($this->SubObjects[$entry]); diff --git a/plugins/admin/fai/class_faiPartitionTableEntry.inc b/plugins/admin/fai/class_faiPartitionTableEntry.inc index 9122d6c3c..110fa50c3 100644 --- a/plugins/admin/fai/class_faiPartitionTableEntry.inc +++ b/plugins/admin/fai/class_faiPartitionTableEntry.inc @@ -123,7 +123,8 @@ class faiPartitionTableEntry extends plugin */ if($s_action == "remove" && $this->acl_is_removeable()){ if($this->partitions[$s_entry]['status'] == "edited"){ - $this->deletePartitions[]= $this->partitions[$s_entry]; + $this->deletePartitions[$s_entry]= $this->partitions[$s_entry]; + $this->deletePartitions[$s_entry]['FAIpartitionNr']=$s_entry; unset($this->partitions[$s_entry]); }else{ unset($this->partitions[$s_entry]); diff --git a/plugins/admin/fai/class_faiScript.inc b/plugins/admin/fai/class_faiScript.inc index 20779ea1b..c130a568d 100644 --- a/plugins/admin/fai/class_faiScript.inc +++ b/plugins/admin/fai/class_faiScript.inc @@ -195,7 +195,8 @@ class faiScript extends plugin /* Check acls, are we allowed to delete an entry */ $acl = $this->ui->get_permissions($this->acl_base_for_current_object($this->SubObjects[$entry]['dn']),"fai/faiScriptEntry") ; if(preg_match("/d/",$acl)){ - if(($this->SubObjects[$entry]['status'] == "edited")||($this->SubObjects[$entry]['status'] == "FreshLoaded")){ + $status = $this->SubObjects[$entry]['status']; + if($status == "edited" || $status == "FreshLoaded"){ $this->SubObjects[$entry]['status']= "delete"; }else{ unset($this->SubObjects[$entry]); diff --git a/plugins/admin/fai/class_faiTemplate.inc b/plugins/admin/fai/class_faiTemplate.inc index 968561d7e..83d556da9 100644 --- a/plugins/admin/fai/class_faiTemplate.inc +++ b/plugins/admin/fai/class_faiTemplate.inc @@ -161,7 +161,8 @@ class faiTemplate extends plugin $acl_dn = $this->acl_base_for_current_object($obj['dn']); $acl = $this->ui->get_permissions($acl_dn,"fai/faiTemplateEntry"); if(preg_match("/d/",$acl)){ - if(($this->SubObjects[$entry]['status'] == "edited")||($this->SubObjects[$entry]['status'] == "FreshLoaded")){ + $status = $this->SubObjects[$entry]['status']; + if($status == "edited" || $status == "FreshLoaded"){ $this->SubObjects[$entry]['status']= "delete"; }else{ unset($this->SubObjects[$entry]); diff --git a/plugins/admin/fai/faiNewBranch.tpl b/plugins/admin/fai/faiNewBranch.tpl index e9afc27a2..725cf1f53 100755 --- a/plugins/admin/fai/faiNewBranch.tpl +++ b/plugins/admin/fai/faiNewBranch.tpl @@ -4,6 +4,8 @@

{t}You are now going to create a branch or locked branch. This action clones the existing release to another release name. Branches can be modified as usual. FAI classes of locked branches cannot be modified, just additional classes are possible. Branch names should be alphanumeric, excluding the reserved names 'scripts', 'hooks', 'partitions', 'variables', 'templates' and 'fai'.{/t}
+{t}Branches are created as subreleases of the currently selected branch. Creating a new branch named 1.0.2 in SARGE for example, will result in a new release called SARGE/1.0.2.{/t} +

diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc index 6a7b0be19..eb8363ae7 100644 --- a/plugins/admin/groups/class_groupApplication.inc +++ b/plugins/admin/groups/class_groupApplication.inc @@ -995,7 +995,7 @@ class appgroup extends plugin /* Special handling for release managed apps */ $tmp = search_config($this->config->data,"faiManagement","CLASS"); - if(!empty($tmp)){ + if(!empty($tmp) && count($this->Releases)){ $this->enableReleaseManagement = true; /* Check if release is available */ diff --git a/plugins/admin/groups/class_groupMail.inc b/plugins/admin/groups/class_groupMail.inc index b6c8c01f8..4cf7a73fd 100644 --- a/plugins/admin/groups/class_groupMail.inc +++ b/plugins/admin/groups/class_groupMail.inc @@ -349,8 +349,8 @@ class mailgroup extends plugin } $display .= "

Shared folder delete options

"; - $display .= _("Remove the shared folder and all its contents from mail server."); + title='"._("Remove shared folder from mail server database when entry gets removed in LDAP")."'>"; + $display .= _("Remove the shared folder and all its contents after saving this account"); } return ($display); } diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index 82c47d2fa..df051b473 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -273,7 +273,7 @@ class ogroupManagement extends plugin ****************/ /* Cancel dialogs */ - if (isset($_POST['edit_cancel'])){ + if ((isset($_POST['edit_cancel'])) && (isset($this->ogroup->dn))){ del_lock ($this->ogroup->dn); unset ($this->ogroup); $this->ogroup= NULL; diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 9457f8e02..cb43e6a85 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -795,6 +795,11 @@ class printgeneric extends plugin } } + /* Ensure to create a new object */ + if(preg_match("/ou=incoming,/",$this->orig_dn)){ + $this->orig_dn = "new"; + } + /* Move object in necessary*/ if (($this->orig_dn != $this->dn) && ($this->orig_dn != 'new')){ $this->move($this->orig_dn, $this->dn); @@ -807,6 +812,14 @@ class printgeneric extends plugin $ldap->cd($this->config->current['BASE']); $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn)); $ldap->cd($this->dn); + + /* Remove empty values */ + foreach($this->attrs as $name => $value){ + if(empty($value)){ + unset($this->attrs[$name]); + } + } + $ldap->add($this->attrs); $this->handle_post_events("add"); } else { diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index e20d353c0..0495e0bda 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -384,9 +384,10 @@ class termgeneric extends plugin $this->netConfigDNS->save_object(); /* Save terminal path to parent since it is used by termstartup, too */ - $this->parent->by_object['termstartup']->gotoTerminalPath= - $this->gotoTerminalPath; - + if(isset($this->parent->by_object['termstartup'])){ + $this->parent->by_object['termstartup']->gotoTerminalPath= $this->gotoTerminalPath; + } + if(isset($_POST['termgeneric_posted'])){ if(isset($_POST["inheritTimeServer"])){ $this->inheritTimeServer = true; diff --git a/plugins/admin/systems/class_terminalStartup.inc b/plugins/admin/systems/class_terminalStartup.inc index 4b30c443e..ddf9c4836 100644 --- a/plugins/admin/systems/class_terminalStartup.inc +++ b/plugins/admin/systems/class_terminalStartup.inc @@ -369,7 +369,9 @@ class termstartup extends plugin $this->attrs["$val"]= array_unique($this->$val); } - if(!isset($this->attrs["$val"])) $this->attrs["$val"]=array(); + if(!isset($this->attrs["$val"])){ + $this->attrs["$val"]=array(); + } } /* Strip out 'default' values */ diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index 56192c9bf..3c5875527 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -362,6 +362,11 @@ class workstartup extends plugin if(count($this->FAIclass)==0 && $this->FAIrelease == ""){ $this->FAIdebianMirror = "inherited"; } + + /* Turn to default, if we've nothing to inherit */ + if (!isset($this->gotoBootKernels['default-inherited']) && $this->gotoBootKernel == "default-inherited"){ + $this->gotoBootKernel= "default"; + } } diff --git a/plugins/gofon/macro/class_divListMacros.inc b/plugins/gofon/macro/class_divListMacros.inc index cb88a7e33..0a78660d2 100755 --- a/plugins/gofon/macro/class_divListMacros.inc +++ b/plugins/gofon/macro/class_divListMacros.inc @@ -49,7 +49,7 @@ class divListMacro extends MultiSelectWindow /* set Page header */ $this->AddHeader(array("string" => " ", "attach" => "style='text-align:center;width:20px;'")); - $this->AddHeader(array("string" => _("macro name")." / "._("Department"), "attach" => "style=''")); + $this->AddHeader(array("string" => _("Macro name")." / "._("Department"), "attach" => "style=''")); $this->AddHeader(array("string" => _("Visible"), "attach" => "style='width:50px;'")); $this->AddHeader(array("string" => _("Actions"), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'" )); diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index 7e19daef7..a1a60c50a 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -889,6 +889,7 @@ class mailAccount extends plugin /* Is this address already assigned in LDAP? */ $ldap->cd ($this->config->current['BASE']); $ldap->search ("(&(objectClass=gosaMailAccount)(|(mail=$address)"."(gosaMailAlternateAddress=$address)))", array("uid")); + $ldap->search ("(&(!(objectClass=gosaUserTemplate))(objectClass=gosaMailAccount)(|(mail=$address)"."(gosaMailAlternateAddress=$address)))", array("uid")); if ($ldap->count() > 0){ $attrs= $ldap->fetch (); diff --git a/plugins/personal/mail/copypaste.tpl b/plugins/personal/mail/copypaste.tpl index f8791111e..56ec107ff 100644 --- a/plugins/personal/mail/copypaste.tpl +++ b/plugins/personal/mail/copypaste.tpl @@ -1,7 +1,7 @@

{t}Mail settings{/t}

-
+ diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index de4160a84..427add565 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -801,7 +801,7 @@ class posixAccount extends plugin /* Fill gecos */ if (isset($this->parent) && $this->parent != NULL){ $this->gecos= rewrite($this->parent->by_object['user']->cn); - if (!preg_match('/[a-z0-9 -]/i', $this->gecos)){ + if (!preg_match('/^[a-z0-9 -]+$/i', $this->gecos)){ $this->gecos= ""; } } @@ -1100,6 +1100,7 @@ class posixAccount extends plugin $date= getdate(); $val= floor($date[0] / (60*60*24)) * 60 * 60 * 24; } + return($val); } -- 2.30.2
{$must}