Rumah > Soal Jawab > teks badan
<?php
/**
* Kelas asas muka depan
*/
kelas WebLoginBase memanjangkan WebBase{
public $type;
awam $groupId;
awam $dimainkan;
awam $NO;
awam $gameFanDian;
fungsi __construct($dsn, $user='', $password=''){
session_start();
if(!$this-SESSION& memberSessionName]){
header('lokasi: /user/logout');
exit('您没有登录');
}
cuba{
$duser:__n($user:n_build , $password);
//$this->gameFanDian=$this->getValue("pilih fanDian daripada {$this->prename}ahli where uid=?", $GLOBALS['SUPER-ADMIN- UID']);
// 限制同一个用户只能在一个地方登录
if(!$this->getValue("select isOnsct_member_d_users" ' ]} dan session_key=? perintah mengikut id desc had 1", session_id())){
session_unset();
session_destroy();
header('lokasi: /user/logout');
exit( '您已经退出登录,请重新登录');
}
/*$session_key=$this->getValue("pilih session_key from ssc_member_session';ui}'d=u dan isOnLine=1 pesanan mengikut id desc had 1");
if($session_key != session_id()){
header('lokasi: /user/logout');
exit('您已经退出登录请重新登录');
}*/
}tangkap(Pengecualian $e){
}
}
segar! pengguna ) return false;
$sessionId=$this->user['sessionId'];
if($this->user['testFlag']==1){
$sql="select * from {$this->prename}guestmembers where uid=?";
} else{
$sql="select * from {$this->prename}members where uid=?";
}
$ pengguna=$this->getRow($sql, $this->user['uid']);
$user['sessionId']=$sessionId;
$user['_gameFanDian']=$this ->getGameFanDian();
$_SESSION[$this->memberSessionName]=serialize($user);
$this->user=$user;
return true;
}
}
}fungsi awam getGameFanDian(){
if($this->gameFanDian) return $this->gameFanDian;
$this->getSystemSettings();
return $this->=$this-Dian ;settings['fanDianMax'];
}
public function getSystemSettings($expire=null){
if($expire===null) $expire=$this->expire;
$fail =$this->cacheDir . 'systemSettings'; if($expire && is_file($file) && filemtime($file)+$expire>$this->time){🎜🎜 return $this->settings=unserialize(file_get_contents($file ));🎜}
$sql="select * from {$this->prename}params";
$this->settings=array();
if($data=$this->getRows ($sql)){
foreach($data sebagai $var){
$ini->tetapan[$var['nama']]=$var['nilai'];
}
}
file_put_contents($file, serialize($this->settings));
return $this->settings;
}
$this->settings;(get public function) ,$expire=null){ if($expire < 30) $expire=$this->expire; $abbl=$cacheFile=='staticdata/gamedatas.php'; $file=$ abbl?$this->cacheDir.'/partNameList.dump':($this->cacheDir. '/systemplayed'.$getvalue.'_'.md5($cacheFile)); / / Jika fail cache wujud dan masa tidak melebihi 10 jam, set hasil cache akan digunakan terus tanpa sebarang pertanyaan MySQL if($expire && is_file($file) && time()-filemtime($file). < $expire) { //Gunakan hasil dalam cache if($abbl){ $parts=file_get_contents($this->cacheDir.'/partNameList.dump');
$cached= '';
foreach(json_decode($parts,1) sebagai $part){
$cached.=file_get_contents($part).';';
}
echo $cached
}lain { echo file_get_contents($file); } }else{ //Cache set keputusan ob_start();&$this-play . $partNameList= array();
foreach($obs sebagai $cached){
$part=explode('=',str_replace('var','',$cached));
$ partNameList[] =$this->cacheDir.'/'.trim($part[0]);
file_put_contents(end($partNameList),$cached); this-> ;cacheDir.'/partNameList.dump',json_encode($partNameList));
}else{
file_put_contents($file,$ob);
}
}
ob;
}/* public function delete_file($str){ $dir=$this->cacheDir; $list = scandir($dir); // Dapatkan semua fail dan folder di bawah fail ini foreach ($list as $file){//Traverse $file_location=$dir."/".$file;//Jana laluan if(is_dir($file_location) && $file!="." &&$ fail !=".."){ //Tentukan sama ada ia adalah folder //echo "-----------------------log masuk $ lokasi_fail- --------------------"; //delete_file($file_location); //Teruskan merentasi
}else if($file!="."&&$file!=".."){
if(substr_count($file,$str)>0){//如果文件名包含该字符串
. . '/'.md5($getvalue.$cacheFile); $actionTime=$this->getGameCachetime($getvalue); $cachefiletime=strtotime($actionTime); $file=$file.'_ '.$cachefiletime; if (is_file ($ file)) { echo file_get_contents ($ file); } else { // 删除 过期 缓存 $ this- & gt; delete_file (md5 ($ getValue. ; //将结果集缓存 ob_start(); $this->display($cacheFile); file_put_contents($file,ob_get_contents()); ob_end_flush(); } }*/ /** * Perubahan dalam dana pengguna * * Sila gunakannya dalam satu transaksi */ fungsi awam addCoin jika($log){['u set '])) $log['uid']=$this->user['uid'];
if(!isset($log['info'])) $log['info']='' ;
if(!isset($log['syiling'])) $log['coin']=0;
if(!isset($log['type'])) $log['type'] =0;
if(!isset($log['fcoin'])) $log['fcoin']=0;
if(!isset($log['extfield0'])) $log['extfield0 ']=0;
if(!isset($log['extfield1'])) $log['extfield1']='';
if(!isset($log['extfield2'])) $log ['extfield2']='';
$sql="call setCoin({$log['coin']}, {$log['fcoin']}, {$log['uid']}, {$log['liqType']}, {$log['type']}, '{$log['info']}', {$log['extfield0']}, '{$log['extfield1' ]}', '{$log['extfield2']}')";
//echo $sql;exit;
$this->insert($sql);
}
fungsi awam guestaddCoin($log){ if(!isset($log['uid'])) $log['uid']=$this->user['uid']; if(!isset ($log['info'])) $log['info']=''; if(!isset($log['syiling'])) $log['coin']=0; if (!isset($log['type'])) $log['type']=0; if(!isset($log['fcoin'])) $log['fcoin']=0;
if(!isset($log['extfield0'])) $log['extfield0']=0; if(!isset($log['extfield1'])) $log['extfield1']=' '; if(!isset($log['extfield2'])) $log['extfield2']='';
$sql="call guestsetCoin({$log['coin']}, {$log['fcoin']}, {$log['uid']}, {$log['liqType']}, {$ log['type']}, '{$log['info']}', {$log['extfield0']}, '{$log['extfield1']}', '{$log['extfield2' ]}')";
//echo $sql;exit;
$this->insert($sql);
}
/**
* Baca rebat yang ada
*/
(an public function getFan $uid=null){
if($uid===null){
if(!$uid=$this->user['parentId']){
return $this->params[' basePl'];
}
}
return $this->getValue("select fanDian from {$this->prename}members where parentId=?", intval($uid));
}
}}
查无此人2021-03-15 09:51:34
Mengakses terus tanpa log masuk adalah tidak selamat.
Adakah anda mahu membenarkan semua orang masuk tanpa log masuk, atau adakah anda mahu melakukannya hanya untuk diri sendiri tanpa log masuk?
Izinkan saya memberi anda idea:
1. Jika tiada sesiapa yang log masuk, buang sahaja pertimbangan pengguna.不 2. Terdapat dua jenis orang yang tidak log masuk kepada anda:
1. Jika alamat IP anda ditetapkan, anda boleh menentukan bahawa alamat IP adalah alamat anda dan terus masukkan.个 2. Anda boleh membuat halaman secara khusus, menggunakannya sendiri, masukkan halaman ini, dan log masuk secara automatik untuk masuk.