[imp] Horde_Prefs_Scope::serialize() must return a string or NULL

Kein Name muelladdi at gmail.com
Thu Jun 22 13:37:34 UTC 2017


Yes I have, one for getting the "fullname" of a user and one for getting
the "authusername".

However:
This error only appears when I try to move from php 5.3.10 to 5.5.9, so
this could have sth to do with php versions.....


Here are the relevant hook parts:
authusername:

        if(strpos($userId, '@') == false) {
                $vdomain = preg_replace('|^webmail\.|i', '',
getenv('HTTP_HOST'));
                $vdomain = Horde_String::lower($vdomain);
                $userId = Horde_String::lower($userId);

                if ($toHorde) {
                    return $userId . '@' . $vdomain;
                }
        }
                $userId = Horde_String::lower($userId);
                return (substr($userId, -strlen($vdomain)) == $vdomain)
                    ? substr($userId, 0, -strlen($vdomain) - 1)
                    : $userId;

                $userId = Horde_String::lower($userId);
                return $userId;


fullname:

        $user = $GLOBALS['registry']->getAuth();

        $_dbh =& DB::connect("mysql://user:pass@192.168.1.1/webmail");
        $name =& $_dbh->getOne("
            SELECT name
            FROM passwd
            WHERE id = ?
        ", array( $user ));
            return empty($name)
                ? $user
                : $name;


thanks for your help!
regards
Stefan


More information about the imp mailing list