* @link http://status.net/
*/
-if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Superclass for plugins that do authentication
//not much else we can do
}else{
$user = $this->autoRegister($nickname, $suggested_nickname);
- if($user){
+ if ($user instanceof User) {
User_username::register($user,$nickname,$this->provider_name);
return false;
}
}
}
- function onStartChangePassword($user,$oldpassword,$newpassword)
+ function onStartChangePassword(Profile $target ,$oldpassword, $newpassword)
{
if($this->password_changeable){
$user_username = new User_username();
- $user_username->user_id=$user->id;
+ $user_username->user_id = $target->getID();
$user_username->provider_name=$this->provider_name;
- if($user_username->find() && $user_username->fetch()){
+ if ($user_username->find(true)) {
$authenticated = $this->checkPassword($user_username->username, $oldpassword);
if($authenticated){
$result = $this->changePassword($user_username->username,$oldpassword,$newpassword);