Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#change current() to next() in simpleauth to get the first result #119

Open
wants to merge 1 commit into
base: 1.9/develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions classes/auth/login/simpleauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected function perform_check()
$this->user = \DB::select_array(\Config::get('simpleauth.table_columns', array('*')))
->where('username', '=', $username)
->from(\Config::get('simpleauth.table_name'))
->execute(\Config::get('simpleauth.db_connection'))->current();
->execute(\Config::get('simpleauth.db_connection'))->next();
}

// return true when login was verified, and either the hash matches or multiple logins are allowed
Expand Down Expand Up @@ -132,7 +132,7 @@ public function validate_user($username_or_email = '', $password = '')
->where_close()
->where('password', '=', $password)
->from(\Config::get('simpleauth.table_name'))
->execute(\Config::get('simpleauth.db_connection'))->current();
->execute(\Config::get('simpleauth.db_connection'))->next();

return $user ?: false;
}
Expand Down Expand Up @@ -182,7 +182,7 @@ public function force_login($user_id = '')
->where_close()
->from(\Config::get('simpleauth.table_name'))
->execute(\Config::get('simpleauth.db_connection'))
->current();
->next();

if ($this->user == false)
{
Expand Down Expand Up @@ -245,7 +245,7 @@ public function create_user($username, $password, $email, $group = 1, Array $pro

if ($same_users->count() > 0)
{
if (in_array(strtolower($email), array_map('strtolower', $same_users->current())))
if (in_array(strtolower($email), array_map('strtolower', $same_users->next())))
{
throw new \SimpleUserUpdateException('Email address already exists', 2);
}
Expand Down Expand Up @@ -375,7 +375,7 @@ public function update_user($values, $username = null)
$this->user = \DB::select_array(\Config::get('simpleauth.table_columns', array('*')))
->where('username', '=', $username)
->from(\Config::get('simpleauth.table_name'))
->execute(\Config::get('simpleauth.db_connection'))->current();
->execute(\Config::get('simpleauth.db_connection'))->next();
}

return $affected_rows > 0;
Expand Down