Fix# compatibility with 9.0
This commit is contained in:
parent
1f4de9acff
commit
37743dfd5d
|
|
@ -5,8 +5,8 @@
|
|||
<description>User registration</description>
|
||||
<licence>AGPL</licence>
|
||||
<author>Pellaeon Lin</author>
|
||||
<version>0.2.0</version>
|
||||
<version>0.2.1</version>
|
||||
<dependencies>
|
||||
<owncloud min-version="9.1.0.7" max-version="9.2"/>
|
||||
<owncloud min-version="9.0" max-version="9.2"/>
|
||||
</dependencies>
|
||||
</info>
|
||||
|
|
|
|||
|
|
@ -262,10 +262,25 @@ class RegisterController extends Controller {
|
|||
}
|
||||
|
||||
// Try to log user in
|
||||
if ( method_exists($this->usersession, 'createSessionToken') ) {
|
||||
$this->usersession->login($username, $password);
|
||||
$this->usersession->createSessionToken($this->request, $userId, $username, $password);
|
||||
|
||||
return new RedirectResponse($this->urlgenerator->linkToRoute('files.view.index'));
|
||||
} elseif (OC_User::login($username, $password)) {
|
||||
$this->cleanupLoginTokens($userId);
|
||||
// FIXME unsetMagicInCookie will fail from session already closed, so now we always remember
|
||||
$logintoken = $this->random->generate(32);
|
||||
$this->config->setUserValue($userId, 'login_token', $logintoken, time());
|
||||
OC_User::setMagicInCookie($userId, $logintoken);
|
||||
OC_Util::redirectToDefaultPage();
|
||||
|
||||
// Render message in case redirect failed
|
||||
return new TemplateResponse('registration', 'message', array('msg' =>
|
||||
str_replace('{link}',
|
||||
$this->urlgenerator->getAbsoluteURL('/'),
|
||||
$this->l10n->t('Your account has been successfully created, you can <a href="{link}">log in now</a>.')
|
||||
)), 'guest');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue