exit; } if (isset($_GET["blockips"])) { echo postfix_check_client_access(); exit; } if (isset($_GET["ruleform"])) { echo rulesdatas(); exit; } if (isset($_GET["ajax"])) { echo js(); exit; } if (isset($_GET["load"])) { switchpage(); exit; } if (isset($_GET["ajax-page"])) { echo mainpage(); exit; } page(); function js() { $page = CurrentPageName(); $tpl = new templates(); $title = $tpl->_ENGINE_parse_body('{global_smtp_rules}'); $html = "\nvar hostname_mem;\nvar innerMem='';\nvar wbl;\n\n\tfunction StartPage(){\n\t\tYahooWinS(800,'{$page}?ajax-page=yes','{$title}');\n\t\tsetTimeout(\"LoadMainRegex()\",1000);\n\t}\n\t\n\tfunction LoadMainRegex(){\n\t\tLoadAjax('ruleform','{$page}?ruleform=yes');\n\t}\n\t\n\tvar x_check_client_access_add=function(obj){\n var tempvalue=obj.responseText;\n if(tempvalue.length>0){\n alert(tempvalue);\n }\n LoadAjax('blockips','smtp.rules.php?blockips=yes');\n\t}\n \n \nvar x_import_headers_regex=function(obj){\n RefreshRegexList();\n }\n \n\n\nfunction RefreshRegexList(){\n LoadAjax('postfix_regex','smtp.rules.php?postfix_regex=yes'); \n}\n \n \nfunction sLoadAjax(div,page){\n Set_Cookie('ARTICA-POSTFIX-REGEX-PAGE-DIV',div,'3600', '/', '', '');\n Set_Cookie('ARTICA-POSTFIX-REGEX-PAGE-URI',page,'3600', '/', '', ''); \n LoadAjax(div,page);\n }\n \n\n\nfunction check_client_access_add(){\n \n var data=prompt(document.getElementById('blockip_msg').value)\n if(data){\n var XHR = new XHRConnection();\n XHR.appendData('check_client_access_add',data);\n XHR.sendAndLoad('smtp.rules.php', 'GET',x_check_client_access_add);\n }\n}\n\nfunction check_client_access_del(IP){\n var XHR = new XHRConnection();\n XHR.appendData('check_client_access_del',IP);\n XHR.sendAndLoad('smtp.rules.php', 'GET',x_check_client_access_add); \n}\n\nfunction import_headers_regex(){\n var tx=document.getElementById('import_headers_regex_text').value;\n if(confirm(tx)){\n var XHR = new XHRConnection();\n XHR.appendData('import_headers_regex','yes');\n BigWait('postfix_regex');\n XHR.sendAndLoad('smtp.rules.php', 'GET',x_import_headers_regex);\n }\n}\n\nfunction postfix_regex_page(e){\n if(checkEnter(e)){\n Set_Cookie('ARTICA-POSTFIX-REGEX-PAGE', document.getElementById('postfixregexgotopage').value, '3600', '/', '', '');\n sLoadAjax('postfix_regex','smtp.rules.php?load=pregex&page='+document.getElementById('postfixregexgotopage').value) \n }}\nfunction postfix_regex_search_page(e){\n if(checkEnter(e)){\n sLoadAjax('postfix_regex','smtp.rules.php?load=pregex&search='+document.getElementById('postfixregexsearch').value) \n }}\n \nfunction edit_postfix_regex_rule(num){\n if(!IsNumeric(num)){num='New';}\n YahooWin(550,'smtp.rules.php?edit_postfix_regex_rule='+num); \n}\nfunction Cancel1(){\n var div=Get_Cookie('ARTICA-POSTFIX-REGEX-PAGE-DIV');\n var uri=Get_Cookie('ARTICA-POSTFIX-REGEX-PAGE-URI');\n if(!div){\n RefreshALL();\n return false;\n }\n \n if(div.length==0){RefreshALL();}else{\n LoadAjax(div,uri); \n }\n\n}\n\tfunction RefreshALL(){\n\t LoadAjax('postfix_regex','smtp.rules.php?load=pregex');\n\t LoadAjax('blockips','smtp.rules.php?load=blockips');\n\t}\n\t\n\tvar x_EditPostfixRegexRule=function(obj){\n\t var tempvalue=trim(obj.responseText);\n\t if(tempvalue.length>0){\n\t alert(tempvalue);\n\t document.getElementById('regexruleform').innerHTML=innerMem;\n\t return; \n\t }\n\t\tRefreshRegexList();\n\t\tYahooWinHide();\n\t}\t\n\t\n\t\n\tfunction EditPostfixRegexRule(id){\n\t \t var XHR = new XHRConnection();\n\t XHR.appendData('EditPostfixRegexRule',id);\n\t XHR.appendData('action',document.getElementById('action').value);\n\t XHR.appendData('log',document.getElementById('log').value);\n\t XHR.appendData('pattern',document.getElementById('pattern').value);\n\t innerMem=document.getElementById('regexruleform').innerHTML;\n\t document.getElementById('regexruleform').innerHTML=\"<div style='width:100%;padding:15px'><center><img src='img/wait_verybig.gif'></center></div>\";\n\t XHR.sendAndLoad('smtp.rules.php', 'POST',x_EditPostfixRegexRule); \n\t}\n\n\tfunction postfix_regex_form_macro1(){\n\t\t var header_regex;\n\t\t header_regex=document.getElementById('header_regex').value;\n\t\t \n\t\t var pattern=document.getElementById('pattern').value;\n\t\t if(header_regex.length>0){\n\t\t header_regex='^'+header_regex+': ';\n\t\t pattern=header_regex+pattern;\n\t\t document.getElementById('pattern').value=pattern;\n\t\t }\n\t}\n\nfunction PostfixRegexDelete(num){\n var XHR = new XHRConnection();\n XHR.appendData('PostfixRegexDelete',num);\n XHR.sendAndLoad('smtp.rules.php', 'GET',x_EditPostfixRegexRule);\n \n}\nfunction delete_headers_regex(){\n var tx=document.getElementById('delete_headers_regex_text').value;\n if(confirm(tx)){\n var XHR = new XHRConnection();\n XHR.appendData('delete_headers_regex','yes');\n BigWait('postfix_regex');\n XHR.sendAndLoad('smtp.rules.php', 'GET',x_import_headers_regex);\n }\n}\n\nfunction BigWait(id){\n document.getElementById(id).innerHTML=\"<div style='width:100%;padding:15px'><center><img src='img/wait_verybig.gif'></center></div>\"; \n}\n\n\tStartPage();\n"; echo $html; }
include_once("ressources/class.main_cf_filtering.inc"); $users=new usersMenus(); if($users->AsPostfixAdministrator==false){header('location:users.index.php');exit();} if(isset($_GET["check_client_access_add"])){check_client_access_add();exit;} if(isset($_GET["check_client_access_del"])){check_client_access_del();exit;} if(isset($_GET["import_headers_regex"])){import_headers_regex();exit;} if(isset($_GET["edit_postfix_regex_rule"])){echo postfix_regex_rule_edit();exit;} if(isset($_POST["EditPostfixRegexRule"])){postfix_regex_rule_save();exit;} if(isset($_GET["PostfixRegexDelete"])){postfix_regex_rule_delete();exit;} if(isset($_GET["delete_headers_regex"])){postfix_regex_rule_deleteall();exit();} if(isset($_GET["quick_deny_domains"])){macros_quick_deny_domains();exit;} if(isset($_GET["postfix_regex"])){echo postfix_regex();exit;} if(isset($_GET["blockips"])){echo postfix_check_client_access();exit;} if(isset($_GET["ruleform"])){echo rulesdatas();exit;} if(isset($_GET["ajax"])){echo js();exit;} if(isset($_GET["load"])){switchpage();exit;} if(isset($_GET["ajax-page"])){echo mainpage();exit;} page(); function js(){ $page=CurrentPageName(); $tpl=new templates(); $title=$tpl->_ENGINE_parse_body('{global_smtp_rules}'); $html=" var hostname_mem; var innerMem=''; var wbl; function StartPage(){