Code

Some fixes for trunk from 2.5
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Jan 2007 09:48:54 +0000 (09:48 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Jan 2007 09:48:54 +0000 (09:48 +0000)
5377

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5587 594d385d-05f5-0310-b6e9-bd551577e9d8

16 files changed:
plugins/admin/fai/class_faiHook.inc
plugins/admin/fai/class_faiPartitionTableEntry.inc
plugins/admin/fai/class_faiScript.inc
plugins/admin/fai/class_faiTemplate.inc
plugins/admin/fai/faiNewBranch.tpl
plugins/admin/groups/class_groupApplication.inc
plugins/admin/groups/class_groupMail.inc
plugins/admin/ogroups/class_ogroupManagement.inc
plugins/admin/systems/class_printGeneric.inc
plugins/admin/systems/class_terminalGeneric.inc
plugins/admin/systems/class_terminalStartup.inc
plugins/admin/systems/class_workstationStartup.inc
plugins/gofon/macro/class_divListMacros.inc
plugins/personal/mail/class_mailAccount.inc
plugins/personal/mail/copypaste.tpl
plugins/personal/posix/class_posixAccount.inc

index 926ce5ddaca39699bad3aa88c7acaeb1044f15b5..9fdb2b15de0f1c98dc14f1ceab8470efb0b317e9 100644 (file)
@@ -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]);
index 9122d6c3ced763b02d45607435addbdce7b0e17e..110fa50c35d92663a40203e0ae90149373e4b986 100644 (file)
@@ -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]);
index 20779ea1ba8f2a1da9a55a698520797265ed6049..c130a568d6cba899f26716d82ed72edf824ce727 100644 (file)
@@ -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]);
index 968561d7ee613794043a01229821c00352141fdc..83d556da9e6dcd4bb35f1892e8cd9dc24ea57071 100644 (file)
@@ -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]);
index e9afc27a21b00636a182c1c530993e79990098fb..725cf1f53bd764798a1656b524dae0578fc7e756 100755 (executable)
@@ -4,6 +4,8 @@
 <p class="seperator">
 {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}
 <br>
+{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}
+ <br>
 <br>
 </p>
 <p class="seperator">
index 6a7b0be19a777dead8a395f255dfe38e08eb53b0..eb8363ae785f4869c2362bc69f4afe2e63fd3b04 100644 (file)
@@ -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 */
index b6c8c01f8ba1087bd481910f7fd340f7d0405371..4cf7a73fd1019816eb706b00655e07be8fd33223 100644 (file)
@@ -349,8 +349,8 @@ class mailgroup extends plugin
           }
           $display .= "<h2>Shared folder delete options</h2>
                        <input class='center' type='checkbox' name='remove_folder_from_imap' value='1' ".$c."
-                          title='"._("Remove shared folder from mail server database")."'>";
-          $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);
       }
index 82c47d2fa61869b7288c466c5cfeb238e4811732..df051b4733936b8b2bb21eee776e581dc8eb9ed5 100644 (file)
@@ -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;
index 9457f8e029ecf9c302cc4dd42476639aadd466f9..cb43e6a85319bdf6cd285c0e9cf9b702bd65a10d 100644 (file)
@@ -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 {
index e20d353c0db292e84378157d54752a316f058252..0495e0bda05e9b6389971045a8efa60eb1426df2 100644 (file)
@@ -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;
index 4b30c443e80531d05dfefd003acdaa04ddeb87e7..ddf9c48365170d707b3627aef5716d7a449d658c 100644 (file)
@@ -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 */
index 56192c9bfe0fa5e7c2d793b50ad6fa3ba5c85e35..3c587552768ecf594a36000acaafaf6775eed7c2 100644 (file)
@@ -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";
+    }
   }
 
   
index cb88a7e33f20bf4892e4b89c2da45d77a1e2db7a..0a78660d299b0b8f198531f7f2460be52c131fa6 100755 (executable)
@@ -49,7 +49,7 @@ class divListMacro extends MultiSelectWindow
 
     /* set Page header */
     $this->AddHeader(array("string" => "&nbsp;", "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;'" ));
 
index 7e19daef7c9faaafd3daa1496e55ce4f9095263d..a1a60c50a8ec4bb6e9cd6f332146ce276756a578 100644 (file)
@@ -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 ();
index f8791111efdd766f19111f37a8251472c9e2a682..56ec107ff1b6b7cb62395580acd7793cd4c466a7 100644 (file)
@@ -1,7 +1,7 @@
 <h2>{t}Mail settings{/t}</h2>
 <table style='width:100%;' cellspacing=0>
        <tr>
-               <td style='width:50%;vertical-align:top;'>
+               <td style='width:50%;vertical-align:top; border-right:1px solid #AAA'>
                        <table style="width:100%;">
                                <tr>
                                        <td><label for="mail">{t}Primary address{/t}</label>{$must}</td>
index de4160a841edf240afdbefbf7654c3520db4649d..427add565164f9da0e8d660260b099ada6550389 100644 (file)
@@ -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);
   }