partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 8515ab6badde0c5dd408b52c0fffb2d8e60baec5
parent 5e045cdbb77f165e56f25f1cbba9c92c9bfa6f44
Author: Felicitus <felicitus@felicitus.org>
Date:   Wed,  9 Dec 2015 15:51:06 +0100

Added active flag to the user editor, updated WSSE bundle to support checking for isEnabled() flag

Diffstat:
Mcomposer.json | 2+-
Msrc/PartKeepr/AuthBundle/Entity/User.php | 1+
Msrc/PartKeepr/AuthBundle/Services/UserService.php | 1+
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/User/UserEditor.js | 12++++++++++++
4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/composer.json b/composer.json @@ -63,7 +63,7 @@ "doctrine/doctrine-migrations-bundle": "dev-master", "stof/doctrine-extensions-bundle": "~1.1@dev", "friendsofsymfony/user-bundle": "~2.0@dev", - "escapestudios/wsse-authentication-bundle": "2.3.x-dev", + "escapestudios/wsse-authentication-bundle": "dev-advancedUserInterface", "atelierspierrot/famfamfam-silk-sprite": "^1.0", "reputation-vip/composer-assets-installer": "^1.0", "jms/translation-bundle": "dev-master", diff --git a/src/PartKeepr/AuthBundle/Entity/User.php b/src/PartKeepr/AuthBundle/Entity/User.php @@ -88,6 +88,7 @@ class User extends BaseEntity implements UserInterface, EquatableInterface /** * Defines if the user is active * @ORM\Column(type="boolean") + * @Groups({"default"}) * * @var bool */ diff --git a/src/PartKeepr/AuthBundle/Services/UserService.php b/src/PartKeepr/AuthBundle/Services/UserService.php @@ -110,6 +110,7 @@ class UserService $FOSUser->setEmail($user->getEmail()); + $FOSUser->setEnabled($user->isActive()); } public function getProviderByType($type) diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/UserEditor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/UserEditor.js @@ -28,6 +28,12 @@ Ext.define('PartKeepr.UserEditor', { fieldLabel: i18n("Legacy User"), value: i18n('This user is a legacy user. You must provide a password in order to change the user. Please read <a href="https://wiki.partkeepr.org/wiki/Authentication" target="_blank">the PartKeepr Wiki regarding Authentication</a> for further information.'), hidden: true + }, { + xtype: 'checkbox', + itemId: 'activeCheckbox', + fieldLabel: i18n("Active"), + name: "active", + hidden: true } ]; @@ -36,6 +42,12 @@ Ext.define('PartKeepr.UserEditor', { }, toggleLegacyField: function () { + if (this.record.getProvider().get("type") === "Builtin" && this.record.get("legacy") === false) { + this.down("#activeCheckbox").setVisible(true); + } else { + this.down("#activeCheckbox").setVisible(false); + } + if (this.record.get("legacy") === true) { this.down("#legacyField").setVisible(true); } else {