Code

PureFtp caused account couldn't be saved if inserted values started with 0 like ...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Aug 2006 09:51:15 +0000 (09:51 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Aug 2006 09:51:15 +0000 (09:51 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4485 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/connectivity/class_pureftpdAccount.inc

index a3f5ae87b0321d511b68a4126cbd40138104ed56..8a2bbae638d0f448d457b1ec0b85f5634cdf1b67 100644 (file)
@@ -115,17 +115,24 @@ class pureftpdAccount extends plugin
       } else {
         $this->is_account= FALSE;
       }
-    }
 
-    plugin::save_object();
+      plugin::save_object();
+
+      $old= $this->FTPStatus;
+      if (isset($_POST["FTPStatus"])){
+        $this->FTPStatus = "disabled";
+      } else {
+        $this->FTPStatus = "enabled";
+      }
+      $this->is_modified= ($old != $this->FTPStatus)?TRUE:$this->is_modified;
+
+      /* Ensure that these vars are numeric. Values starting with 0 like '0123' cause ldap errors */
+      foreach(array("FTPQuotaFiles","FTPQuotaMBytes","FTPUploadRatio","FTPDownloadRatio","FTPUploadBandwidth","FTPDownloadBandwidth") as $testVar){
+        $this->$testVar = (int) ($this->$testVar);
+      }
+    
 
-    $old= $this->FTPStatus;
-    if (isset($_POST["FTPStatus"])){
-      $this->FTPStatus = "disabled";
-    } else {
-      $this->FTPStatus = "enabled";
     }
-    $this->is_modified= ($old != $this->FTPStatus)?TRUE:$this->is_modified;
   }