[horde] Some comments/bug fixes

horde at abismo.org horde at abismo.org
Tue Dec 3 03:25:35 PST 2002


Hi there!

I'm currently using  the stable release of  horde/imp/turba (RedHat rpms
from horde site). Some issues came up, some of which I think are already
corrected in  the HEAD  version, but  maybe should  be corrected  in the
stable version as they are bugs??

Just in  case this might  be of interest,  I'm listing the  problems and
fixes I came  up with (not always the  best way, I admit :)  ). To avoid
spamming the several  lists, I'm including all the changes  here. If the
developers think  it is worth  while, they  can forward to  the relevant
people.

Just to end off, I would like to thank the developers.
Allthough  the code  structure is  slightly  complex, once  you spend  a
little time on  it you can do anything relativly  easily!
Thanks for the good work!

##### IMP BUG #######################################################
First logon -> 1970 + 1 sec
        imp/lib/IMP.php
        $last_login = $prefs->getValue('last_login');
        returns 1 on null entry

FIX:
       if ($actionID == IMP_LOGIN || !empty($imp['_login'])) {
        /* Get UNIX timestamp of the last time the user logged in. */
              $last_login = $prefs->getValue('last_login');
 
       if($last_login == 1)
               $last_login=0;

##### IMP REQUEST ####################################################
[hook][from]
        difficult to get user "from" for hook function
        (for someone how doesn't know the data structure!)
        Pass alternate address so that function is independant of rest

FIX:

lib/Identity/IMP.php
        $val = $this->getValue('from_addr', $ident);
        
        if (!empty($conf['hooks']['from']) && function_exists($conf['hooks']['from'])) {
            $val = call_user_func($conf['hooks']['from'], $imp,$val);
        }

####  HORDE CVS BUG? #################################################
Sessions to database

lib/SessionHandler/mysql.php

        $query = sprintf('SELECT session_data FROM %s WHERE session_id = %s',
                         $this->_params['table'], $this->quote($id));

The function "quote" does not add outer "'"

ie:  quote(5605f2d395896da6ba585551b0d332a1) =
     5605f2d395896da6ba585551b0d332a1
     => error in query

QUICK FIX:

    function quote($value)
    {
        static $quote;
        if (!isset($quote)) {
            $quote = function_exists('mysql_real_escape_string') ?
                'mysql_real_escape_string' :
                'mysql_escape_string';
        }

        return "'" .  $quote($value) . "'";
    }

#### IMP BUG ##########################################################
After a  session expires, you  are unable  to logon using  the resulting
logon page.

Steps:
        Logon
        Delete ticket
        Try read msg -> session time out
        Try logon on that page -> always session timeout

The problem is in
imp/redirect.php

The correct session  information was not being used when  the form field
"url" was set.

DIRTY FIX:

<         $url = Horde::getFormData('url');
<         if ($url) {
<             $pattern = session_name() . "=\w+";
<             $replacement = session_name() . "=" . session_id();
<             $url = preg_replace("($pattern)",$replacement, $url);
<             header('Location: ' . $url);
---
>         if (Horde::getFormData('url')) {
>             header('Location: ' . Horde::getFormData('url'));


This fixed it, although since the messageId of the email is missing from
the url, an error is given when logged on (see next BUG).
At least the user can log on again :)


### IMP BUG ##########################################################
When a user tries to read a message when msgId is not given -> error
#I think this is fixed in CVS

imp/message.php
        no checking of $imp['msgl'] is done!

This  is fatal  if php's  display_errors is  set to  "On" (sends  output
before headers):

FIX:

$index = Horde::getFormData('index');
if(!$imp || !isset($imp['msgl'])){
    header('Location: ' . Horde::applicationUrl('mailbox.php?actionID=' . MESSAGE_MISSING, true));
    exit;
}
$sorted = explode(':', $imp['msgl']);


#### General request #################################################
Missing documentation:
        How to translate help files

        (use CVS translations.php... have to get HEAD version working to
         use this... Since I didn't, don't know what it really does)

##### GERNERAL doc ###################################################
IE: version 5.50*
        Refresh on browser button -> page gets mangled
        Known IE issue with ssl 128bits
FIX:
        Upgrade to IE 6 :(

###### GERNERAL doc ##################################################
Hide path name in URL
        DocRoot for ALL components must be set in horde config/registry.php
        (off course... but faq doesn't say... ;) )
        PBCM -> problem between chair + monitor

-- 
If a man has a strong faith he can indulge in the luxury of skepticism.
		-- Friedrich Nietzsche
---
Jose' Carlos



More information about the horde mailing list