diff --git a/webui/model/user/auth.php b/webui/model/user/auth.php index d9cc383f..9e73f995 100644 --- a/webui/model/user/auth.php +++ b/webui/model/user/auth.php @@ -349,7 +349,7 @@ class ModelUserAuth extends Model { $uid = $this->model_user_user->get_uid_by_email($email); if($uid < 1) { - $uid = $this->model_user_user->get_next_uid(TABLE_EMAIL); + $uid = $this->model_user_user->get_next_uid(); $query = $this->db->query("INSERT INTO " . TABLE_EMAIL . " (uid, email) VALUES(?,?)", array($uid, $email)); } diff --git a/webui/model/user/user.php b/webui/model/user/user.php index fe111f4c..07176efa 100644 --- a/webui/model/user/user.php +++ b/webui/model/user/user.php @@ -306,9 +306,9 @@ class ModelUserUser extends Model { } - public function get_next_uid($table = TABLE_USER) { + public function get_next_uid() { - $query = $this->db->query("SELECT MAX(uid) AS last_id FROM " . $table); + $query = $this->db->query("SELECT MAX(uid) AS last_id FROM " . TABLE_EMAIL); if(isset($query->row['last_id']) && $query->row['last_id'] > 0) { return (int)$query->row['last_id'] + 1;