6.0.0-beta13
4/12/26
  • Backlinks
  • Similar Pages
  • Attachments
  • History
  • Back to

Attachments

 cpanel.php

Save the following file (also attached to this page) to {{horde/lib/Auth/cpanel.php}}:

require_once dirname(FILE) . '/imap.php';

class Auth_cpanel extends Auth_imap {

/**
 * Constructs a new cpanel authentication object.
 *
 * @param array $params  A hash containing connection parameters.
 */
function Auth_cpanel($params = array())
{
    $this->capabilities['transparent'] = true;
    parent::Auth_imap($params);
}

/**
 * Automatic authentication.
 *
 * @return boolean  Whether or not the client is allowed.
 */
function transparent()
{
    if ($this->_authenticate(getenv('REMOTE_USER'),
                             array('password' => getenv('REMOTE_PASSWORD')))) {
        $this->setAuth(getenv('REMOTE_USER'),
                       array('transparent' => 1,
                             'password' => getenv('REMOTE_PASSWORD')));
        return true;
    } else {
        return false;
    }
}

}

Then add the following line to {{horde/config/conf.php}} //after// the line saying {{/* CONFIG END. DO NOT CHANGE ANYTHING IN OR BEFORE THIS LINE. */}}:

$conf['auth']['driver'] = 'cpanel';

Don't change anything else in the {{conf.php}} file.