module/flk/source/model/flk_login.model.php

(完整代码) 1KB

<?php
class flk_loginModel extends model{
	public $table="mod_flk_admin";
	public $key="asdasd";
	public function __construct(){
		parent::__construct();
	}
	public function setCode($admin){
		require ROOT_PATH."extends/hashids/Hashids.php";
		$hashids = new Hashids\Hashids($this->key,6);
		$icode=$hashids->encode($admin["adminid"]);
		return $icode.".".substr(md5($admin["password"]),0,8);
	}
	public function codeLogin(){
		$code=get("authcode","h");
		$arr=explode(".",$code);
		if(!isset($arr[1])){
			return false;
		}
		require ROOT_PATH."extends/hashids/Hashids.php";
		$hashids = new Hashids\Hashids($this->key,6);
		$adm=$hashids->decode($arr[0]);
		$adminid=$adm[0];
		if(!$adminid){
			return false;
		}
		$admin=$this->selectRow("adminid=".$adminid);
		
		$p=substr(md5($admin["password"]),0,8);
		
		if($p==$arr[1]){
			$_SESSION['mflk_shop_admin']=array(
				"shopid"=>$admin["shopid"],
				"adminname"=>$admin["adminname"],
				"xlasttime"=>$admin["lasttime"],
				"lasttime"=>date("Y-m-d H:i:s"),
				"adminid"=>$admin["adminid"]
			);
			return $admin;
		}
		return false;	
	}
}
?>

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。