diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-06-29 14:53:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-29 14:53:09 +0200 |
commit | 69e92ea71ac5223b6f9c827ba2fa15cacb191f5f (patch) | |
tree | 512322857ebca5ce5e72b4e50c8c413abc36aa69 /lib/private | |
parent | c76c8a69dcbced0b0748a980a8bbff5c61515dd5 (diff) | |
parent | 97c13debdcb701573f8dd0bc437eeb8df692ec0f (diff) | |
download | nextcloud-server-69e92ea71ac5223b6f9c827ba2fa15cacb191f5f.tar.gz nextcloud-server-69e92ea71ac5223b6f9c827ba2fa15cacb191f5f.zip |
Merge pull request #10053 from nextcloud/feature/7378/password-security-move
Move password change to security settings
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Settings/Manager.php | 2 | ||||
-rw-r--r-- | lib/private/Settings/Personal/PersonalInfo.php | 1 | ||||
-rw-r--r-- | lib/private/Settings/Personal/Security.php | 19 |
3 files changed, 19 insertions, 3 deletions
diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index 7040f87261f..82cb223bb9f 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/PersonalInfo.php b/lib/private/Settings/Personal/PersonalInfo.php index f4a8548e8f1..8c1c8cb19b8 100644 --- a/lib/private/Settings/Personal/PersonalInfo.php +++ b/lib/private/Settings/Personal/PersonalInfo.php @@ -135,7 +135,6 @@ class PersonalInfo implements ISettings { 'twitterScope' => $userData[AccountManager::PROPERTY_TWITTER]['scope'], 'twitterVerification' => $userData[AccountManager::PROPERTY_TWITTER]['verified'], 'groups' => $this->getGroups($user), - 'passwordChangeSupported' => $user->canChangePassword(), ] + $messageParameters + $languageParameters + $localeParameters; 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 + ]); } /** |