[Tickets #8385] Re: webdav and _username_hook_[from|to]backend

bugs at horde.org bugs at horde.org
Fri Sep 11 11:50:10 UTC 2009


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/8385
------------------------------------------------------------------------------
  Ticket             | 8385
  Updated By         | adrieder at sbox.tugraz.at
  Summary            | webdav and _username_hook_[from|to]backend
  Queue              | Kronolith
  Version            | FRAMEWORK_3
  Type               | Bug
  State              | Feedback
  Priority           | 2. Medium
  Milestone          |
  Patch              |
  Owners             | Ben Klang
------------------------------------------------------------------------------


adrieder at sbox.tugraz.at (2009-09-11 07:50) wrote:

>> Unfortunately I do not know how to track this further down...
>
> http://bugs.php.net/bugs-generating-backtrace.php

..well I'm in trouble getting a core file, I have to check that.
But for now I just removed the TZ relevant parts from Horde.php so  
that I can at least go on with the original problem of this ticket.

I double checked everything, but still the  
_username_hook_frombackend() hook gets called again on a already  
"realmed" username:

Here is the code for the username hooks that I'm using:

if (!function_exists('_username_hook_frombackend')) {
      function _username_hook_frombackend($userID)
      {
          $servers = Horde::loadConfiguration('servers.php', 'servers', 'imp');
          $server_key = null;
          $vrealm = null;
          foreach ($servers as $key => $val) {
             if($servers[$key]['server'] == $_SESSION['imp']['server']) {
                 $vrealm = '@' . $key;
             }
          }
          if(empty($vrealm)) {
             $vrealm = '@' . Util::getFormData('server_key');
          }
          if (substr($userID, -strlen($vrealm)) == $vrealm) {
             $log_msg = '_username_hook_frombackend called for user "'  
. $userID . ' - not modifying "';
          } else {
             $log_msg = '_username_hook_frombackend called for user "'  
. $userID . ' - adding "' . $vrealm . '"';
             $userID = $userID . $vrealm;
          }
          Horde::logMessage($log_msg, __FILE__, __LINE__, PEAR_LOG_DEBUG);
          return $userID;
      }
}

if (!function_exists('_username_hook_tobackend')) {
      function _username_hook_tobackend($userID)
      {
          $fullusername = split('@', $userID);
          $log_msg = '_username_hook_tobackend called for user "' .  
$userID . ' - removing "' . $fullusername[1] . '"';
          Horde::logMessage($log_msg, __FILE__, __LINE__, PEAR_LOG_DEBUG);
          return $fullusername[0];
      }
}

In this code there is a workaround that prevents the addition of the  
realm if it is already added, but still that's just a workaround.

As client I'm using Thunderbird/Lighting 0.9
The calendar URL is:  
https://myserver/horde/rpc.php/kronolith/myuser@vrealm/myuser@vrealm.ics?server=vrealm

On authentication prompt I enter:
Username: myuser
Password: mypassword

Hooks settings in horde/conf.php
$conf['hooks']['permsdenied'] = false;
$conf['hooks']['username'] = true;
$conf['hooks']['preauthenticate'] = false;
$conf['hooks']['postauthenticate'] = false;
$conf['hooks']['authldap'] = false;
$conf['hooks']['groupldap'] = false;

Hooks settings in horde/imp/conf.php
$conf['hooks']['vinfo'] = false;
$conf['hooks']['postlogin'] = false;
$conf['hooks']['postsent'] = false;
$conf['hooks']['signature'] = false;
$conf['hooks']['trailer'] = false;
$conf['hooks']['fetchmail_filter'] = false;
$conf['hooks']['mbox_redirect'] = false;
$conf['hooks']['mbox_icon'] = false;
$conf['hooks']['spam_bounce'] = true;
$conf['hooks']['msglist_format'] = false;
$conf['hooks']['display_folder'] = false;

Server settings in horde/imp/servers.php
[...]
$servers['vrealm'] = array(
     'name' => 'Vrealm desc',
     'server' => '12.10.10.35',
     'hordeauth' => false,
     'protocol' => 'imap/notls',
     'port' => 1430,
     'maildomain' => 'mydomain',
     'smtphost' => 'mmysmtphost',
     'smtpport' => 25,
     'realm' => '',
     'preferred' => '',
     'admin' => array(
         'params' => array(
             'login' => 'myadmin',
             'password' => 'mypwd',
             // The 'userhierarchy' parameter defaults to 'user.'
             // If you are using a nonstandard hierarchy for personal
             // mailboxes, you will need to set it here.
             'userhierarchy' => 'user.',
             // Although these defaults are normally all that is required,
             // you can modify the following parameters from their default
             // values.
             'protocol' => 'imap/notls',
             'hostspec' => '12.10.10.35',
             'port' => 1430
         )
     ),
     'quota' => array(
         'driver' => 'imap',
         'params' => array('hide_quota_when_unlimited' => true),
     ),
     'acl' => array(
         'driver' => 'rfc2086',
     ),
);
[...]

attached is a horde debug log with all the entries I get when I  
connect with Lightning.

If there is more information you need please let me know.






More information about the bugs mailing list