The following warnings occurred: | ||||||||||||||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
User Management Changes - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28) +--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29) +--- Thread: User Management Changes (/showthread.php?tid=576) Pages:
1
2
|
User Management Changes - Brandin - 05-27-2017 Hello, I have made changes to my system that will allow you to designate User Management personnel who can safely and securely work with users in your system without having the risk of breaking things. Moving the add user form to its own page: https://hastebin.com/ivaxusayak.xml (save as adduser.php in usersc) Note that this adduser.php page does not have the permission selector, because my system is based on levels allowing access to specific pages, e.g. everyone has the default level of "1" (User), if you are a User Manager, you have access to certain pages, System Admin, Database Admin, etc. So this add page will auto-assign the user to Level 1. Remove the delete buttons from the admin_users.php page and modify the columns, remove the adduser form: https://hastebin.com/ijebodiwil.xml (save as admin_users.php in usesrc) Add the delete button to admin_user.php, and only allow user to add or remove permissions THEY have, for example: Bob has Users Level 1, 2 and 4. Editor has Users Level 1, 3 and 4. The System has User Levels 1, 2, 3, 4 and 5. The Editor can only see Levels 1 and 4 on Bob's profile in the remove section, and Level 3 in the Add Section since those are the permissions they have assigned to themselves. https://hastebin.com/liwelegiti.sm (save as admin_user.php in usersc). This calls for a custom function: https://hastebin.com/fotiyagiga.php I hope these changes work for some of you User Management Changes - Brandin - 08-06-2017 I've done further updates to my User Management. Current structure for admin_users.php has the add form back on this page with a modal to do the addition. I removed the the delete checkboxes as I did before, added ID in its place, took out join date and logins, and also added a verified checkmark that only shows if email verification is turned on. It has jqwerty built in so you can use the esc key to get out of the modal quickly. When you create a new user it will redirect you to the admin_user.php page for them. You can disable this be commenting line ~ 147 that calls the redirect. Code: admin_users.php The new admin_user.php page is my favorite of all. Here is a screenshot of it: http://screencloud.net/v/38PRd I added tons of features and movement in this page so it is easier to read, and not everything is in one view. If email verification is enabled, in the top left you will see "Email Verified" or if the user is not verified, a checkbox with the value of "Verify Email" so you can manually verify a user. On the right we have the protected profile value. This is controlled from the Code: protectedprof Code: protected Code: protectedprof Here is what a protected profile being accessed by a user who is not within a master account looks like: http://screencloud.net/v/AtJsA However, if you belong to the master account array, you can set protected profiles, and instead, a checkbox (checked or unchecked) will show up based on the users protected value in the table. Check this, the profile is protected, uncheck and it is not! On the splash page you can modify the username, email or name. However, you must click the modal to do anything with the password, system settings, permission settings, misc settings, etc. The System Settings for me is used for disabling/enabling settings, I am leaving that in there as a blank modal so you can play with it and add stuff if you want. These modals can make it easier for you to disable/hide these functions from certain personnel (based on access level) if you wish. I incorporated my permission modifications as above to not allow a user to add/remove permissions that do not have access to. Instead of them just not showing, they show as a disabled checkbox now Code: admin_user.php JS: Code: jqwerty.js All of my custom functions, you will need some of these: https://pastebin.com/zbjXYgjt And all of my languages key in a SQL as you will probably need them: https://pastebin.com/meEZpGEK I can't think of anything else you'll need with this but let me know if you run into problems! User Management Changes - Brandin - 08-06-2017 I'm always forgetting something! You need to add protected int 1 default value 0 to your users table Here's my users table structure in case I missed anything else: http://pasted.co/fab5992b User Management Changes - mudmin - 08-06-2017 Yep. This is on my list! Thank you! User Management Changes - Brandin - 08-06-2017 You're welcome - I hope you like this - tried my best to make it as good lookin as I could User Management Changes - mudmin - 08-06-2017 It looks great. The only issue with it right now is it doesn't allow you to create a username for that person...and we've lost the ability to assign a user permission level to them. Thoughts? User Management Changes - mudmin - 08-06-2017 I'm also getting an unexpected end of file for admin_user.php Thoughts? User Management Changes - Brandin - 08-06-2017 The username thing yes...that is my fault as I auto-assign my users usernames. We will need to add that back in to the function. However, the file I provided you with will auto-assign based on the users first name and last name. You can read more about that here: https://userspice.com/forums/topic/auto-assign-username/ The user permission level might be an issue. See the way I do my levels is no 2 levels share the same page access. Only one level can have that page. So I have CSR, User Management, Admin. My CSRs have access to base pages, User Management to the user management stuff, admin everything else. I am assigned all permission levels. My user management will be assigned CSR and User Management. You can revert that section of code back to the fault if you want, would just be a couple lines within that permission modal. User Management Changes - Brandin - 08-06-2017 That could have been when I removed my logger stuff. When I get back from Lunch I'll work with it and send you an updated one. User Management Changes - mudmin - 08-06-2017 Ok. We'll get it. Thanks for the great point in the right direction. I'm about to call it a day. |