Changeset 2505

Show
Ignore:
Timestamp:
04/15/2008 11:12:28 AM (6 months ago)
Author:
Shadowhand
Message:

Fixing #450, thanks Mihai!

Location:
trunk/system
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/config/email.php

    r1903 r2505  
    1515 * @param   null    native: no options 
    1616 * @param   string  sendmail: executable path, with -bs or equivalent attached 
    17  * @param   array   smtp: hostname, (username), (password), (port) 
     17 * @param   array   smtp: hostname, (username), (password), (port), (auth) 
    1818 */ 
    1919$config['options'] = NULL; 
  • trunk/system/helpers/email.php

    r2373 r2505  
    4949                                empty($config['options']['password']) or $connection->setPassword($config['options']['password']); 
    5050 
     51                                if ( ! empty($config['options']['auth'])) 
     52                                { 
     53                                        // Get the class name and params 
     54                                        list ($class, $params) = arr::callback_string($config['options']['auth']); 
     55 
     56                                        if ($class === 'PopB4Smtp') 
     57                                        { 
     58                                                // Load the PopB4Smtp class manually, due to it's odd filename 
     59                                                require_once Kohana::find_file('vendor', 'swift/Swift/Authenticator/$PopB4Smtp$'); 
     60                                        } 
     61 
     62                                        // Prepare the class name for auto-loading 
     63                                        $class = 'Swift_Authenticator_'.$class; 
     64 
     65                                        // Attach the authenticator 
     66                                        $connection->attachAuthenticator(($params === NULL) ? new $class : new $class($params[0])); 
     67                                } 
     68 
    5169                                // Set the timeout to 5 seconds 
    52                                 $connection->setTimeout(5); 
     70                                $connection->setTimeout(empty($config['options']['timeout']) ? 5 : (int) $config['options']['timeout']); 
    5371                        break; 
    5472                        case 'sendmail':