Example #1
0
/**
 * Returns the default value for "From"
 *
 * @access private
 * @return string
 */
function getDefaultFromValue($username, $domain)
{
    $v = "";
    if (defined('IMAP_DEFAULTFROM')) {
        switch (IMAP_DEFAULTFROM) {
            case 'username':
                $v = $username;
                break;
            case 'domain':
                $v = $domain;
                break;
            case 'ldap':
                $v = getIdentityFromLdap($username, $domain, IMAP_FROM_LDAP_FROM, true);
                break;
            case 'sql':
                $v = getIdentityFromSql($username, $domain, IMAP_FROM_SQL_FROM, true);
                break;
            case 'passwd':
                $v = getIdentityFromPasswd($username, $domain, 'FROM', true);
                break;
            default:
                $v = $username . IMAP_DEFAULTFROM;
                break;
        }
    }
    return $v;
}
Example #2
0
/**
 * Return the default value for "FullName"
 *
 * @param string     $username          Username
 * @return string
 */
function getDefaultFullNameValue($username, $domain)
{
    $v = $username;
    if (defined('IMAP_DEFAULTFROM')) {
        switch (IMAP_DEFAULTFROM) {
            case 'ldap':
                $v = getIdentityFromLdap($username, $domain, IMAP_FROM_LDAP_FULLNAME, false);
                break;
            case 'sql':
                $v = getIdentityFromSql($username, $domain, IMAP_FROM_SQL_FULLNAME, false);
                break;
            case 'passwd':
                $v = getIdentityFromPasswd($username, $domain, 'FULLNAME', false);
                break;
        }
    }
    return $v;
}