예제 #1
0
파일: functions.php 프로젝트: istrwei/vpn
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
파일: auth.php 프로젝트: istrwei/vpn
<?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();