summaryrefslogtreecommitdiffstats
path: root/application/libraries/Duser/Duser.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-08-20 22:49:58 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-08-20 22:49:58 +0200
commit4b0f4e75dacd7232d43dd983d58d5d8f9ac9fc8b (patch)
treefa17a1dd57d9daedea34c47f61844fa10c4dfc40 /application/libraries/Duser/Duser.php
parente5bda471666d19451289378a1c243daf122fa6bd (diff)
Duser: Add function to test if login credentials are valid
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/libraries/Duser/Duser.php')
-rw-r--r--application/libraries/Duser/Duser.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/application/libraries/Duser/Duser.php b/application/libraries/Duser/Duser.php
index 6212bfa6d..8005a00bb 100644
--- a/application/libraries/Duser/Duser.php
+++ b/application/libraries/Duser/Duser.php
@@ -110,4 +110,15 @@ class Duser extends CI_Driver_Library {
{
return $this->{$this->_adapter}->get_email($userid);
}
+
+ public function test_login_credentials($username, $password)
+ {
+ $login_info = $this->{$this->_adapter}->login($username, $password);
+
+ if (isset($login_info['username']) && $login_info['username'] === $username) {
+ return true;
+ }
+
+ return false;
+ }
}