mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-05-11 13:16:06 +02:00
user might be already known, but was not mapped yet. init on first login.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
0b0bfe94a2
commit
ec593bce13
|
@ -144,7 +144,6 @@ class SAMLController extends Controller {
|
||||||
// help with it and make the user known
|
// help with it and make the user known
|
||||||
$this->userManager->search($uid);
|
$this->userManager->search($uid);
|
||||||
if($this->userManager->userExists($uid)) {
|
if($this->userManager->userExists($uid)) {
|
||||||
$this->userBackend->initializeHomeDir($uid);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
throw new NoUserFoundException('Auto provisioning not allowed and user ' . $uid . ' does not exist');
|
throw new NoUserFoundException('Auto provisioning not allowed and user ' . $uid . ' does not exist');
|
||||||
|
@ -285,7 +284,10 @@ class SAMLController extends Controller {
|
||||||
if (!($user instanceof IUser)) {
|
if (!($user instanceof IUser)) {
|
||||||
throw new \InvalidArgumentException('User is not valid');
|
throw new \InvalidArgumentException('User is not valid');
|
||||||
}
|
}
|
||||||
$user->updateLastLoginTimestamp();
|
$firstLogin = $user->updateLastLoginTimestamp();
|
||||||
|
if($firstLogin) {
|
||||||
|
$this->userBackend->initializeHomeDir($user->getUID());
|
||||||
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->logger->logException($e, ['app' => $this->appName]);
|
$this->logger->logException($e, ['app' => $this->appName]);
|
||||||
return new Http\RedirectResponse($this->urlGenerator->linkToRouteAbsolute('user_saml.SAML.notProvisioned'));
|
return new Http\RedirectResponse($this->urlGenerator->linkToRouteAbsolute('user_saml.SAML.notProvisioned'));
|
||||||
|
|
Loading…
Reference in a new issue