[horde] auth-ldap hooks

alan walters alan at radiowave.ie
Sat Sep 3 16:16:40 PDT 2005


I amtryingtoget ssha and text passwords working with horde auth hooks
belowis what I have so far but I don't understand how to change the MD 5
suns tossha and text encoding

 

 

if (!function_exists('_horde_hook_authldap')) {

     function _horde_hook_authldap($userID, $credentials = null)

     {

         $entry['dn'] = 'mail=' . $userID .
',vd=limestonechat.com,o=clients,dc=radiowave,dc=net';

         if (isset($credentials) && isset($credentials['user_fullname'])) {

             $entry['cn'] = $credentials['user_fullname'];

         } else {

             $entry['mail'] = $userID;

         }

         $entry['sn'] = $userID;

         $entry['objectclass'][0] = 'top';

         $entry['objectclass'][1] = 'VirtualMailAccount';

         $entry['objectclass'][2] = 'Vacation';

         $entry['objectclass'][3] = 'amavisAccount';

         $entry['objectclass'][3] = 'VirtualForward';

         $entry['mail'] = $userID;

         $entry['vdHome'] = '/home/vmail/domains';

         $entry['mailbox'] = '/home/mail/' . $userID(stripped);

         $entry['homeDirectory'] = 'domain/' . $userID;

         $entry['delete'] = 'FALSE';

         $entry['accountActive'] = 'TRUE';

         $entry['description'] = 'Vacation description';

         $entry['vacationActive'] = 'FALSE';

         $entry['vacationStart'] = '01 January 2004';

         $entry['vacationEnd'] = '01 January 2004';

         $entry['vacationForward'] = 'user at example.tld';

         $entry['forwardActive'] = 'false';

         $entry['lastChange'] = '1108499016';

         $entry['quota'] = '52428800';

         $entry['amavisSpamKillLevel'] = '6.0';

         $entry['amavisSpamTag2Level'] = '5.5';

         $entry['amavisSpamTagLevel'] = '3.5';

         $entry['amavisBypassVirusChecks'] = 'FALSE';

         $entry['amavisBypassSpamChecks'] = 'TRUE';

 

         // need to check for new users (password) and edited users
(user_pass_2)

         if (isset($credentials) && isset($credentials['password'])) {

             $entry['userPassword'] =  '{MD5}' .
base64_encode(mHash(MHASH_MD5, $credentials['password']));

         } elseif (isset($credentials) &&
isset($credentials['user_pass_2'])) {

             $entry['userPassword'] =  '{MD5}' .
base64_encode(mHash(MHASH_MD5, $credentials['user_pass_2']));

         }

         return $entry;

     }

 }



More information about the horde mailing list