function check_sender_access() { $tpl = new templates(); $main = new main_cf(); $u = $main->check_sender_access(); if ($u > 0) { echo $tpl->_ENGINE_parse_body("\n{ENABLE_INTERNET_DENY} {success} {$u} {users} {enabled}", "postfix.index.php"); } }
function RestrictedForInternet($reload = false) { $main = new main_cf(); $unix = new unix(); $GLOBALS["postmap"] = $unix->find_program("postmap"); $restricted_users = $users = $main->check_sender_access(); if (!$reload) { echo "Starting......: Restricted users ({$restricted_users})\n"; } if ($restricted_users > 0) { @copy("/etc/artica-postfix/settings/Daemons/unrestricted_senders", "/etc/postfix/unrestricted_senders"); @copy("/etc/artica-postfix/settings/Daemons/unrestricted_senders_domains", "/etc/postfix/local_domains"); echo "Starting......: Compiling unrestricted users ({$restricted_users})\n"; shell_exec("{$GLOBALS["postmap"]} hash:/etc/postfix/unrestricted_senders"); echo "Starting......: Compiling local domains\n"; shell_exec("{$GLOBALS["postmap"]} hash:/etc/postfix/local_domains"); if ($reload) { shell_exec("{$GLOBALS["postfix"]} reload"); } return true; } return false; }