6.0.0-alpha12
6/8/25

[#13954] Premission removing owner with horde hooks
Summary Premission removing owner with horde hooks
Queue Ansel
Queue Version 3.0.2
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester bonnaud (at) hotmail (dot) com
Created 04/15/2015 (3707 days ago)
Due
Updated 04/15/2015 (3707 days ago)
Assigned
Resolved 04/15/2015 (3707 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
04/15/2015 11:51:38 PM bonnaud (at) hotmail (dot) com Comment #5 Reply to this comment
Well I removed the if ($toHorde) because basically it just need to do 
it both way according to you. It worked.

Thanks
You are missing the conversion back from the Horde username to the 
auth username.
04/15/2015 11:45:02 PM bonnaud (at) hotmail (dot) com Comment #4 Reply to this comment
In this situation the auth is "firstname.lastname" but everywhere in 
horde all property are stored as "firstname.lastname@domain.com" and 
even the first creation of the gallery in ansel store it that way.

If I convert back to the auth username it will brake permission still 
since the owner will be from firstname.lastname@domain.com to only 
firstname.lastname
You are missing the conversion back from the Horde username to the 
auth username.
04/15/2015 11:38:34 PM Michael Rubinsky Comment #3
State ⇒ Not A Bug
Reply to this comment
You are missing the conversion back from the Horde username to the 
auth username.
04/15/2015 10:36:30 PM bonnaud (at) hotmail (dot) com Comment #2 Reply to this comment
Just saw I forgot the closing braket for the hook function. The 
function is properly closed.
04/15/2015 10:35:18 PM bonnaud (at) hotmail (dot) com Comment #1
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ Ansel
Summary ⇒ Premission removing owner with horde hooks
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
I use a horde hook to add the @spagi.net to the user if not specified 
the function is as follow

     public function authusername($userId, $toHorde)
     {
         // Example #1: Append the virtual domain to the username only 
if a domain is not already specified.
         // ex. $HTTP_HOST = 'mail.mydomain.com', $userId = 'myname' returns:
         // 'myname@mydomain.com'
         // but $userId = 'myname@mydomain.com' returns self
         $vdomain = preg_replace('|^mail\.|i', '', getenv('HTTP_HOST'));
         $vdomain = Horde_String::lower($vdomain);

         if ($toHorde) {
             if (stripos($userId, '@')){
                 return $userId;
             }else{
                 return $userId . '@' . $vdomain;
             }
         }

It works well in Ansel EXCEPT if I try to change the permission on a 
gallery. Doing so will result that in the SQL table the field 
share_owner will simply record as "@mydomain.com" stripping the user 
and thus removing ownership of the gallery.

On the web interface I tried specifing the owner in the box but doing 
so the changes in the permission aren't recorded. So the only work 
around right now is to make the change in the permission and after 
that go manually in the database in ansel_shares and add the user in 
front of the @domain.com

Saved Queries