From 01088a6e2dc5eeaf610b12dd1017db0e41c1db79 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 11 Aug 2006 09:51:15 +0000 Subject: [PATCH] PureFtp caused account couldn't be saved if inserted values started with 0 like '0123' git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4485 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../connectivity/class_pureftpdAccount.inc | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/plugins/personal/connectivity/class_pureftpdAccount.inc b/plugins/personal/connectivity/class_pureftpdAccount.inc index a3f5ae87b..8a2bbae63 100644 --- a/plugins/personal/connectivity/class_pureftpdAccount.inc +++ b/plugins/personal/connectivity/class_pureftpdAccount.inc @@ -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; } -- 2.30.2