diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-06-29 13:01:22 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-06-29 13:35:07 +0200 |
commit | 3f77b0fc8b3f1c00902ad6a12747e8b0a10ac50d (patch) | |
tree | f163da73819c21f030320db38ef5480b0464ce7c /lib/private/Settings | |
parent | a788f4911491cf58dfcde94b9491c79d844347be (diff) | |
download | nextcloud-server-3f77b0fc8b3f1c00902ad6a12747e8b0a10ac50d.tar.gz nextcloud-server-3f77b0fc8b3f1c00902ad6a12747e8b0a10ac50d.zip |
Move user password form to security settings
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/Settings')
-rw-r--r-- | lib/private/Settings/Manager.php | 2 | ||||
-rw-r--r-- | lib/private/Settings/Personal/Security.php | 19 |
2 files changed, 19 insertions, 2 deletions
diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index 4ee594c090f..bbc0ac7e4db 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -308,7 +308,7 @@ class Manager implements IManager { } if($section === 'security') { /** @var ISettings $form */ - $form = new Personal\Security(); + $form = new Personal\Security($this->userManager); $forms[$form->getPriority()] = [$form]; } if ($section === 'additional') { diff --git a/lib/private/Settings/Personal/Security.php b/lib/private/Settings/Personal/Security.php index ecbd1199d11..efcfd5589ce 100644 --- a/lib/private/Settings/Personal/Security.php +++ b/lib/private/Settings/Personal/Security.php @@ -25,16 +25,33 @@ namespace OC\Settings\Personal; use OCP\AppFramework\Http\TemplateResponse; +use OCP\IUserManager; use OCP\Settings\ISettings; class Security implements ISettings { + private $userManager; + + public function __construct( + IUserManager $userManager + ) { + $this->userManager = $userManager; + } + /** * @return TemplateResponse returns the instance with all parameters set, ready to be rendered * @since 9.1 */ public function getForm() { - return new TemplateResponse('settings', 'settings/personal/security'); + $user = $this->userManager->get(\OC_User::getUser()); + $passwordChangeSupported = false; + if ($user !== null) { + $passwordChangeSupported = $user->canChangePassword(); + } + + return new TemplateResponse('settings', 'settings/personal/security', [ + 'passwordChangeSupported' => $passwordChangeSupported + ]); } /** |