Code

Only store changed attribute
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 10 Feb 2006 08:22:46 +0000 (08:22 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 10 Feb 2006 08:22:46 +0000 (08:22 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2655 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/posix/class_posixAccount.inc

index be868c57d0cfc1ef5ddeb11de7a9a12e29110a59..ca2dcb5e49fd7ed37e1a0ee4deb1bc6c5c220679 100644 (file)
@@ -691,7 +691,7 @@ class posixAccount extends plugin
       $this->shadowExpire= "0";
     } else {
       /* Transform seconds to days here */
-      $this->shadowExpire= (int)($this->shadowExpire / (60 * 60 * 24)) + 1;
+      $this->shadowExpire= (int)($this->shadowExpire / (60 * 60 * 24)) ;
     }
     if (!$this->use_shadowMax){
       $this->shadowMax= "0";
@@ -764,11 +764,14 @@ 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)){
-                 $this->gecos= "";
-         }
+      if (!preg_match('/[a-z0-9 -]/i', $this->gecos)){
+        $this->gecos= "";
+      }
     }
 
+       foreach(array("shadowMin","shadowMax","shadowWarning","shadowInactive","shadowExpire") as $attr){
+               $this->$attr = (int) $this->$attr;
+       }
     /* Call parents save to prepare $this->attrs */
     plugin::save();
 
@@ -801,9 +804,6 @@ class posixAccount extends plugin
       $thid->attrs['gosaDefaultPrinter']=array();
     }
 
-       foreach(array("shadowMin","shadowMax","shadowWarning","shadowInactive") as $attr){
-               $this->attrs[$attr] = (int) $this->attrs[$attr];
-       }
 
     /* Save data to LDAP */
     $ldap->cd($this->dn);