Project

General

Profile

Bug #5535

system_usermanager_addprivs.php and system_groupmanager_addprivs.php perform similar functions but behave inconsistently and both in bad ways

Added by Jim Pingle over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
User manager
Target version:
Start date:
11/25/2015
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.3
Affected Architecture:
All

Description

Both system_usermanager_addprivs.php and system_groupmanager_addprivs.php perform similar functions but behave inconsistently and both in various bad ways

system_usermanager_addprivs.php:
  • Not sorted properly (bad)
  • Shows privilege description when clicked (good)
  • Omits already-present privileges from the list so they cannot be added twice (good)
system_groupmanager_addprivs.php:
  • Sorted properly -- alphabetically by privilege name (good)
  • Does not show privilege description when clicked (bad)
  • Pre-selects previous privileges (good -- if it was respected)
  • ...but does not care if they are deselected (bad)
  • Adds privileges to a group multiple times (bad!)

They should, ideally, use the same or very similar code -- perhaps by moving some of the logic to priv.inc so they can generate the list in the same way.

Ideally they both should behave identically:
  • Sorted properly -- alphabetically by privilege name (system_groupmanager_addprivs.php does this correctly)
  • Show privilege description under the control when clicked (system_usermanager_addprivs.php does this correctly)
  • Omit already-present privileges from the list so they cannot be added twice (system_usermanager_addprivs.php does this correctly)
  • Do not allow the same privilege to be added to a user or group multiple times (system_usermanager_addprivs.php does this correctly as a byproduct of the above behavior)

Might also be a good time to tackle #5049

Associated revisions

History

#1 Updated by Steve Beaver over 3 years ago

  • Status changed from Confirmed to Feedback
  • Assignee changed from Steve Beaver to Jim Pingle

Added sorting to user privs
Added existing priv filter and description on click to groups page
Tidied up color/appearance as needed

#2 Updated by Steve Beaver over 3 years ago

  • % Done changed from 0 to 100

#3 Updated by Jim Pingle over 3 years ago

  • Status changed from Feedback to Assigned
  • Assignee changed from Jim Pingle to Steve Beaver

Much better!

Still three little things:
  • system_usermanager_addprivs.php appears to be doing a case-insensitive sort, while system_groupmanager_addprivs.php is sorting case sensitive -- insensitive is probably better -- either way though so long as they are consistent.
  • system_usermanager_addprivs.php has "System" for the option name when it should be "Assigned privileges"
  • Text under the option on the two pages is different, both should read "Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items"

#4 Updated by Steve Beaver over 3 years ago

Done

#5 Updated by Steve Beaver over 3 years ago

  • Status changed from Assigned to Feedback
  • Assignee changed from Steve Beaver to Jim Pingle

#6 Updated by Jim Pingle over 3 years ago

  • Status changed from Feedback to Resolved

Looks perfect now, thanks!

Also available in: Atom PDF