Commit 455c2310 authored by Brett Wilkins's avatar Brett Wilkins

MaharaAuthPlugin: fixing initUser function

parent 601a6553
...@@ -55,9 +55,9 @@ class MaharaAuthPlugin extends AuthPlugin { ...@@ -55,9 +55,9 @@ class MaharaAuthPlugin extends AuthPlugin {
} }
public function userExists( $username ) { public function userExists( $username ) {
$username = strtolower($username); $username = strtolower($username);
$db = $this->getDatabase(); $db = $this->getDatabase();
$sql = "SELECT username FROM ".$this->prefix."usr where LOWER(username) = '".$username."'"; $sql = "SELECT username FROM ".$this->prefix."usr where LOWER(username) = '".$username."'";
$res = $db->query($sql); $res = $db->query($sql);
$val = $db->fetchObject($res); $val = $db->fetchObject($res);
$db->close(); $db->close();
...@@ -263,11 +263,11 @@ class MaharaAuthPlugin extends AuthPlugin { ...@@ -263,11 +263,11 @@ class MaharaAuthPlugin extends AuthPlugin {
$db = $this->getDatabase(); $db = $this->getDatabase();
$sql = "SELECT * FROM ".$this->prefix."usr where LOWER(username) = '".$username."'"; $sql = "SELECT * FROM ".$this->prefix."usr where LOWER(username) = '".$username."'";
$res = $db->query($sql); $res = $db->query($sql);
$val = $db->fetchRow($res); $val = $db->fetchObject($res);
$db->close(); $db->close();
$user->setOption('nickname',$val->username); $user->setOption('nickname',$val->username);
$user->setEmail($this->email); $user->setEmail($val->email);
$user->setRealName($this->firstname.' '.$this->lastname); $user->setRealName($val->firstname.' '.$val->lastname);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment