用户计数暂不控制,密码未失效时也要采用新密码

This commit is contained in:
wlx 2011-12-22 13:31:48 +00:00
parent b2d1803c00
commit bf922388ab
1 changed files with 5 additions and 4 deletions

View File

@ -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'];