mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-05-11 05:06:06 +02:00
Add support for mapping the quota
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
2d167fd365
commit
9bf0d3eb3d
|
@ -98,6 +98,11 @@ class Admin implements ISettings {
|
|||
'type' => 'line',
|
||||
'required' => true,
|
||||
],
|
||||
'quota_mapping' => [
|
||||
'text' => $this->l10n->t('Attribute to map the quota to.'),
|
||||
'type' => 'line',
|
||||
'required' => false,
|
||||
],
|
||||
];
|
||||
|
||||
$type = $this->config->getAppValue('user_saml', 'type');
|
||||
|
|
|
@ -455,6 +455,11 @@ class UserBackend implements IApacheBackend, UserInterface, IUserBackend {
|
|||
} catch (\InvalidArgumentException $e) {
|
||||
$newDisplayname = null;
|
||||
}
|
||||
try {
|
||||
$newQuota = $this->getAttributeValue('saml-attribute-mapping-quota_mapping', $attributes);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$newQuota = null;
|
||||
}
|
||||
|
||||
if ($user !== null) {
|
||||
$currentEmail = (string)$user->getEMailAddress();
|
||||
|
@ -474,6 +479,10 @@ class UserBackend implements IApacheBackend, UserInterface, IUserBackend {
|
|||
);
|
||||
$this->setDisplayName($uid, $newDisplayname);
|
||||
}
|
||||
|
||||
if ($newQuota !== null) {
|
||||
$user->setQuota($newQuota);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue