<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Premission removing owner with horde hooks</title> 
  <pubDate>Fri, 10 Apr 2026 03:14:03 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/13954</link> 
  <atom:link rel="self" type="application/rss+xml" title="Premission removing owner with horde hooks" href="https://bugs.horde.org/ticket/13954/rss" /> 
  <description>Premission removing owner with horde hooks</description> 
 
   
   
  <item> 
   <title>I use a horde hook to add the @spagi.net to the user if not </title> 
   <description>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 = &#039;mail.mydomain.com&#039;, $userId = &#039;myname&#039; returns:
        // &#039;myname@mydomain.com&#039;
        // but $userId = &#039;myname@mydomain.com&#039; returns self
        $vdomain = preg_replace(&#039;|^mail\.|i&#039;, &#039;&#039;, getenv(&#039;HTTP_HOST&#039;));
        $vdomain = Horde_String::lower($vdomain);

        if ($toHorde) {
            if (stripos($userId, &#039;@&#039;)){
                return $userId;
            }else{
                return $userId . &#039;@&#039; . $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 &quot;@mydomain.com&quot; 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&#039;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</description> 
   <pubDate>Wed, 15 Apr 2015 22:35:18 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/13954#t87977</link> 
  </item> 
   
  <item> 
   <title>Just saw I forgot the closing braket for the hook function. </title> 
   <description>Just saw I forgot the closing braket for the hook function. The function is properly closed.</description> 
   <pubDate>Wed, 15 Apr 2015 22:36:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/13954#t87978</link> 
  </item> 
   
  <item> 
   <title>You are missing the conversion back from the Horde username </title> 
   <description>You are missing the conversion back from the Horde username to the auth username.</description> 
   <pubDate>Wed, 15 Apr 2015 23:38:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/13954#t87979</link> 
  </item> 
   
  <item> 
   <title>In this situation the auth is &quot;firstname.lastname&quot; but every</title> 
   <description>In this situation the auth is &quot;firstname.lastname&quot; but everywhere in horde all property are stored as &quot;firstname.lastname@domain.com&quot; 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

&gt; You are missing the conversion back from the Horde username to the 
&gt; auth username.
</description> 
   <pubDate>Wed, 15 Apr 2015 23:45:02 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/13954#t87980</link> 
  </item> 
   
  <item> 
   <title>Well I removed the if ($toHorde) because basically it just n</title> 
   <description>Well I removed the if ($toHorde) because basically it just need to do it both way according to you. It worked.

Thanks

&gt; You are missing the conversion back from the Horde username to the 
&gt; auth username.
</description> 
   <pubDate>Wed, 15 Apr 2015 23:51:38 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/13954#t87981</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
