用户计数暂不控制,密码未失效时也要采用新密码
This commit is contained in:
parent
b2d1803c00
commit
bf922388ab
|
@ -37,11 +37,12 @@ class Proftp
|
||||||
$sql="update ftpuser set pwd=?,ts_created=now(),ts_invalid=?,datacount=1 where userid=?";
|
$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));
|
$this->db->query($sql,array($user->password,$user->time,$user->id));
|
||||||
return true;
|
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
|
//同步ftpuser和proftpusers用户密码
|
||||||
$sql="update ftpuser set ts_invalid=?,datacount=datacount+? where userid=?";
|
$sql="update ftpuser set ts_invalid=?,datacount=datacount+?,pwd=proftpusers.passwd
|
||||||
$this->db->query($sql,array($user->time,$user->datacount,$user->id));
|
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=?";
|
$sql="select pwd,ts_invalid from ftpuser where userid=?";
|
||||||
$u=$this->db->fetchRow($sql,array($user->id));
|
$u=$this->db->fetchRow($sql,array($user->id));
|
||||||
$this->pwd=$u['pwd'];
|
$this->pwd=$u['pwd'];
|
||||||
|
|
Loading…
Reference in New Issue