mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-26 04:30:12 +01:00
fixed an imap auth related bug
This commit is contained in:
parent
07c8a15400
commit
2d3be5a92c
@ -129,7 +129,7 @@ class ModelUserAuth extends Model {
|
|||||||
|
|
||||||
$uid = $this->model_user_user->get_uid_by_email($email);
|
$uid = $this->model_user_user->get_uid_by_email($email);
|
||||||
if($uid < 1) {
|
if($uid < 1) {
|
||||||
$uid = $this->model_user_user->get_next_uid();
|
$uid = $this->model_user_user->get_next_uid(TABLE_EMAIL);
|
||||||
$query = $this->db->query("INSERT INTO " . TABLE_EMAIL . " (uid, email) VALUES(?,?)", array($uid, $email));
|
$query = $this->db->query("INSERT INTO " . TABLE_EMAIL . " (uid, email) VALUES(?,?)", array($uid, $email));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,9 +294,9 @@ class ModelUserUser extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function get_next_uid() {
|
public function get_next_uid($table = TABLE_USER) {
|
||||||
|
|
||||||
$query = $this->db->query("SELECT MAX(uid) AS last_id FROM " . TABLE_USER);
|
$query = $this->db->query("SELECT MAX(uid) AS last_id FROM " . $table);
|
||||||
|
|
||||||
if(isset($query->row['last_id']) && $query->row['last_id'] > 0) {
|
if(isset($query->row['last_id']) && $query->row['last_id'] > 0) {
|
||||||
return (int)$query->row['last_id'] + 1;
|
return (int)$query->row['last_id'] + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user