コード例 #1
0
function main_icap_access_ruleadd_ajax()
{
    $class_name = $_GET["class_name"];
    $hostname = $_GET["hostname"];
    $class_switch = $_GET["class_switch"];
    $icap_acl = $_GET["icap_acl"];
    $isnot = $_GET["isnot"];
    $SquidIcapAccessInsertRule = $_GET["SquidIcapAccessInsertRule"];
    if (trim($class_name) == null) {
        return null;
    }
    if (trim($class_switch) == null) {
        return null;
    }
    if (trim($icap_acl) == null) {
        return null;
    }
    $squid = new squid($_GET["hostname"]);
    if (is_numeric($SquidIcapAccessInsertRule)) {
        $squid->icap_insert_restrictions_rule($class_name, $class_switch, $icap_acl, $isnot, $SquidIcapAccessInsertRule);
    } else {
        $squid->icap_add_restrictions_rule($class_name, $class_switch, $icap_acl, $isnot);
    }
}