6.0.0-beta1
7/5/25

[#8091] Perms_UI is storing Auth::listUsers() "Display Name"
Summary Perms_UI is storing Auth::listUsers() "Display Name"
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester thomas (at) gelf (dot) net
Created 03/17/2009 (5954 days ago)
Due
Updated 03/17/2009 (5954 days ago)
Assigned
Resolved 03/17/2009 (5954 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
03/17/2009 02:41:03 PM Jan Schneider Comment #5 Reply to this comment
That's what the username hooks are for. Those are called when 
displaying user ids in the frontend.
03/17/2009 02:32:16 PM thomas (at) gelf (dot) net Comment #4 Reply to this comment
Hi Michael,



thank you for your quick response! As written below in the meantime I 
realized that listUsers is not doing what I expected it to do. So I've 
probably been a little bit too fast in posting this ;-) I'm using a 
custom LDAP Auth backend, based on the upcoming Zend_Ldap component 
(the one from "incubator", not the stable one). And: no, I'm not 
supposing it to be "better", I have other reasons for using it ;-)



As fair as I understood now, there is no kind of enumUsers() to be 
found, wouldn't that be a good addition? For compatibility reasons 
Auth.php could provide it's own enumUsers() function, wrapping 
listUsers() into an array with appropriate keys for Auth backends not 
providing their own enumUsers() function.



It's just an idea, it could avoid identity hooks in some cases 
(Whups?) - in my case it helps making permission assignment easier. 
Our AD-users are in the form "uabcd" (u + 4 chars) for historical 
reasons, showing "real" names makes managing permissions a lot easier.



I'll for sure not be offended it you see no sense in this, so please 
feel free to close this ticket. If otherwise you would like me to 
provide additional patches showing how this could look like, please 
let me know.



Regards,

Thomas




03/17/2009 01:52:03 PM Michael Rubinsky Comment #3
State ⇒ Not A Bug
Reply to this comment
Auth::listUsers() is supposed to return user ids, not user names. What 
auth backend are you seeing it return a full username?
03/17/2009 01:28:05 PM thomas (at) gelf (dot) net Comment #2 Reply to this comment
Hmmm... I had a quick look at Auth_sql - and as suspected listUsers() 
there just returns (0 => 'johndoe', 1 => 'foo') with 0, 1... unrelated 
to DB keys. So just applying my patch is impossible, but I wouldn't 
throw it away: isn't what I'm supposing listUsers() to do the "better" 
behaviour?



Cheers,

Thomas Gelf


03/17/2009 11:38:29 AM thomas (at) gelf (dot) net Comment #1
Priority ⇒ 1. Low
New Attachment: Perms_UI-userkey.patch Download
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ Perms_UI is storing Auth::listUsers() "Display Name"
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
Auth::listUsers() may return something like array('johndoe' => 'John 
Doo', 'foo' => 'Foo Master', ...), Perms_UI is completely ignoring key 
values as given by listUsers. This leads to problems (at least in my 
special case) once you are going to use hasPermission() combined with 
user-level permissions.



The attached patch changes Perms_UI to:

- store the key provided by listUsers() instead of the "Display Name"

- show the "Display Name" for permissions granted to existing users

- show "<username>" for unknown users (with quotes, helps to quickly 
identify deleted users etc)



Please have a quick crosscheck with other Authentication modules, just 
to be sure listUsers() is doing what I'm supposing it to do!



Best regards,

Thomas Gelf


Saved Queries