Пример #1
0
function selfenauth($name, $key)
{
    require "config.php";
    $db = mysql_connect($dbserver, $dbuser, $dbpassword);
    mysql_select_db($dbname, $db);
    $sql = "UPDATE vpn SET state = 1 , reason = '" . $key . "' WHERE name = '" . $name . "';";
    mysql_query($sql);
    $result = mysql_query($sql);
    $sql = "SELECT * FROM vpn WHERE name = '" . $name . "';";
    $result = mysql_query($sql);
    $row = mysql_fetch_assoc($result);
    $mailsubject = "VPN :ACTIVITED";
    $mailbody = "Congratulations,Your VPN Account at " . $sitename . " Has Been Activated.\n\nYour User Name Is:" . $row['name'] . "\nYour Password Is:" . $row['passwd'] . "\nThe Address Of Your Server Is:" . $vpnaddress . " \n\n" . $sitename . "'s VPN Service Is Based On PPTP ,Please Google (PPTP VPN Configuration) For Detailed Configuration Process.";
    $mailheaders = "From: " . $sitename . "<" . $siteemail . ">";
    mail($row['name'], $mailsubject, $mailbody, $mailheaders);
    rebuildsecret();
    $sql = "UPDATE `vpn`.`key` SET state = 2 WHERE value = '" . $key . "';";
    mysql_query($sql);
}
Пример #2
0
<?php

require "config.php";
require "functions.php";
$sitepassword = md5(md5($sitepassword, false), false);
if ($_GET['sitepassword'] == $sitepassword && $_GET['action']) {
    if (is_numeric($_GET['operateid']) == TRUE && $_GET['action'] == "enauth") {
        enauth($_GET['operateid']);
        echo "1";
    }
    if (is_numeric($_GET['operateid']) == TRUE && $_GET['action'] == "deauth") {
        deauth($_GET['operateid']);
        echo "0";
    }
    if ($_GET['action'] == "rebuildsecret") {
        rebuildsecret();
        header("location:./admin.php?sitepassword="******"analyzelog") {
            analyzelog();
            analyzesublog();
            header("location:./admin.php?sitepassword="******"location:./admin.php?sitepassword=" . $_GET['sitepassword']);
} else {
    fallback();