Code

Added skip to plugins
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 31 Mar 2008 13:01:15 +0000 (13:01 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 31 Mar 2008 13:01:15 +0000 (13:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10088 594d385d-05f5-0310-b6e9-bd551577e9d8

12 files changed:
gosa-plugins/connectivity/personal/connectivity/class_connectivity.inc
gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc
gosa-plugins/gofon/gofon/macro/class_gofonMacroManagement.inc
gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc
gosa-plugins/goto/admin/applications/class_applicationManagement.inc
gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc
gosa-plugins/kolab/personal/connectivity/kolab/class_kolabAccount.inc
gosa-plugins/mail/admin/groups/mail/class_groupMail.inc
gosa-plugins/mail/personal/mail/class_mailAccount.inc
gosa-plugins/samba/personal/samba/class_sambaAccount.inc
gosa-plugins/scalix/personal/scalix/class_scalixAccount.inc
gosa-plugins/systems/admin/systems/class_systemManagement.inc

index c3669ae081415d1be566f8a44d191fb0c3d2041e..7da84e1b87e16f2d301568b1ea4992435cda8a44 100644 (file)
@@ -170,12 +170,12 @@ class connectivity extends plugin
     }
   }
 
-  function adapt_from_template($dn)
+  function adapt_from_template($dn, $skip= array())
   {
     /* Adapt objects */
     foreach ($this->plugin_name as $name){
       $this->plugin[$name]->dn= $this->dn;
-      $this->plugin[$name]->adapt_from_template($dn);
+      $this->plugin[$name]->adapt_from_template($dn, $skip);
     }
   }
 
index c8835201944aaf70c9856a4070ae7b0908ef8121..d73f6fc02c6158fadaa32dd8fc31eec89c9c2c77 100644 (file)
@@ -800,13 +800,17 @@ class gofaxAccount extends plugin
 
 
   /* Adapt from template, using 'dn' */
-  function adapt_from_template($dn)
+  function adapt_from_template($dn, $skip= array())
   {
-    plugin::adapt_from_template($dn);
+    plugin::adapt_from_template($dn, $skip);
 
     foreach (array("goFaxRBlocklist", "goFaxRBlockgroups", "goFaxSBlocklist",
           "goFaxSBlockgroups", "facsimileAlternateTelephoneNumber") as $val){
 
+      if (in_array($val, $skip)){
+        continue();
+      }
+
       if (isset($this->attrs[$val])){
         $this->$val= $this->attrs[$val];
       }
index aa51a7ee836200c747158643c566baa05d8bfd7b..da165669290e1518bbf1fc8dc3d8b5ef4574b02b 100644 (file)
@@ -544,7 +544,7 @@ class goFonMacro extends plugin
   }
 
 
-  function adapt_from_template($dn)  { }
+  function adapt_from_template($dn, $skip= array())  { }
   function check() { }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 70af9a0ee50089292f8d73d1647916f88d383882..33ea306b51f75e1def6e41e3780e510f9e37e09e 100644 (file)
@@ -1292,12 +1292,12 @@ class phoneAccount extends plugin
   }
 
 
-  function adapt_from_template($dn)
+  function adapt_from_template($dn, $skip= array())
   {
-    plugin::adapt_from_template($dn);
+    plugin::adapt_from_template($dn, $skip);
 
     /* Assemble phone numbers */
-    if (isset($this->attrs['telephoneNumber'])){
+    if (isset($this->attrs['telephoneNumber']) && !in_array("telephoneNumber", $skip)){
       for ($i= 0; $i<$this->attrs['telephoneNumber']['count']; $i++){
         $number= $this->attrs['telephoneNumber'][$i];
         $this->phoneNumbers[$number]= $number;
index f30035e8955d68a8ece0807463282df2627cfcc0..31483740235a8ed30e390a64e2e97af0b059d1f8 100644 (file)
@@ -633,7 +633,7 @@ class applicationManagement extends plugin
   }
 
   function check() {}
-  function adapt_from_template($dn) {}
+  function adapt_from_template($dn, $skip= array()) {}
   function password_change_needed() {}
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 3fb57bebaabb1398f54e5f114ec2707e48591d6a..34b2268112f10f7fd7b4f7fc1262dfde41b52a28 100644 (file)
@@ -651,7 +651,7 @@ class mimetypeManagement extends plugin
   }
 
   function check() {}
-  function adapt_from_template($dn) {}
+  function adapt_from_template($dn, $skip= array()) {}
   function password_change_needed() {}
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index f40df83aef3924d8aeca99f1e09ecf88effa455e..640abf3c34e7a865e08df7ede2922a4816dcd759 100644 (file)
@@ -614,17 +614,22 @@ class kolabAccount extends plugin
   }
 
   /* Adapt from template, using 'dn' */
-  function adapt_from_template($dn)
+  function adapt_from_template($dn, $skip= array())
   {
-    plugin::adapt_from_template($dn);
+    plugin::adapt_from_template($dn, $skip);
 
     /* Setting uid to default */
-    if(isset($this->attrs['uid'][0])){
+    if(isset($this->attrs['uid'][0]) && !in_array("uid", $skip)){
       $this->uid = $this->attrs['uid'][0];
     }
 
     /* Pull arrays */
     foreach(array("kolabDelegate", "kolabInvitationPolicy") as $attr){
+
+      if (in_array($val, $skip)){
+        continue;
+      }
+
       if (isset($this->attrs["$attr"]["count"])){
         $tmp = array();
         for ($i= 0; $i<$this->attrs["$attr"]["count"]; $i++){
index 3a7f6284c7a879a631504d275cd24fd1b5627d49..921ad96ea4956cdc2d2f3bbdf34a3ec924c03c75 100644 (file)
@@ -1065,11 +1065,16 @@ I: Only insider delivery */
   }
 
   /* Adapt from template, using 'dn' */
-  function adapt_from_template($dn)
+  function adapt_from_template($dn, $skip= array())
   {
-    plugin::adapt_from_template($dn);
+    plugin::adapt_from_template($dn, $skip);
 
     foreach (array("gosaMailAlternateAddress", "gosaMailForwardingAddress") as $val){
+      if (in_array($val, $skip)){
+        continue;
+      }
+
       $this->$val= array();
       if (isset($this->attrs["$val"]["count"])){
         for ($i= 0; $i<$this->attrs["$val"]["count"]; $i++){
index b4a2eae8090c42b72827a6f0d4d1a60369731ecd..8fd0ab2a821a29fbd7a4968519ad59b0150d7b6d 100644 (file)
@@ -982,11 +982,16 @@ class mailAccount extends plugin
 
 
   /* Adapt from template, using 'dn' */
-  function adapt_from_template($dn)
+  function adapt_from_template($dn, $skip= array())
   {
-    plugin::adapt_from_template($dn);
+    plugin::adapt_from_template($dn, $skip);
 
     foreach (array("gosaMailAlternateAddress", "gosaMailForwardingAddress") as $val){
+
+      if (in_array($val, $skip)){
+        continue;
+      }
+
       $this->$val= array();
       if (isset($this->attrs["$val"]["count"])){
         for ($i= 0; $i<$this->attrs["$val"]["count"]; $i++){
index 65830c6d5b990c8ee855bd302f88048c92ff1c43..eb19275f675197ba035c6c732ff71c2ed2595af1 100644 (file)
@@ -1119,33 +1119,33 @@ class sambaAccount extends plugin
   }
 
 
-  function adapt_from_template($dn)
+  function adapt_from_template($dn, $skip= array())
   {
-    plugin::adapt_from_template($dn);
+    plugin::adapt_from_template($dn, $skip);
     $this->sambaSID= "";
     $this->sambaPrimaryGroupSID= "";
 
       /* Fill mungedDial field */
-    if ($this->samba3 && isset($this->attrs['sambaMungedDial'])){
+    if ($this->samba3 && isset($this->attrs['sambaMungedDial']) && !in_array('sambaMungedDial', $skip)){
       $this->mungedObject->load($this->sambaMungedDial);
     }
 
     /* Password expiery */
     if(isset($this->attrs['sambaPwdMustChange']) &&
-        $this->attrs['sambaPwdMustChange'][0] != 0){
+        $this->attrs['sambaPwdMustChange'][0] != 0 && !in_array('sambaPwdMustChange', $skip)){
       $this->password_expires= 1;
     }
 
     if(isset($this->attrs['sambaLogonTime']) && ! (
         $this->attrs['sambaLogonTime'][0] == 0 ||
         $this->attrs['sambaLogonTime'][0] == 2147483647
-      )){
+      ) && !in_array('sambaLogonTime', $skip)){
       $this->logon_time_set= 1;
     }
     if(isset($this->attrs['sambaLogoffTime']) && ! (
         $this->attrs['sambaLogoffTime'][0] == 0 ||
         $this->attrs['sambaLogoffTime'][0] == 2147483647
-      )){
+      ) && !in_array('sambaLogonTime', $skip)){
       $this->logoff_time_set= 1;
     }
 
@@ -1153,7 +1153,7 @@ class sambaAccount extends plugin
     if(isset($this->attrs['sambaKickoffTime']) && ! (
         $this->attrs['sambaKickoffTime'][0] == 0 ||
         $this->attrs['sambaKickoffTime'][0] == 2147483647
-      )){
+      ) && !in_array('sambaKickoffTime', $skip)){
       $this->kickoff_time_set= 1;
     }
 
index dd00a6e2f2aecfc29ffa6bdf10b127ca35fd21c1..7961bbf3c1dbd143c2d5528f9d45b1c0b23b546f 100644 (file)
@@ -377,11 +377,16 @@ class scalixAccount extends plugin
   }
 
   /* Adapt from template, using 'dn' */
-  function adapt_from_template($dn)
+  function adapt_from_template($dn, $skip= array())
   {
-    plugin::adapt_from_template($dn);
+    plugin::adapt_from_template($dn, $skip);
 
     foreach (array("scalixEmailAddress") as $val){
+
+      if (in_array($val, $skip)){
+        continue;
+      }
+
       $this->$val= array();
       if (isset($this->attrs["$val"]["count"])){
         for ($i= 0; $i<$this->attrs["$val"]["count"]; $i++){
index 918439ba3e1d43e2f44f32d125d1aee57837a57b..f56f05f78418e0998acf4416d83275d387969bc0 100644 (file)
@@ -1050,7 +1050,7 @@ class systems extends plugin
   {
   }
 
-  function adapt_from_template($dn)
+  function adapt_from_template($dn, $skip= array())
   {
   }