Example #1
0
     $stmt = $db->prepare("SELECT id,user FROM usersession WHERE user= :login");
     $stmt->bindValue(':login', $realUser);
     $stmt->execute();
     $realUs = $stmt->fetch(PDO::FETCH_ASSOC);
     if ($login == $realUs['user']) {
         $stmt = $db->prepare("UPDATE usersession SET session = '{$sessid}' WHERE user= :login");
         $stmt->bindValue(':login', $realUser);
         $stmt->execute();
     } else {
         $stmt = $db->prepare("INSERT INTO usersession (user, session, md5) VALUES (:login, '{$sessid}', :md5)");
         $stmt->bindValue(':login', $login);
         $stmt->bindValue(':md5', md5($realUser));
         $stmt->execute();
     }
     $md5us = md5($realUser);
     $md5user = strtoint(xorencode($md5us, $protectionKey));
     /*$md5zip	  = @md5_file("clients/".$client."/config.zip");
       $md5ass	  = @md5_file("clients/assets.zip");
       $sizezip  = @filesize("clients/".$client."/config.zip");
       $sizeass  = @filesize("clients/assets.zip");*/
     $finfo = array();
     foreach ($files as $f) {
         array_push($finfo, array("path" => $f, "check" => preg_match("/\\.jar\$/i", $f), "md5" => preg_match("/\\.jar\$/i", $f) ? md5_file($f) : null, "size" => @filesize($f)));
     }
     exit(Security::encrypt(json_encode(array("error" => false, "code" => STATUS_OK, "text" => "Success", "line" => __LINE__, "file" => __FILE__, "files" => $finfo, "sid" => $sessid, "version" => $masterversion)), $key1));
 } else {
     if ($action == 'getpersonal') {
         $stmt = $db->prepare("SELECT user,realmoney FROM usersession WHERE user= :login");
         $stmt->bindValue(':login', $login);
         $stmt->execute();
         $row = $stmt->fetch(PDO::FETCH_ASSOC);
Example #2
0
} elseif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) {
    $onlineip = getenv('REMOTE_ADDR');
} elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {
    $onlineip = $_SERVER['REMOTE_ADDR'];
}
*/
$onlineip = getIP();
$onlineip = preg_replace("/^([\\d\\.]+).*/", "\\1", $onlineip);
//echo $onlineip;
// 以上为获取IP
//$onlineip="58.244.35.16";
$onlineip0 = strtoint($onlineip);
$x = " 您的IP段不在规定范围内!";
$ips = @file("ip.txt");
//打开ip文件
$j = @count($ips);
for ($i = 0; $i < $j; $i++) {
    $starstr = @explode("-", $ips[$i]);
    //if($starstr[0]<=$onlineip and $onlineip>=$starstr[1]){
    $a = strtoint($starstr[0]);
    $b = strtoint($starstr[1]);
    //if (strcmp($onlineip,$a) >= 0 && strcmp($onlineip,$b) <= 0){
    if ($onlineip0 >= $a && $onlineip0 <= $b) {
        $x = "您的IP段在规定范围内!<br />" . $starstr[0] . "<=" . $onlineip . "<=" . $starstr[1] . "<br />";
        break;
    }
}
echo $x . "<br>" . $onlineip;
$ipCity = new IpLocation('include/ipdata/QQWry.Dat');
$uCity = $ipCity->getlocation($onlineip);
var_dump($uCity);
Example #3
0
 public function image($name, $value, $size = "300K", $validTypes = array())
 {
     if (!is_empty($value)) {
         $data = null;
         if (is_string($value)) {
             $data = $value;
         } elseif (is_object($value) && method_exists($value, "__toString")) {
             $data = $value->__toString();
         }
         if (empty($validTypes)) {
             $validTypes = array("jpeg", "gif", "png");
         }
         if (!in_array(Sabel_Util_Image::getType($data), $validTypes, true)) {
             return $this->getDisplayName($name) . "の形式が不正です";
         } elseif ($size !== null) {
             if (strlen($data) > strtoint($size)) {
                 return $this->getDisplayName($name) . "のサイズが{$size}Bを超えています";
             }
         }
     }
 }
Example #4
0
         }
     }
     if ($assetsfolder) {
         $z = "/";
     } else {
         $z = ".zip";
     }
     if (!file_exists("clients/assets" . $z) || !file_exists("clients/" . $client . "/bin/") || !file_exists("clients/" . $client . "/mods/") || !file_exists("clients/" . $client . "/coremods/") || !file_exists("clients/" . $client . "/config.zip")) {
         die(Security::encrypt("client<\$> {$client}", $key1));
     }
     $md5user = strtoint(xorencode(str_replace('-', '', uuidConvert($realUser)), $protectionKey));
     $md5zip = @md5_file("clients/" . $client . "/config.zip");
     $md5ass = @md5_file("clients/assets.zip");
     $sizezip = @filesize("clients/" . $client . "/config.zip");
     $sizeass = @filesize("clients/assets.zip");
     $echo1 = "{$masterversion}<:>{$md5user}<:>" . $md5zip . "<>" . $sizezip . "<:>" . $md5ass . "<>" . $sizeass . "<br>" . $realUser . '<:>' . strtoint(xorencode($sessid, $protectionKey)) . '<br>' . $acesstoken . '<br>';
     if ($assetsfolder) {
         echo Security::encrypt($echo1 . str_replace("\\", "/", checkfiles('clients/' . $client . '/bin/') . checkfiles('clients/' . $client . '/mods/') . checkfiles('clients/' . $client . '/coremods/') . checkfiles('clients/assets')) . '<::>assets/indexes<:b:>assets/objects<:b:>assets/virtual<:b:>' . $client . '/bin<:b:>' . $client . '/mods<:b:>' . $client . '/coremods<:b:>', $key1);
     } else {
         echo Security::encrypt($echo1 . str_replace("\\", "/", checkfiles('clients/' . $client . '/bin/') . checkfiles('clients/' . $client . '/mods/') . checkfiles('clients/' . $client . '/coremods/')) . '<::>' . $client . '/bin<:b:>' . $client . '/mods<:b:>' . $client . '/coremods<:b:>', $key1);
     }
 } else {
     if ($action == 'getpersonal') {
         $stmt = $db->prepare("SELECT user,realmoney FROM usersession WHERE user= :login");
         $stmt->bindValue(':login', $login);
         $stmt->execute();
         $row = $stmt->fetch(PDO::FETCH_ASSOC);
         $realmoney = $row['realmoney'];
         if ($iconregistered) {
             $stmt = $db->prepare("SELECT username,balance FROM iConomy WHERE username= :login");
             $stmt->bindValue(':login', $login);
Example #5
0
function getSession()
{
    include "connect.php";
    $loginName = $_GET['user'];
    $login = mysql_real_escape_string($loginName);
    $query = "SELECT {$db_columnUser}, {$db_columnSesId} FROM {$db_table} WHERE {$db_columnUser}='{$login}'";
    $result = mysql_query($query) or die(mysql_error());
    $row = mysql_fetch_assoc($result);
    $sessionid = $row[$db_columnSesId];
    $sessid = strtoint(xorencode($sessionid, $sessidkey));
    die("4:" . $sessid);
}