diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-11-07 16:35:51 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-11-07 22:37:41 +0100 |
commit | 505722cc0d949ff5606b71757ec8d2ad2691b62b (patch) | |
tree | d636c7370b519ad0c8a02bd7c34fc477a67b6145 /apps/provisioning_api/lib | |
parent | 836ba4f4192d042921507f9eea4ff69b4d54480e (diff) | |
download | nextcloud-server-505722cc0d949ff5606b71757ec8d2ad2691b62b.tar.gz nextcloud-server-505722cc0d949ff5606b71757ec8d2ad2691b62b.zip |
do not offer to change display name or password, if not possible.
Fixes #12319
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/provisioning_api/lib')
-rw-r--r-- | apps/provisioning_api/lib/Controller/AUserData.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/provisioning_api/lib/Controller/AUserData.php b/apps/provisioning_api/lib/Controller/AUserData.php index 25e5ab5c86d..864ed65e69e 100644 --- a/apps/provisioning_api/lib/Controller/AUserData.php +++ b/apps/provisioning_api/lib/Controller/AUserData.php @@ -22,6 +22,7 @@ declare(strict_types=1); namespace OCA\Provisioning_API\Controller; use OC\Accounts\AccountManager; +use OC\User\Backend; use OCP\AppFramework\OCS\OCSException; use OCP\AppFramework\OCS\OCSNotFoundException; use OCP\AppFramework\OCSController; @@ -32,6 +33,8 @@ use OCP\IGroupManager; use OCP\IRequest; use OCP\IUserManager; use OCP\IUserSession; +use OCP\User\Backend\ISetDisplayNameBackend; +use OCP\User\Backend\ISetPasswordBackend; abstract class AUserData extends OCSController { @@ -125,6 +128,12 @@ abstract class AUserData extends OCSController { $data['language'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'lang'); $data['locale'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'locale'); + $backend = $targetUserObject->getBackend(); + $data['backendCapabilities'] = [ + 'setDisplayName' => $backend instanceof ISetDisplayNameBackend || $backend->implementsActions(Backend::SET_DISPLAYNAME), + 'setPassword' => $backend instanceof ISetPasswordBackend || $backend->implementsActions(Backend::SET_PASSWORD), + ]; + return $data; } |