From c6c345873cf5d7cfe5d71146995e9da6b0a6a597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=81ojewski?= Date: Sat, 15 Dec 2018 20:09:04 +0100 Subject: [PATCH] user_sql-78 Hide "password change form" Hide "password change form" when "Allow password change" not set --- lib/Backend/UserBackend.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/Backend/UserBackend.php b/lib/Backend/UserBackend.php index adf0aad..73da238 100644 --- a/lib/Backend/UserBackend.php +++ b/lib/Backend/UserBackend.php @@ -21,6 +21,7 @@ namespace OCA\UserSQL\Backend; +use OC\User\Backend; use OCA\UserSQL\Action\EmailSync; use OCA\UserSQL\Action\IUserAction; use OCA\UserSQL\Action\QuotaSync; @@ -642,4 +643,16 @@ final class UserBackend extends ABackend implements { return false; } + + /** + * @inheritdoc + */ + public function implementsActions($actions): bool + { + if ($actions & Backend::SET_PASSWORD) { + return !empty($this->properties[Opt::PASSWORD_CHANGE]); + } + + return parent::implementsActions($actions); + } }