6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
9/6/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#11199] problem in authusername hook example
*
Your Email Address
*
Spam protection
Enter the letters below:
__..___..__..___.._. (__ | [__] | | .__) | | | | _|_
Comment
> I think there is an error in one of the authusername hook examples in > config/hooks.php > > In git, file horde/horde/config/hooks.php.dist lines 435-447: > // // Example #1: Append the virtual domain to the username. > // // ex. $HTTP_HOST = 'mail.mydomain.com', $userId = 'myname' > returns: > // // 'myname@mydomain.com' > // $vdomain = preg_replace('|^mail\.|i', '', getenv('HTTP_HOST')); > // $vdomain = Horde_String::lower($vdomain); > // > // if ($toHorde) { > // return $userId . '@' . $vdomain; > // } else { > // return (substr($userId, -strlen($vdomain)) == $vdomain) > // ? substr($userId, 0, -strlen($vdomain)) > // : $userId; > // } > > This correctly converts "myuserid" into "myuserid@domain.com", but > the reverse conversion is wrong, from "myuserid@domain.com" this > returns "myuserid@". > > This is a problem because (at least) it breaks some module actions: > for example I started noticing it when trying to change permissions > on kronolith calendars - whithout user intervention to manually > modify the displayed usernames, the shares break, multiplying > themselves. > > Changing line 445 from > // ? substr($userId, 0, -strlen($vdomain)) > to > // ? substr($userId, 0, -(strlen($vdomain)+1)) > should fix it. > > Massimo Malabotta
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers