diff --git a/apps/settings/lib/Controller/ChangePasswordController.php b/apps/settings/lib/Controller/ChangePasswordController.php index 41f2584721c..a25f0b0e59b 100644 --- a/apps/settings/lib/Controller/ChangePasswordController.php +++ b/apps/settings/lib/Controller/ChangePasswordController.php @@ -49,28 +49,16 @@ use OCP\IUserManager; use OCP\IUserSession; class ChangePasswordController extends Controller { - - /** @var string */ - private $userId; - - /** @var IUserManager */ - private $userManager; - - /** @var IL10N */ - private $l; - - /** @var GroupManager */ - private $groupManager; - - /** @var Session */ - private $userSession; - - /** @var IAppManager */ - private $appManager; + private ?string $userId; + private IUserManager $userManager; + private IL10N $l; + private GroupManager $groupManager; + private Session $userSession; + private IAppManager $appManager; public function __construct(string $appName, IRequest $request, - string $userId, + ?string $userId, IUserManager $userManager, IUserSession $userSession, IGroupManager $groupManager, diff --git a/apps/settings/src/components/PasswordSection.vue b/apps/settings/src/components/PasswordSection.vue new file mode 100644 index 00000000000..b68de0365e0 --- /dev/null +++ b/apps/settings/src/components/PasswordSection.vue @@ -0,0 +1,98 @@ + + + + + + diff --git a/apps/settings/src/main-personal-password.js b/apps/settings/src/main-personal-password.js new file mode 100644 index 00000000000..cd27832a7df --- /dev/null +++ b/apps/settings/src/main-personal-password.js @@ -0,0 +1,36 @@ +/** + * @copyright 2022 Carl Schwan + * + * @license AGPL-3.0-or-later + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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 . + * + */ + +import Vue from 'vue' + +import PasswordSection from './components/PasswordSection.vue' +import { translate as t, translatePlural as n } from '@nextcloud/l10n' + +// eslint-disable-next-line camelcase +__webpack_nonce__ = btoa(OC.requestToken) + +Vue.prototype.t = t +Vue.prototype.n = n + +export default new Vue({ + el: '#security-password', + name: 'main-personal-password', + render: h => h(PasswordSection), +}) diff --git a/apps/settings/templates/settings/personal/security/password.php b/apps/settings/templates/settings/personal/security/password.php index f44d95c0997..bc363b15aa7 100644 --- a/apps/settings/templates/settings/personal/security/password.php +++ b/apps/settings/templates/settings/personal/security/password.php @@ -1,6 +1,7 @@ + * @copyright Copyright (c) 2022 Carl Schwan * * @author Arthur Schiwon * @@ -21,46 +22,8 @@ * */ -script('settings', [ - 'settings', - 'templates', - 'vue-settings-personal-security', -]); - if ($_['passwordChangeSupported']) { - script('settings', 'security_password'); + \OCP\Util::addScript('settings', 'vue-settings-personal-password'); } - ?> - -
-

t('Password'));?>

- -
-
-
- - -
- -
- - - - -
- -
- -
-
-
- -
- +
diff --git a/dist/core-common.js b/dist/core-common.js index f5aaf9e3637..2a8dd337d9e 100644 Binary files a/dist/core-common.js and b/dist/core-common.js differ diff --git a/dist/core-common.js.LICENSE.txt b/dist/core-common.js.LICENSE.txt index 8bf8a1daaba..b05e4a42769 100644 Binary files a/dist/core-common.js.LICENSE.txt and b/dist/core-common.js.LICENSE.txt differ diff --git a/dist/core-common.js.map b/dist/core-common.js.map index 61893e14284..a18a8468353 100644 Binary files a/dist/core-common.js.map and b/dist/core-common.js.map differ diff --git a/dist/core-login.js b/dist/core-login.js index f5651b47861..3646ae62571 100644 Binary files a/dist/core-login.js and b/dist/core-login.js differ diff --git a/dist/core-login.js.map b/dist/core-login.js.map index 5285cb1e357..b2b74d6af35 100644 Binary files a/dist/core-login.js.map and b/dist/core-login.js.map differ diff --git a/dist/settings-vue-settings-personal-password.js b/dist/settings-vue-settings-personal-password.js new file mode 100644 index 00000000000..13e08deb458 Binary files /dev/null and b/dist/settings-vue-settings-personal-password.js differ diff --git a/dist/settings-vue-settings-personal-password.js.LICENSE.txt b/dist/settings-vue-settings-personal-password.js.LICENSE.txt new file mode 100644 index 00000000000..bf0177b5faf Binary files /dev/null and b/dist/settings-vue-settings-personal-password.js.LICENSE.txt differ diff --git a/dist/settings-vue-settings-personal-password.js.map b/dist/settings-vue-settings-personal-password.js.map new file mode 100644 index 00000000000..b709763d886 Binary files /dev/null and b/dist/settings-vue-settings-personal-password.js.map differ diff --git a/package-lock.json b/package-lock.json index 1d0b45d26d2..08247a3e192 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "@nextcloud/paths": "^2.1.0", "@nextcloud/router": "^2.0.0", "@nextcloud/sharing": "^0.1.0", - "@nextcloud/vue": "^6.0.0-beta.4", + "@nextcloud/vue": "^6.0.0-beta.5", "@nextcloud/vue-dashboard": "^2.0.1", "@vue/cli-plugin-unit-jest": "^4.5.15", "autosize": "^5.0.1", @@ -3251,9 +3251,9 @@ } }, "node_modules/@nextcloud/vue": { - "version": "6.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-6.0.0-beta.4.tgz", - "integrity": "sha512-1TdzH0++/gIcBzot8iNT3AnweR/1EykpCfBwkJNhMgoiY4HlMLxBj7bpe2D4ul24XTCoXVEdGMYyB32GNVc9WA==", + "version": "6.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-6.0.0-beta.5.tgz", + "integrity": "sha512-23vdV3Z9iyUXs5mGi++uGShpL1+lhNPLfjbnCjf9rIytG6XQV/46vzdBSttbBA91CnuEYufEsTu3grjwW9JiRg==", "dependencies": { "@nextcloud/auth": "^2.0.0", "@nextcloud/axios": "^2.0.0", @@ -3262,6 +3262,7 @@ "@nextcloud/capabilities": "^1.0.4", "@nextcloud/dialogs": "^3.1.4", "@nextcloud/event-bus": "^3.0.0", + "@nextcloud/initial-state": "^1.2.1", "@nextcloud/l10n": "^1.6.0", "@nextcloud/logger": "^2.2.1", "@nextcloud/router": "^2.0.0", @@ -34467,9 +34468,9 @@ } }, "@nextcloud/vue": { - "version": "6.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-6.0.0-beta.4.tgz", - "integrity": "sha512-1TdzH0++/gIcBzot8iNT3AnweR/1EykpCfBwkJNhMgoiY4HlMLxBj7bpe2D4ul24XTCoXVEdGMYyB32GNVc9WA==", + "version": "6.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-6.0.0-beta.5.tgz", + "integrity": "sha512-23vdV3Z9iyUXs5mGi++uGShpL1+lhNPLfjbnCjf9rIytG6XQV/46vzdBSttbBA91CnuEYufEsTu3grjwW9JiRg==", "requires": { "@nextcloud/auth": "^2.0.0", "@nextcloud/axios": "^2.0.0", @@ -34478,6 +34479,7 @@ "@nextcloud/capabilities": "^1.0.4", "@nextcloud/dialogs": "^3.1.4", "@nextcloud/event-bus": "^3.0.0", + "@nextcloud/initial-state": "^1.2.1", "@nextcloud/l10n": "^1.6.0", "@nextcloud/logger": "^2.2.1", "@nextcloud/router": "^2.0.0", diff --git a/package.json b/package.json index 1d4b2cf5f19..e10322d1d89 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@nextcloud/paths": "^2.1.0", "@nextcloud/router": "^2.0.0", "@nextcloud/sharing": "^0.1.0", - "@nextcloud/vue": "^6.0.0-beta.4", + "@nextcloud/vue": "^6.0.0-beta.5", "@nextcloud/vue-dashboard": "^2.0.1", "@vue/cli-plugin-unit-jest": "^4.5.15", "autosize": "^5.0.1", diff --git a/webpack.modules.js b/webpack.modules.js index b6256969409..25982e9623d 100644 --- a/webpack.modules.js +++ b/webpack.modules.js @@ -81,6 +81,7 @@ module.exports = { 'vue-settings-personal-info': path.join(__dirname, 'apps/settings/src', 'main-personal-info.js'), 'vue-settings-personal-security': path.join(__dirname, 'apps/settings/src', 'main-personal-security.js'), 'vue-settings-personal-webauthn': path.join(__dirname, 'apps/settings/src', 'main-personal-webauth.js'), + 'vue-settings-personal-password': path.join(__dirname, 'apps/settings/src', 'main-personal-password.js'), 'legacy-admin': path.join(__dirname, 'apps/settings/src', 'admin.js'), 'apps': path.join(__dirname, 'apps/settings/src', 'apps.js'), },