diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-14 23:15:04 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-14 23:15:04 +0300 |
commit | 9bf0d3eb3d211c954fc34c40cb9048687404c1ee (patch) | |
tree | 72c9e08955debb6fe6e19dcd88499276d547f9e1 /lib | |
parent | 2d167fd365e64c291f1bcd50ddaf9d6644034043 (diff) |
Add support for mapping the quota
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Settings/Admin.php | 5 | ||||
-rw-r--r-- | lib/UserBackend.php | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 6761ae97..d7e55118 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -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'); diff --git a/lib/UserBackend.php b/lib/UserBackend.php index b6c389d6..fbd5b79f 100644 --- a/lib/UserBackend.php +++ b/lib/UserBackend.php @@ -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); + } } } } |