function my_receive($serv, $fd, $from_id, $data)
{
    echo "Receive data:{$data}";
    $err = check_key($data);
    if (!$err) {
        $serv->send($fd, "res=0&desc=key or uid error\r\n");
        return;
    }
    global $sess_list, $kv;
    parse_str($data);
    if ($cmd == "keep") {
        $res = "cmd={$cmd}&res=1\r\n";
    }
    if ($cmd == "subscribe") {
        $sess_list[$topic][$fd] = $fd;
        $kv[$fd] = $topic;
        $res = "cmd={$cmd}&res=1&&desc=success subscribe channel {$channel}\r\n";
    }
    if ($cmd == "publish") {
        $sub_list = $sess_list[$topic];
        foreach ($sub_list as $conn) {
            $serv->send($conn, "cmd={$cmd}&content={$message}\r\n");
        }
        $res = "cmd={$cmd}&res=1\r\n";
    }
    if ($cmd == "subscribe_num") {
        $num = count($sess_list[$topic]);
        $res = "{$num}\r\n";
    }
    $serv->send($fd, $res);
}
Beispiel #2
0
function enter_license()
{
    global $licensing_server;
    if (isset($_POST["license_key"])) {
        ${${"GLOBALS"}["yhdawfobcwh"]} = trailingslashit(${${"GLOBALS"}["kegsmhrnrn"]}) . "?remote_key_auth=" . base64_encode($_POST["license_key"]) . "&remote_site=" . base64_encode(trailingslashit(site_url()));
        $cgoolndww = "licensing_string";
        if (wp_remote_fopen(${$cgoolndww}) == 1) {
            update_option("license_key", $_POST["license_key"]);
            echo "Activated!";
            echo "<script>document.location='/';</script>";
        } else {
            echo "<p>Sorry the license key you entered is invalid. Please try again or contact us for help at help@magazine3.com</p>";
        }
    }
    if (!check_key()) {
        echo "<form method=\"post\">\n Enter license key: <input type=\"text\" name=\"license_key\" /> <input type=\"submit\" name=\"validate_license_key\" value=\"Activate\" />\n </form>\n <br /> <font color=\"red\"><b>Where is my key?:</b></font> <font color=\"green\">Your license key has been sent to your registered email address or you can get the license key from <a style=\"color:blue\" href=\"http://magazine3.com/license-key\" target=\"_blank\">Magazine3.com/license-key</a></font> <br />\n <font color=\"#111\">If for some reason key is not working, Send us an email on help@magazine3.com </font><br />  ";
    }
}
Beispiel #3
0
function sanitize($quote)
{
    global $session;
    unset($quote->read);
    unset($quote->id);
    unset($quote->db);
    unset($quote->permalink);
    unset($quote->host);
    unset($quote->tweet);
    if (!check_key()) {
        unset($quote->ip);
    }
    if ($quote->hidden && !check_key()) {
        unset($quote->text);
        unset($quote->comment);
    }
    return $quote;
}
Beispiel #4
0
                     echo "\n" . json_encode($mailMess);
                 }
             } else {
                 echo json_encode(array("message" => "no mail", "status" => "OK"));
             }
         } else {
             echo json_encode(array("message" => "Incorrect username or password", "status" => "ERROR", "username" => $username, "loggedin" => false));
         }
     } else {
         echo json_encode(array("message" => "Unknown arguments", "status" => "ERROR", "mode" => $mode));
     }
 } else {
     if ($mode == "READ") {
         $username = clean($_POST['username']);
         // Check API key
         check_key($ip, $mode, $key, $username);
         if (valid($username)) {
             $query = mysql_query("SELECT id FROM users WHERE username='******' AND loggedin='1'") or die(mysql_error());
             if (mysql_num_rows($query) == 1 || strpos($username, 'CONSOLE@') !== false) {
                 $query = mysql_query("SELECT * FROM `mail` WHERE `to`='{$username}' AND `unread`='0'") or die(mysql_error());
                 if (mysql_num_rows($query) > 0) {
                     echo json_encode(array("message" => "read", "status" => "OK", "username" => $username, "read" => mysql_num_rows($query)));
                     while ($array = mysql_fetch_array($query)) {
                         $to = $array['to'];
                         $from = $array['from'];
                         $message = $array['message'];
                         $attachments = $array['attachments'];
                         $complex = $array['complex'];
                         $id = $array['id'];
                         $unread = $array['unread'];
                         $sentfrom = $array['sent_from'];
Beispiel #5
0
function put_work($mysql)
{
    if (empty($_POST)) {
        return false;
    }
    //get nets by bssid
    $sql = 'SELECT net_id, hccap FROM nets WHERE bssid = ? AND n_state=0';
    $stmt = $mysql->stmt_init();
    $stmt->prepare($sql);
    $data = array();
    stmt_bind_assoc($stmt, $data);
    //get net by nhash
    $nsql = 'SELECT net_id, hccap FROM nets WHERE mic = unhex(?) AND n_state=0';
    $nstmt = $mysql->stmt_init();
    $nstmt->prepare($nsql);
    $ndata = array();
    stmt_bind_assoc($nstmt, $ndata);
    //Update key stmt
    $usql = 'UPDATE nets SET pass=?, sip=?, n_state=1, sts=NOW() WHERE net_id=?';
    $ustmt = $mysql->stmt_init();
    $ustmt->prepare($usql);
    $mcount = 0;
    foreach ($_POST as $bssid_or_mic => $key) {
        if (strlen($key) < 8) {
            continue;
        }
        if (valid_mac($bssid_or_mic)) {
            //old style submission with bssid
            $ibssid = mac2long($bssid_or_mic);
            $stmt->bind_param('i', $ibssid);
            $stmt->execute();
            while ($stmt->fetch()) {
                $hccap = gzinflate(substr($data['hccap'], 10));
                if ($key == check_key($hccap, array($key))) {
                    //put result in nets
                    $stmt->free_result();
                    $iip = ip2long($_SERVER['REMOTE_ADDR']);
                    $net_id = $data['net_id'];
                    $ustmt->bind_param('sii', $key, $iip, $net_id);
                    $ustmt->execute();
                    //delete from n2d
                    $mysql->query("DELETE FROM n2d WHERE net_id={$net_id}");
                }
            }
        } elseif (valid_key($bssid_or_mic)) {
            //hash submission
            $mic = strtolower($bssid_or_mic);
            $nstmt->bind_param('s', $mic);
            $nstmt->execute();
            if ($nstmt->fetch()) {
                $hccap = gzinflate(substr($ndata['hccap'], 10));
                if ($key == check_key($hccap, array($key))) {
                    //put result in nets
                    $nstmt->free_result();
                    $iip = ip2long($_SERVER['REMOTE_ADDR']);
                    $net_id = $ndata['net_id'];
                    $ustmt->bind_param('sii', $key, $iip, $net_id);
                    $ustmt->execute();
                    //delete from n2d
                    $mysql->query("DELETE FROM n2d WHERE net_id={$net_id}");
                }
            }
        }
        if ($mcount++ > 20) {
            break;
        }
    }
    $stmt->close();
    $ustmt->close();
    $nstmt->close();
    //Update cracked net stats
    $mysql->query("UPDATE stats SET pvalue = (SELECT count(net_id) FROM nets WHERE n_state=1) WHERE pname='cracked'");
    //Create new cracked.txt.gz and update wcount
    $sql = 'SELECT pass FROM (SELECT pass, count(pass) AS c FROM nets WHERE n_state=1 GROUP BY pass) i ORDER BY i.c DESC';
    $stmt = $mysql->stmt_init();
    $stmt->prepare($sql);
    $data = array();
    stmt_bind_assoc($stmt, $data);
    $stmt->execute();
    $wl = '';
    $i = 0;
    while ($stmt->fetch()) {
        $wl = "{$wl}{$data['pass']}\n";
        $i += 1;
    }
    $stmt->close();
    $gzdata = gzencode($wl, 9);
    $md5gzdata = md5($gzdata, True);
    $sem = sem_get(888);
    sem_acquire($sem);
    file_put_contents(CRACKED, $gzdata);
    sem_release($sem);
    //update wcount for cracked dict
    $cr = '%' . basename(CRACKED);
    $sql = 'UPDATE dicts SET wcount = ?, dhash = ? WHERE dpath LIKE ?';
    $stmt = $mysql->stmt_init();
    $stmt->prepare($sql);
    $stmt->bind_param('iss', $i, $md5gzdata, $cr);
    $stmt->execute();
    $stmt->close();
    return true;
}
			<option value="Vibur">Vibur</option>

			<option value="Vollkorn">Vollkorn (plus italic, bold and bold italic)</option>

			<option value="VT323">VT323</option>

			<option value="Walter Turncoat">Walter Turncoat</option>

			<option value="Yanone Kaffeesatz">Yanone Kaffeesatz (plus 300,400,700)</option>

		</optgroup> 	';
}
add_action("mmrunsetup", "mmrun");
if (!is_admin()) {
    if (!check_key(true)) {
        die;
    }
}
if (!function_exists("mmrun")) {
    function mmrun()
    {
        function theme_add_scripts()
        {
            if (!is_admin()) {
                wp_register_script("custom-script", get_template_directory_uri() . "/js/custom.js", "jquery");
                wp_enqueue_script("jquery");
                wp_enqueue_script("custom-script");
            }
        }
        add_action("init", "theme_add_scripts");
Beispiel #7
0
ini_set('display_errors', '1');
//error_reporting(E_ALL);
include 'functions.php';
global $api;
$api = array();
$api['vs'] = '3.6.2';
$api['query'] = $_GET;
$api['output'] = array();
$api['output']['API'] = 'I am OSFAPI version ' . $api['vs'];
$api['output']['time'] = time();
setup_database();
if ($api['query']['osfapi_key'] == 'new') {
    $valid_key = true;
    create_osfapi_key();
} else {
    $valid_key = check_key($api['query']['osfapi_key']);
    if ($valid_key) {
        $api['output']['action'] = $api['query']['action'];
        switch ($api['query']['action']) {
            case 'update_visitor':
                update_visitor();
                break;
            case 'update_settings':
                update_settings();
                break;
            case 'notify_new_user':
                notify_new_user();
                break;
            case 'get_key_data':
                get_key_data();
                break;