fixed an imap auth related bug

This commit is contained in:
SJ 2013-04-12 22:30:48 +02:00
parent 07c8a15400
commit 2d3be5a92c
2 changed files with 3 additions and 3 deletions

View File

@ -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));
} }

View File

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