Beispiel #1
0
    exit;
}
if (isset($_GET["is-client-running"])) {
    vpn_client_running();
    exit;
}
if (isset($_GET["client-events"])) {
    vpn_client_events();
    exit;
}
if (isset($_GET["client-reconnect"])) {
    vpn_client_hup();
    exit;
}
if (isset($_GET["client-reconfigure"])) {
    vpn_client_reconfigure();
    exit;
}
if (isset($_GET["certificate-infos"])) {
    certificate_infos();
}
if (isset($_GET["ifAllcaExists"])) {
    ifAllcaExists();
    exit;
}
if (isset($_GET["RestartOpenVPNServer"])) {
    RestartOpenVPNServer();
    exit;
}
if (isset($_GET["enable"])) {
    enable_service();
Beispiel #2
0
<?php
include_once(dirname(__FILE__)."/frame.class.inc");
include_once(dirname(__FILE__)."/class.unix.inc");
include_once(dirname(__FILE__)."/class.postfix.inc");

if(isset($_GET["build-vpn-user"])){BuildWindowsClient();exit;}
if(isset($_GET["restart-clients"])){RestartClients();exit;}
if(isset($_GET["restart-clients-tenir"])){RestartClientsTenir();exit;}
if(isset($_GET["is-client-running"])){vpn_client_running();exit;}
if(isset($_GET["client-events"])){vpn_client_events();exit;}
if(isset($_GET["client-reconnect"])){vpn_client_hup();exit;}
if(isset($_GET["client-reconfigure"])){vpn_client_reconfigure();exit;}



function RestartClients(){
	$unix=new unix();
	$nohup=$unix->find_program("nohup");
	$cmd=trim("$nohup ".LOCATE_PHP5_BIN2() ." /usr/share/artica-postfix/exec.openvpn.php --client-restart >/dev/null 2>&1 &");
	shell_exec($cmd);
	}
	
function RestartClientsTenir(){
	exec(LOCATE_PHP5_BIN2()." /usr/share/artica-postfix/exec.openvpn.php --client-restart",$results);
	echo "<articadatascgi>". base64_encode(serialize($results))."</articadatascgi>";
	
}
	
function vpn_client_running(){
	if(isset($_GET["verbose"])){$GLOBALS["VERBOSE"]=true;}
	$id=$_GET["is-client-running"];