From bf922388abf3df4df7efe6f64ae3c1e81e7687f5 Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 22 Dec 2011 13:31:48 +0000 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=AE=A1=E6=95=B0=E6=9A=82?= =?UTF-8?q?=E4=B8=8D=E6=8E=A7=E5=88=B6=EF=BC=8C=E5=AF=86=E7=A0=81=E6=9C=AA?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E6=97=B6=E4=B9=9F=E8=A6=81=E9=87=87=E7=94=A8?= =?UTF-8?q?=E6=96=B0=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/models/Proftp.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/application/models/Proftp.php b/application/models/Proftp.php index 6908e12a..671a9f15 100644 --- a/application/models/Proftp.php +++ b/application/models/Proftp.php @@ -37,11 +37,12 @@ class Proftp $sql="update ftpuser set pwd=?,ts_created=now(),ts_invalid=?,datacount=1 where userid=?"; $this->db->query($sql,array($user->password,$user->time,$user->id)); return true; - } elseif (strtotime($u['ts_invalid'])>time() && $u['datacount']<$user->maxdata) { + } elseif (strtotime($u['ts_invalid'])>time()/* && $u['datacount']<$user->maxdata*/) { //更新数据计数 - //use the old password - $sql="update ftpuser set ts_invalid=?,datacount=datacount+? where userid=?"; - $this->db->query($sql,array($user->time,$user->datacount,$user->id)); + //同步ftpuser和proftpusers用户密码 + $sql="update ftpuser set ts_invalid=?,datacount=datacount+?,pwd=proftpusers.passwd + from proftpusers where userid=? and proftpusers.userid=?"; + $this->db->query($sql,array($user->time,$user->datacount,$user->id,$user->username)); $sql="select pwd,ts_invalid from ftpuser where userid=?"; $u=$this->db->fetchRow($sql,array($user->id)); $this->pwd=$u['pwd'];