Summary | problem in authusername hook example |
Queue | Horde Groupware Webmail Edition |
Queue Version | 4.0.6 |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | jan (at) horde (dot) org |
Requester | mmalabotta (at) units (dot) it |
Created | 05/17/2012 (4798 days ago) |
Due | |
Updated | 05/22/2012 (4793 days ago) |
Assigned | |
Resolved | 05/17/2012 (4798 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
commit ac24199f3456141a4e648967b8fc9d4e0ca40672
Author: Jan Schneider <jan@horde.org>
Date: Thu May 17 18:28:39 2012 +0200
Fix example (
Bug #11199).horde/config/hooks.php.dist | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/ac24199f3456141a4e648967b8fc9d4e0ca40672
State ⇒ Resolved
commit ac24199f3456141a4e648967b8fc9d4e0ca40672
Author: Jan Schneider <jan@horde.org>
Date: Thu May 17 18:28:39 2012 +0200
Fix example (
Bug #11199).horde/config/hooks.php.dist | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/ac24199f3456141a4e648967b8fc9d4e0ca40672
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Groupware Webmail Edition
Summary ⇒ problem in authusername hook example
Type ⇒ Bug
State ⇒ Unconfirmed
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