[horde] Class Horde_Db_Pear does not exist

Ovi Cazacu ovi.cazacu at yahoo.com
Mon Nov 28 14:17:53 UTC 2011


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.


More information about the horde mailing list