[dev] Allowing reuse of accounts

Juan Germano jigermano at uolsinectis.com.ar
Tue Jan 25 10:50:51 PST 2005


Citado por Jan Schneider <jan at horde.org>:

>
> Zitat von NarfistA <spo_argento at hotmail.com>:
>
>>    We have several thousands of clients with emails accounts. It isn't
>> rare at all for one of them to discontinue the service, and for a new or
>> existent user to ask for the unused address.
>>
>>    Some action would then be required to clean preferences and objects
>>  from Turba, and things like that.
>>
>>    Although one way to go would be to trigger a process on the event of
>> the deleting of the old email address, we'd like to make the system to
>> collect its own garbage, sort of speak.
>
> The basis for that feature is there already (in Horde 3). The user
> administration interfaces allows to clean all user data or to remove the
> user data when deleting a user. The problem is, that not all backends
> support this API yet. Actually only the preference backend is currently
> supported.
> It would be great if someone could write the missing api methods for the
> remaining backends and applications.
>
>>    I have a way to get a unique ID for the account, which would change if
>> an account were deleted/recreated. I already made a driver which extends
>> Prefs_sql and modifies the user so ID and user get related and if ID
>> changes then it would be like a new account. For example, using sql
>> driver a preference would be stored:
>>
>>    pref_uid: jigermano at uolsinectis.com.ar_327876
>> pref_scope: horde
>>   pref_name: show_sidebar
>> pref_value: 1
>>
>>    Which worked ok. But it doesn't seem to be so simple for Turba.
>>
>>    I was thinking if one of the hook functions could give me a solution,
>> or maybe a NEW hook funcion could be added and in conjunction with the
>> Auth class and the Identity class get the solution. The idea would be to
>> make the user ids for the backends uniques with the help of the new
>> hook.
>
> You should use the vinfo hook for that purpose, it alters user names used
> internally in Horde, to avoid name clashing if multiple users with the same
> name can login to the same Horde server.

I'm using IMP for authentication (against IMAP). When modifing the user name in
vinfo hook can't login.
imp/lib/Session.php
line 101:

         if (!empty($conf['hooks']['vinfo'])) {
             require_once HORDE_BASE . '/config/hooks.php';
             if (function_exists('_imp_hook_vinfo')) {
                 $_SESSION['imp']['user'] = call_user_func('_imp_hook_vinfo');
             }
         }

line 114:
         if (Auth::isAuthenticated()) {
             $_SESSION['imp']['uniquser'] = Auth::getAuth();
         } else {
             $_SESSION['imp']['uniquser'] = $_SESSION['imp']['user'];

line 219:
        $auth_imp = &Auth::singleton(array('imp', $conf['auth']['class']));
        $auth_imp->authenticateOptions(array('flags' => OP_HALFOPEN));
        if ($auth_imp->authenticate(null, null, true) !== true) {
            return false;
        }

and later on in lib/Auth/imp.php uses $_SESSION['imp']['uniquser'] for
authentication agains IMAP.
        if (empty($userID)) {
            if (empty($_SESSION['imp']['uniquser'])) {
                return false;
            }
            $userID = $_SESSION['imp']['uniquser'];
        }
...
        $login = ($login && ($this->getProvider() == 'imp'));

        return parent::authenticate($userID, $credentials, $login);

What am I missing?

>
> Jan.
>
> -- Do you need professional PHP or Horde consulting?
> http://horde.org/consulting/
>
> -- Horde developers mailing list - Join the hunt: http://horde.org/bounties/
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: dev-unsubscribe at lists.horde.org
>

-- 
Juan


More information about the dev mailing list