Add the ability to override dns for iSchedule using a global variable $icfg

This commit is contained in:
Rob Ostensen 2012-03-11 21:39:08 -05:00 committed by Andrew McMillan
parent 092cef63ca
commit 574aaf4465

View File

@ -77,7 +77,13 @@ class iSchedule
*/ */
function getTxt () function getTxt ()
{ {
global $icfg;
// TODO handle parents of subdomains and procuration records // TODO handle parents of subdomains and procuration records
if ( $icfg [ $this->remote_selector . '._domainkey.' . $this->remote_server ] )
{
$this->dk = $icfg [ $this->remote_selector . '._domainkey.' . $this->remote_server ];
return true;
}
$dkim = dns_get_record ( $this->remote_selector . '._domainkey.' . $this->remote_server , DNS_TXT ); $dkim = dns_get_record ( $this->remote_selector . '._domainkey.' . $this->remote_server , DNS_TXT );
if ( count ( $dkim ) > 0 ) if ( count ( $dkim ) > 0 )
@ -186,6 +192,14 @@ class iSchedule
*/ */
function getServer ( ) function getServer ( )
{ {
global $icfg;
if ( $icfg [ $this->domain ] )
{
$this->remote_server = $icfg [ $this->domain ] [ 'server' ];
$this->remote_port = $icfg [ $this->domain ] [ 'port' ];
$this->remote_ssl = $icfg [ $this->domain ] [ 'ssl' ];
return true;
}
$this->remote_ssl = false; $this->remote_ssl = false;
$parts = explode ( '.', $this->domain ); $parts = explode ( '.', $this->domain );
$tld = $parts [ count ( $parts ) - 1 ]; $tld = $parts [ count ( $parts ) - 1 ];