User class throws exception on register failure

This commit is contained in:
Mikael Nordfeldth
2015-03-01 12:36:19 +01:00
parent 7fdf2f50f4
commit bece816ec7
6 changed files with 71 additions and 80 deletions

View File

@@ -27,9 +27,7 @@
* @link http://status.net/
*/
if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Superclass for plugins that do authentication
@@ -139,7 +137,7 @@ abstract class AuthenticationPlugin extends Plugin
//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;
}