Robin S Posted May 3, 2016 Share Posted May 3, 2016 Users are pages, but in the Users section of the admin there isn't the same support for unpublished users as for unpublished pages. When users register on the frontend I set their status to unpublished until their email address is validated (thanks to a suggestion in the forums from Soma). But while users are unpublished it isn't possible to make edits to their profile via admin because there is no "Save and keep unpublished" button like there is for other pages. To save changes in admin the user must become published. Also, there is no ability to unpublish a user from admin. This would be a useful option if a user account needs to be suspended rather than deleted. Edit: another small thing that would be nice to have is for the user list to honour the useHoverActions config preference for PageList. I keep hovering on the user list and then I remember I have to click the name to get the flyout links. 7 Link to comment Share on other sites More sharing options...
mr-fan Posted May 3, 2016 Share Posted May 3, 2016 You could go with a activation link via email - so you can simple validate new users and set them activ via a email link...or in the backend and by setting activate_user to sero...or go with two different roles user_active and user_pending....you have multiple options to implement a comfortable managment via Lister pro or something else... link for a really good activation solution: https://processwire.com/talk/topic/4066-activate-user-account-via-email/ regards mr-fan 2 Link to comment Share on other sites More sharing options...
Robin S Posted May 3, 2016 Author Share Posted May 3, 2016 Thanks @mr-fan, I'm familiar with that thread and I am activating users via an email link. But in principle I think unpublished/published users is the ideal way to have users in an inactive/active state. That's what the published status of a page is for, so it shouldn't be necessary to add a new field for the same purpose. And it also has the benefit of preventing login and view access for unvalidated user accounts without the need for additional logic in login functions and page templates. 5 Link to comment Share on other sites More sharing options...
BitPoet Posted May 4, 2016 Share Posted May 4, 2016 There's a little bit of trickery involved when adding back a "save unpublished" button for user pages as InputfieldPassword has its own little piece of logic that sets itself to required when processing input for an unpublished page, but here's a quick-n-dirty attempt at a module. 6 Link to comment Share on other sites More sharing options...
adrian Posted May 4, 2016 Share Posted May 4, 2016 There's a little bit of trickery involved when adding back a "save unpublished" button for user pages as InputfieldPassword has its own little piece of logic that sets itself to required when processing input for an unpublished page, but here's a quick-n-dirty attempt at a module. Nice one. I also employed a little trickery in my EmailNewUser module, although I took a slightly different approach. $this->addHookBefore('InputfieldPassword::processInput', $this, 'removeRequired'); public function removeRequired(HookEvent $event) { $event->object->required = false; //hack to remove required status so that automatically generated password can be added on save } 4 Link to comment Share on other sites More sharing options...
Robin S Posted May 4, 2016 Author Share Posted May 4, 2016 @BitPoet, thanks, your module works well in PW 2.7.3 Feel like extending it with an unpublish button for published users? :grin: Link to comment Share on other sites More sharing options...
BitPoet Posted May 5, 2016 Share Posted May 5, 2016 Try the latest version 6 Link to comment Share on other sites More sharing options...
Robin S Posted May 5, 2016 Author Share Posted May 5, 2016 Try the latest version Nice! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now