diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 2 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 2 | ||||
-rw-r--r-- | lib/private/Files/Utils/Scanner.php | 11 | ||||
-rw-r--r-- | lib/private/Settings/Manager.php | 6 | ||||
-rw-r--r-- | lib/private/Settings/Personal/PersonalInfo.php | 1 | ||||
-rw-r--r-- | lib/private/Settings/Personal/Security.php | 19 | ||||
-rw-r--r-- | lib/private/Settings/Personal/ServerDevNotice.php (renamed from lib/private/Settings/Admin/ServerDevNotice.php) | 8 | ||||
-rw-r--r-- | lib/private/Share/Share.php | 1 |
8 files changed, 36 insertions, 14 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 0853180c1f0..f818bc2840f 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -937,7 +937,6 @@ return array( 'OC\\Settings\\Admin\\Mail' => $baseDir . '/lib/private/Settings/Admin/Mail.php', 'OC\\Settings\\Admin\\Overview' => $baseDir . '/lib/private/Settings/Admin/Overview.php', 'OC\\Settings\\Admin\\Server' => $baseDir . '/lib/private/Settings/Admin/Server.php', - 'OC\\Settings\\Admin\\ServerDevNotice' => $baseDir . '/lib/private/Settings/Admin/ServerDevNotice.php', 'OC\\Settings\\Admin\\Sharing' => $baseDir . '/lib/private/Settings/Admin/Sharing.php', 'OC\\Settings\\Application' => $baseDir . '/settings/Application.php', 'OC\\Settings\\BackgroundJobs\\VerifyUserData' => $baseDir . '/settings/BackgroundJobs/VerifyUserData.php', @@ -959,6 +958,7 @@ return array( 'OC\\Settings\\Personal\\Additional' => $baseDir . '/lib/private/Settings/Personal/Additional.php', 'OC\\Settings\\Personal\\PersonalInfo' => $baseDir . '/lib/private/Settings/Personal/PersonalInfo.php', 'OC\\Settings\\Personal\\Security' => $baseDir . '/lib/private/Settings/Personal/Security.php', + 'OC\\Settings\\Personal\\ServerDevNotice' => $baseDir . '/lib/private/Settings/Personal/ServerDevNotice.php', 'OC\\Settings\\Section' => $baseDir . '/lib/private/Settings/Section.php', 'OC\\Setup' => $baseDir . '/lib/private/Setup.php', 'OC\\Setup\\AbstractDatabase' => $baseDir . '/lib/private/Setup/AbstractDatabase.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 3d8856be915..05128f65c4f 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -967,7 +967,6 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Settings\\Admin\\Mail' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/Mail.php', 'OC\\Settings\\Admin\\Overview' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/Overview.php', 'OC\\Settings\\Admin\\Server' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/Server.php', - 'OC\\Settings\\Admin\\ServerDevNotice' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/ServerDevNotice.php', 'OC\\Settings\\Admin\\Sharing' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/Sharing.php', 'OC\\Settings\\Application' => __DIR__ . '/../../..' . '/settings/Application.php', 'OC\\Settings\\BackgroundJobs\\VerifyUserData' => __DIR__ . '/../../..' . '/settings/BackgroundJobs/VerifyUserData.php', @@ -989,6 +988,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Settings\\Personal\\Additional' => __DIR__ . '/../../..' . '/lib/private/Settings/Personal/Additional.php', 'OC\\Settings\\Personal\\PersonalInfo' => __DIR__ . '/../../..' . '/lib/private/Settings/Personal/PersonalInfo.php', 'OC\\Settings\\Personal\\Security' => __DIR__ . '/../../..' . '/lib/private/Settings/Personal/Security.php', + 'OC\\Settings\\Personal\\ServerDevNotice' => __DIR__ . '/../../..' . '/lib/private/Settings/Personal/ServerDevNotice.php', 'OC\\Settings\\Section' => __DIR__ . '/../../..' . '/lib/private/Settings/Section.php', 'OC\\Setup' => __DIR__ . '/../../..' . '/lib/private/Setup.php', 'OC\\Setup\\AbstractDatabase' => __DIR__ . '/../../..' . '/lib/private/Setup/AbstractDatabase.php', diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index f91696e77bb..fe2bf4ccb58 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -182,15 +182,20 @@ class Scanner extends PublicEmitter { /** * @param string $dir - * @throws \OC\ForbiddenException - * @throws \OCP\Files\NotFoundException + * @param $recursive + * @param callable|null $mountFilter + * @throws ForbiddenException + * @throws NotFoundException */ - public function scan($dir = '', $recursive = \OC\Files\Cache\Scanner::SCAN_RECURSIVE) { + public function scan($dir = '', $recursive = \OC\Files\Cache\Scanner::SCAN_RECURSIVE, callable $mountFilter = null) { if (!Filesystem::isValidPath($dir)) { throw new \InvalidArgumentException('Invalid path to scan'); } $mounts = $this->getMounts($dir); foreach ($mounts as $mount) { + if ($mountFilter && !$mountFilter($mount)) { + continue; + } $storage = $mount->getStorage(); if (is_null($storage)) { continue; diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index 4ee594c090f..82cb223bb9f 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -262,8 +262,6 @@ class Manager implements IManager { /** @var ISettings $form */ $form = new Admin\Overview($this->config); $forms[$form->getPriority()] = [$form]; - $form = new Admin\ServerDevNotice(); - $forms[$form->getPriority()] = [$form]; } if ($section === 'server') { /** @var ISettings $form */ @@ -305,10 +303,12 @@ class Manager implements IManager { $this->l ); $forms[$form->getPriority()] = [$form]; + $form = new Personal\ServerDevNotice(); + $forms[$form->getPriority()] = [$form]; } 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 + ]); } /** diff --git a/lib/private/Settings/Admin/ServerDevNotice.php b/lib/private/Settings/Personal/ServerDevNotice.php index 22637729b0f..fa5a736cded 100644 --- a/lib/private/Settings/Admin/ServerDevNotice.php +++ b/lib/private/Settings/Personal/ServerDevNotice.php @@ -18,10 +18,10 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ -namespace OC\Settings\Admin; +namespace OC\Settings\Personal; use OCP\AppFramework\Http\TemplateResponse; use OCP\Settings\ISettings; @@ -31,14 +31,14 @@ class ServerDevNotice implements ISettings { * @return TemplateResponse */ public function getForm() { - return new TemplateResponse('settings', 'settings/admin/server.development.notice'); + return new TemplateResponse('settings', 'settings/personal/development.notice'); } /** * @return string the section ID, e.g. 'sharing' */ public function getSection() { - return 'server'; + return 'personal-info'; } /** diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index ea00cfaca26..52e0628987b 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -327,6 +327,7 @@ class Share extends Constants { * @throws \OC\HintException when the share type is remote and the shareWith is invalid * @throws \Exception * @since 5.0.0 - parameter $itemSourceName was added in 6.0.0, parameter $expirationDate was added in 7.0.0, parameter $passwordChanged added in 9.0.0 + * @deprecated 14.0.0 TESTS ONLY - this methods is as of 2018-06 only used by tests */ public static function shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions, $itemSourceName = null, \DateTime $expirationDate = null, $passwordChanged = null) { |