[horde] Fwd: Class Horde_Db_Pear does not exist

Jan Schneider jan at horde.org
Mon Nov 28 14:23:07 UTC 2011



----- Weitergeleitete Nachricht von Ovi Cazacu <ovi.cazacu at yahoo.com> -----
      Datum: Mon, 28 Nov 2011 06:13:03 -0800 (PST)
        Von: Ovi Cazacu <ovi.cazacu at yahoo.com>
Antwort an: Ovi Cazacu <ovi.cazacu at yahoo.com>
    Betreff: Re: [horde] Class Horde_Db_Pear does not exist
         An: Jan Schneider <jan at horde.org>

Here it is:

    public function signup_getextra()
        {
        return Horde::loadConfiguration('attributes.local.php',  
'attributes', 'turba');
         }

    public function signup_addextra($userId, $extra, $password)
        {

        $db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb();

        $fields = $values = array();
        foreach ($extra as $field => $value) {
            $fields[] = 'object_' . Horde_String::lower($field);
            $values[] =  
$db->quote(Horde_String::convertCharset($value, 'UTF-8',  
$GLOBALS['conf']['sql']['charset']));
        }
        $fields[] = 'object_id';
        $values[] = $db->quote($userId);

        $query  = 'INSERT INTO turba_objects ( owner_id, ' .  
implode(', ', $fields) . ')';
        $query .= ' VALUES ( \'admin\', ' . implode(', ', $values) . ')';
        $result = $db->query($query);

        if ($result instanceof PEAR_Error) {
            throw new Horde_Exception_Wrapped($result);
        }
    }

When I create an user, I want to add him also to the address book with  
some custom attributes.



----- Original Message -----
From: Jan Schneider <jan at horde.org>
To: horde at lists.horde.org
Cc:
Sent: Monday, November 28, 2011 3:02 PM
Subject: Re: [horde] Class Horde_Db_Pear does not exist


Zitat von Ovi Cazacu <ovi.cazacu at yahoo.com>:

> Hi i'm using the latest horde groupware webmail edition 4.0.4 and  
> i'm getting the following error when I try to add an user via a  
> custom hooks.php file.
>
>
> A fatal error has occurred
> Class Horde_Db_Pear does not exist
> 1. Horde::callHook() /var/www/webmail/admin/user.php:95
> 2. call_user_func_array() /usr/share/pear/Horde.php:1827
> 3. Horde_Hooks->signup_addextra()
> 4. Horde_Injector->getInstance() /var/www/webmail/config/hooks.php:635
> 5. Horde_Injector->createInstance() /usr/share/pear/Horde/Injector.php:248
> 6. Horde_Injector_Binder_AnnotatedSetters->create()  
> /usr/share/pear/Horde/Injector.php:213
> 7. Horde_Injector_Binder_Implementation->create()  
> /usr/share/pear/Horde/Injector/Binder/AnnotatedSetters.php:69
> 8. ReflectionClass->__construct()  
> /usr/share/pear/Horde/Injector/Binder/Implementation.php:60
>
>
> Any hints ?

How about showing your hook code?

Jan.

--Do you need professional PHP or Horde consulting?
http://horde.org/consulting/

--Horde mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: horde-unsubscribe at lists.horde.org

----- Ende der weitergeleiteten Nachricht -----

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the horde mailing list