Beispiel #1
0
    exit;
}
if (isset($_POST["ReconnectSession"])) {
    ReconnectSession();
    exit;
}
if (isset($_POST["DisableConnection"])) {
    DisableConnection();
    exit;
}
if (isset($_POST["EnableConnection"])) {
    EnableConnection();
    exit;
}
if (isset($_POST["DeleteConnection"])) {
    DeleteConnection();
    exit;
}
js();
function js()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $title = $tpl->_ENGINE_parse_body("{connection}:{$_GET["cname"]}");
    echo "YahooWin3('680','{$page}?tabs=yes&ID={$_GET["ID"]}','{$title}');";
}
function status()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $OPENVPN_SERVER_CONNECT = $tpl->_ENGINE_parse_body("{OPENVPN_SERVER_CONNECT}");
Beispiel #2
0
if (!$nomenu) {
    require "menu.php";
}
/* determine action */
if ($action == "editform") {
    DisplayConnectionForm("edit", $id);
} elseif ($action == "addform") {
    DisplayConnectionForm("add", "");
} elseif ($action == "update") {
    UpdateConnection($id, $connname, $remoteserver, $remoteusername, $remotepassword, $remoteinstanceid, $remoteprojectid, $remotesiteid);
    DisplayConnectionList();
} elseif ($action == "add") {
    AddConnection($connname, $remoteserver, $remoteusername, $remotepassword, $remoteinstanceid, $remoteprojectid, $remotesiteid);
    DisplayConnectionList();
} elseif ($action == "delete") {
    DeleteConnection($id);
    DisplayConnectionList();
} else {
    DisplayConnectionList();
}
/* ------------------------------------ functions ------------------------------------ */
/* -------------------------------------------- */
/* ------- AddConnection ---------------------- */
/* -------------------------------------------- */
function AddConnection($connname, $remoteserver, $remoteusername, $remotepassword, $remoteinstanceid, $remoteprojectid, $remotesiteid)
{
    /* perform data checks */
    $connname = mysql_real_escape_string($connname);
    $remoteserver = mysql_real_escape_string($remoteserver);
    $remoteusername = mysql_real_escape_string($remoteusername);
    $remotepassword = mysql_real_escape_string($remotepassword);