Move password settings
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
9ed106f69a
commit
dc1979903e
|
@ -38,8 +38,8 @@ return array(
|
|||
'OCA\\Settings\\Middleware\\SubadminMiddleware' => $baseDir . '/../lib/Middleware/SubadminMiddleware.php',
|
||||
'OCA\\Settings\\Personal\\Additional' => $baseDir . '/../lib/Settings/Personal/Additional.php',
|
||||
'OCA\\Settings\\Personal\\PersonalInfo' => $baseDir . '/../lib/Settings/Personal/PersonalInfo.php',
|
||||
'OCA\\Settings\\Personal\\Security' => $baseDir . '/../lib/Settings/Personal/Security.php',
|
||||
'OCA\\Settings\\Personal\\Security\\Authtokens' => $baseDir . '/../lib/Settings/Personal/Security/Authtokens.php',
|
||||
'OCA\\Settings\\Personal\\Security\\Password' => $baseDir . '/../lib/Settings/Personal/Security/Password.php',
|
||||
'OCA\\Settings\\Personal\\ServerDevNotice' => $baseDir . '/../lib/Settings/Personal/ServerDevNotice.php',
|
||||
'OCA\\Settings\\Sections\\Admin\\Additional' => $baseDir . '/../lib/Sections/Admin/Additional.php',
|
||||
'OCA\\Settings\\Sections\\Admin\\Groupware' => $baseDir . '/../lib/Sections/Admin/Groupware.php',
|
||||
|
|
|
@ -53,8 +53,8 @@ class ComposerStaticInitSettings
|
|||
'OCA\\Settings\\Middleware\\SubadminMiddleware' => __DIR__ . '/..' . '/../lib/Middleware/SubadminMiddleware.php',
|
||||
'OCA\\Settings\\Personal\\Additional' => __DIR__ . '/..' . '/../lib/Settings/Personal/Additional.php',
|
||||
'OCA\\Settings\\Personal\\PersonalInfo' => __DIR__ . '/..' . '/../lib/Settings/Personal/PersonalInfo.php',
|
||||
'OCA\\Settings\\Personal\\Security' => __DIR__ . '/..' . '/../lib/Settings/Personal/Security.php',
|
||||
'OCA\\Settings\\Personal\\Security\\Authtokens' => __DIR__ . '/..' . '/../lib/Settings/Personal/Security/Authtokens.php',
|
||||
'OCA\\Settings\\Personal\\Security\\Password' => __DIR__ . '/..' . '/../lib/Settings/Personal/Security/Password.php',
|
||||
'OCA\\Settings\\Personal\\ServerDevNotice' => __DIR__ . '/..' . '/../lib/Settings/Personal/ServerDevNotice.php',
|
||||
'OCA\\Settings\\Sections\\Admin\\Additional' => __DIR__ . '/..' . '/../lib/Sections/Admin/Additional.php',
|
||||
'OCA\\Settings\\Sections\\Admin\\Groupware' => __DIR__ . '/..' . '/../lib/Sections/Admin/Groupware.php',
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Arthur Schiwon <blizzz@arthur-schiwon.de>
|
||||
*
|
||||
|
@ -25,13 +26,13 @@
|
|||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Settings\Personal;
|
||||
namespace OCA\Settings\Personal\Security;
|
||||
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\IUserManager;
|
||||
use OCP\Settings\ISettings;
|
||||
|
||||
class Security implements ISettings {
|
||||
class Password implements ISettings {
|
||||
|
||||
/** @var IUserManager */
|
||||
private $userManager;
|
||||
|
@ -52,7 +53,7 @@ class Security implements ISettings {
|
|||
$passwordChangeSupported = $user->canChangePassword();
|
||||
}
|
||||
|
||||
return new TemplateResponse('settings', 'settings/personal/security', [
|
||||
return new TemplateResponse('settings', 'settings/personal/security/password', [
|
||||
'passwordChangeSupported' => $passwordChangeSupported,
|
||||
]);
|
||||
}
|
|
@ -29,7 +29,7 @@ namespace OCA\Settings\Tests\Settings\Personal\Security;
|
|||
|
||||
use OC\Authentication\Token\DefaultToken;
|
||||
use OC\Authentication\Token\IProvider as IAuthTokenProvider;
|
||||
use OCA\Settings\Personal\Security;
|
||||
use OCA\Settings\Personal\Password;
|
||||
use OCA\Settings\Personal\Security\Authtokens;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\IInitialStateService;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
|
@ -28,17 +27,14 @@ declare(strict_types=1);
|
|||
|
||||
namespace OCA\Settings\Tests\Settings\Personal;
|
||||
|
||||
use OC\Authentication\TwoFactorAuth\ProviderLoader;
|
||||
use OCA\Settings\Personal\Security;
|
||||
use OCA\Settings\Personal\Security\Password;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\IConfig;
|
||||
use OCP\IUser;
|
||||
use OCP\IUserManager;
|
||||
use OCP\IUserSession;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Test\TestCase;
|
||||
|
||||
class SecurityTest extends TestCase {
|
||||
class PasswordTest extends TestCase {
|
||||
|
||||
/** @var IUserManager|MockObject */
|
||||
private $userManager;
|
||||
|
@ -46,7 +42,7 @@ class SecurityTest extends TestCase {
|
|||
/** @var string */
|
||||
private $uid;
|
||||
|
||||
/** @var Security */
|
||||
/** @var Password */
|
||||
private $section;
|
||||
|
||||
protected function setUp(): void {
|
||||
|
@ -55,7 +51,7 @@ class SecurityTest extends TestCase {
|
|||
$this->userManager = $this->createMock(IUserManager::class);
|
||||
$this->uid = 'test123';
|
||||
|
||||
$this->section = new Security(
|
||||
$this->section = new Password(
|
||||
$this->userManager,
|
||||
$this->uid
|
||||
);
|
|
@ -289,7 +289,7 @@ class Manager implements IManager {
|
|||
}
|
||||
if ($section === 'security') {
|
||||
/** @var ISettings $form */
|
||||
$form = $this->container->query(\OCA\Settings\Personal\Security::class);
|
||||
$form = $this->container->query(\OCA\Settings\Personal\Security\Password::class);
|
||||
$forms[$form->getPriority()] = [$form];
|
||||
|
||||
/** @var ISettings $form */
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace OCA\Settings\Tests\AppInfo;
|
|||
use OC\Settings\Manager;
|
||||
use OC\Settings\Section;
|
||||
use OCA\Settings\Admin\Sharing;
|
||||
use OCA\Settings\Personal\Security;
|
||||
use OCA\Settings\Personal\Password;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IL10N;
|
||||
use OCP\ILogger;
|
||||
|
@ -149,7 +149,7 @@ class ManagerTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testGetPersonalSettings() {
|
||||
$section = $this->createMock(Security::class);
|
||||
$section = $this->createMock(Password::class);
|
||||
$section->expects($this->once())
|
||||
->method('getPriority')
|
||||
->willReturn(16);
|
||||
|
@ -159,7 +159,7 @@ class ManagerTest extends TestCase {
|
|||
->willReturn(100);
|
||||
$this->container->expects($this->at(0))
|
||||
->method('query')
|
||||
->with(Security::class)
|
||||
->with(Password::class)
|
||||
->willReturn($section);
|
||||
$this->container->expects($this->at(1))
|
||||
->method('query')
|
||||
|
|
Loading…
Reference in New Issue