| Name | Size | Mode | Actions |
|---|---|---|---|
| cpanel.func.php | 14372 | 0644 | editdlrm |
| shared.func.php | 2794 | 0644 | editdlrm |
| whm.func.php | 8884 | 0644 | editdlrm |
/usr/src/rmw/cpanel/RemoteMxWizard/php/cpanel.func.php (14372B)
'.$LANG['funcmsg1'].' "'.$mailrecord.'.'.$domain.'" '.$LANG['funcmsg2'].' "'.$des.'" '.$LANG['funcmsg6'].' '.$type.' '.$LANG['funcmsg7'].'.
'); } else { print(''.$EditMailLine['cpanelresult']['data'][0]['result']['statusmsg'].'
'); } } function SetProviderServices($domain,$service,$cname,$Rtype,$ttl) { global $LiveCpApi; global $LANG; if (!empty($service)) { $AddRecord = $LiveCpApi->api2('ZoneEdit','add_zone_record',array("domain"=>$domain,"name"=>$service,"type"=>$Rtype,"cname"=>$cname,"ttl"=>$ttl)); if ($AddRecord['cpanelresult']['data'][0]['result']['status'] == "1") { echo ''.$LANG['funcmsg1'].' "'.$service.'.'.$domain.'" '.$LANG['funcmsg2'].' "'.$cname.'" '.$LANG['funcmsg6'].' '.$Rtype.' '.$LANG['funcmsg7'].'.
'; } else { echo ''.$AddRecord['cpanelresult']['data'][0]['result']['statusmsg'].'
'; } } } function SetProviderMXs($providername,$domain,$ProviderMXs,$oldpreference,$BackupMxPreference,$ProviderSPF,$ttl) { global $LiveCpApi; global $LANG; foreach ($ProviderMXs as $MXrecord=>$Preference) { $addmx = $LiveCpApi->api2('Email','addmx',array("domain"=>$domain,"exchange"=>$MXrecord,"preference"=>$Preference,"alwaysaccept"=>"remote")); if ($addmx['cpanelresult']['data'][0]['status'] == "1") { echo ''.$LANG['funcmsg10'].' '.$providername.' '.$LANG['funcmsg16'].': "'.$MXrecord.'".
'; if (isset($addmx['cpanelresult']['data'][0]['checkmx']['warnings']) && !empty($addmx['cpanelresult']['data'][0]['checkmx']['warnings'])) { echo ''.$addmx['cpanelresult']['data'][0]['checkmx']['warnings'].'
'; } } else { echo ''.$LANG['funcmsg11'].' '.$providername.' "'.$MXrecord.'".
'.$addmx['cpanelresult']['data'][0]['statusmsg'].'
'.$LANG['funcmsg8'].' '.$LANG['funcmsg14'].': "'.$domain.'".
'; } else { echo ''.$LANG['funcmsg9'].' '.$LANG['funcmsg14'].': "'.$domain.'".
'.$delmx['cpanelresult']['data'][0]['statusmsg'].'
'.$LANG['funcmsg12'].'
'; if (isset($changemx['cpanelresult']['data'][0]['checkmx']['warnings']) && !empty($changemx['cpanelresult']['data'][0]['checkmx']['warnings'])) { echo ''.$changemx['cpanelresult']['data'][0]['checkmx']['warnings'].'
'; } } else { echo ''.$LANG['funcmsg13'].'.
'.$CMX['cpanelresult']['data'][0]['statusmsg'].'
'.$LANG['funcmsg10'].' '.$providername.' '.$LANG['funcmsg15'].': "'.$ProviderSPF.'".
'; } else { echo ''.$AddSpf['cpanelresult']['data'][0]['result']['statusmsg'].'
'; } } } function GetUserOldSpf() { $UserOldSpfFile = getenv('HOME').'/.remotemxwizard/oldspfrecord'; if (file_exists($UserOldSpfFile)) { $OldSpfRecord = trim(file_get_contents($UserOldSpfFile)); if (!empty($OldSpfRecord)) { return $OldSpfRecord; } } return false; } function RemoveProviderMXs($domain,$ttl,$OldProviderConf) { global $LiveCpApi; global $LANG; $UserOldSpfRecord = GetUserOldSpf(); foreach ($OldProviderConf['MXs'] as $MXrecord=>$Preference) { $RMX = $LiveCpApi->api2('Email','delmx',array("domain"=>$domain,"exchange"=>$MXrecord,"preference"=>$Preference,"alwaysaccept"=>"local")); if ($RMX['cpanelresult']['data'][0]['status'] == "1") { print(''.$LANG['funcmsg8'].' '.$OldProviderConf['NAME'].' '.$LANG['funcmsg16'].': "'.$MXrecord.'".
'); if (isset($RMX['cpanelresult']['data'][0]['checkmx']['warnings']) && !empty($RMX['cpanelresult']['data'][0]['checkmx']['warnings'])) { print(''.$RMX['cpanelresult']['data'][0]['checkmx']['warnings'].'
'); } } else { print(''.$LANG['funcmsg9'].' '.$OldProviderConf['NAME'].' '.$LANG['funcmsg16'].': "'.$MXrecord.'".
'.$RMX['cpanelresult']['data'][0]['statusmsg'].'
'.$LANG['funcmsg10'].' '.$LANG['funcmsg14'].': "'.$domain.'".
'); } else { print(''.$LANG['funcmsg11'].' '.$LANG['funcmsg14'].': "'.$domain.'".
'.$BMXR['cpanelresult']['data'][0]['statusmsg'].'
'.$LANG['funcmsg12'].'
'); if (isset($CBMXR['cpanelresult']['data'][0]['checkmx']['warnings']) && !empty($CBMXR['cpanelresult']['data'][0]['checkmx']['warnings'])) { print(''.$CBMXR['cpanelresult']['data'][0]['checkmx']['warnings'].'
'); } } else { print(''.$LANG['funcmsg13'].'
'.$CBMXR['cpanelresult']['data'][0]['statusmsg'].'
'.$LANG['funcmsg10'].' '.$LANG['funcmsg17'].' "'.$UserOldSpfRecord.'".
'); } else { print(''.$AddUserOldSpf['cpanelresult']['data'][0]['result']['statusmsg'].'
'); } } if (RemoveProviderConfig()) { print(''.$LANG['funcmsg18'].'
'); } else { print(''.$LANG['funcmsg19'].'
'); } } function RemoveZoneRecord($providername,$domain,$record,$line,$spf=false) { global $LiveCpApi; global $LANG; if ($spf) { $userdir = getenv('HOME').'/.remotemxwizard'; if (!file_exists($userdir)) {mkdir($userdir);} if (file_put_contents($userdir.'/oldspfrecord',$spf)) { echo ''.$LANG['funcmsg20'].' '.$LANG['funcmsg17'].': "'.$spf.'".
'; } else { echo ''.$LANG['funcmsg21'].' '.$LANG['funcmsg17'].': "'.$spf.'".
'; } $Rspf = $LiveCpApi->api2('ZoneEdit','remove_zone_record',array("domain"=>$domain,"line"=>$line)); if ($Rspf['cpanelresult']['data'][0]['result']['status'] == "1") { echo ''.$LANG['funcmsg8'].' '.$LANG['funcmsg17'].' '.$LANG['funcmsg22'].': "'.$domain.'".
'; } else { echo ''.$Rspf['cpanelresult']['data'][0]['result']['statusmsg'].'
'; } } elseif (!empty($record) && $spf == false && !empty($line)) { sleep(1); $fetchzone = $LiveCpApi->api2('ZoneEdit','fetchzone_records',array("domain"=>$domain)); foreach($fetchzone['cpanelresult']['data'] as $valz) { if (isset($valz['name'])) { if ($valz['name'] == $record.'.'.$domain.'.') {$rLine = $valz['line'];} } } $RZR = $LiveCpApi->api2('ZoneEdit','remove_zone_record',array("domain"=>$domain,"line"=>$rLine)); if ($RZR['cpanelresult']['data'][0]['result']['status'] == "1") { echo ''.$LANG['funcmsg8'].' '.$record.'.'.$domain.' '.$LANG['funcmsg7'].'.
'; } else { echo ''.$RZR['cpanelresult']['data'][0]['result']['statusmsg'].'
'; } } elseif (empty($record) && $spf == false && !empty($line)) { $sRZR = $LiveCpApi->api2('ZoneEdit','remove_zone_record',array("domain"=>$domain,"line"=>$line)); if ($sRZR['cpanelresult']['data'][0]['result']['status'] == "1") { echo ''.$LANG['funcmsg8'].' '.$providername.' '.$LANG['funcmsg15'].' '.$LANG['funcmsg22'].': "'.$domain.'".
'; } else { echo ''.$sRZR['cpanelresult']['data'][0]['result']['statusmsg'].'
'; } } } function GawMatchConfig($domain) { global $LiveCpApi; if (file_exists('/usr/local/cpanel/base/3rdparty/RemoteMxWizard/mail_providers/google_apps.conf')) { $GawConf = GetMailProviderConf('google_apps.conf'); $listmxs = $LiveCpApi->api2('Email','listmxs',array("domain"=>$domain)); foreach ($listmxs['cpanelresult']['data'][0]['entries'] as $mxrecord) { $userMXS = trim($mxrecord['mx']); if (array_key_exists($userMXS,$GawConf['MXs'])) { if (SaveProviderConfig('google_apps.conf')) { return true; } } } } return false; } ?>