Example #1
0
        if ($ph1ent['ikeid'] == 0) {
            $ph1ent['ikeid'] = ipsec_ikeid_next();
        }
        if (isset($p1index) && $a_phase1[$p1index]) {
            $a_phase1[$p1index] = $ph1ent;
        } else {
            $a_phase1[] = $ph1ent;
        }
        /* now we need to find all phase2 entries for this host */
        if (is_array($a_phase2) && count($a_phase2)) {
            foreach ($a_phase2 as $phase2) {
                if ($phase2['ikeid'] == $ph1ent['ikeid']) {
                    log_error("Reload {$ph1ent['descr']} tunnel(s)");
                    $old_ph1ent['remote-gateway'] = resolve_retry($old_ph1ent['remote-gateway']);
                    $old_phase2 = $phase2;
                    reload_tunnel_spd_policy($ph1ent, $phase2, $old_ph1ent, $old_phase2);
                }
            }
        }
        write_config();
        mark_subsystem_dirty('ipsec');
        header("Location: vpn_ipsec.php");
        exit;
    }
}
if ($pconfig['mobile']) {
    $pgtitle = array(gettext("VPN"), gettext("IPsec"), gettext("Edit Phase 1"), gettext("Mobile Client"));
} else {
    $pgtitle = array(gettext("VPN"), gettext("IPsec"), gettext("Edit Phase 1"));
}
$statusurl = "diag_ipsec.php";
        $ipsecent['p1']['peercert'] = base64_encode($_POST['p1peercert']);
        $ipsecent['p1']['authentication_method'] = $_POST['p1authentication_method'];
        $ipsecent['p2']['protocol'] = $_POST['p2proto'];
        $ipsecent['p2']['encryption-algorithm-option'] = $_POST['p2ealgos'];
        $ipsecent['p2']['hash-algorithm-option'] = $_POST['p2halgos'];
        $ipsecent['p2']['pfsgroup'] = $_POST['p2pfsgroup'];
        $ipsecent['p2']['lifetime'] = $_POST['p2lifetime'];
        $ipsecent['descr'] = $_POST['descr'];
        $ipsecent['pinghost'] = $_POST['pinghost'];
        if (isset($id) && $a_ipsec[$id]) {
            $a_ipsec[$id] = $ipsecent;
        } else {
            $a_ipsec[] = $ipsecent;
        }
        write_config();
        reload_tunnel_spd_policy($ipsecent, $oldipsecent);
        touch($d_ipsecconfdirty_path);
        header("Location: vpn_ipsec.php");
        exit;
    }
}
$pgtitle = "VPN: IPsec: Tünel düzenle";
include "head.inc";
?>

<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php 
include "fbegin.inc";
?>
<p class="pgtitle"><?php 
echo $pgtitle;
Example #3
0
        $ph2ent['pinghost'] = $pconfig['pinghost'];
        $ph2ent['descr'] = $pconfig['descr'];
        if (isset($pconfig['mobile'])) {
            $ph2ent['mobile'] = true;
        }
        if (isset($p2index) && $a_phase2[$p2index]) {
            $a_phase2[$p2index] = $ph2ent;
        } else {
            $a_phase2[] = $ph2ent;
        }
        /* now we need to find all phase2 entries for this host */
        if (is_array($ph2ent)) {
            ipsec_lookup_phase1($ph2ent, $ph1ent);
            $old_ph1ent = $ph1ent;
            $old_ph1ent['remote-gateway'] = resolve_retry($old_ph1ent['remote-gateway']);
            reload_tunnel_spd_policy($ph1ent, $ph2ent, $old_ph1ent, $old_ph2ent);
        }
        write_config();
        mark_subsystem_dirty('ipsec');
        header("Location: vpn_ipsec.php");
        exit;
    }
}
if ($pconfig['mobile']) {
    $pgtitle = array(gettext("VPN"), gettext("IPsec"), gettext("Edit Phase 2"), gettext("Mobile Client"));
} else {
    $pgtitle = array(gettext("VPN"), gettext("IPsec"), gettext("Edit Phase 2"));
}
$statusurl = "diag_ipsec.php";
$logurl = "diag_logs_ipsec.php";
include "head.inc";