source/index/wxlogin.ctrl.php

(开头部分) 7KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
class wxloginControl extends skymvc{
	
	public function __construct(){
		parent::__construct();
	}
	
	public function onInit(){
		if($_SESSION['ssuser']){
			header("Location: /index.php");
			exit;
		}
		$wid=get_post('wid','i');
		if($wid){
			$where=" id=".$wid;
		}else{
			$where="";
		}
		$this->wx=M("weixin")->selectRow(array("where"=>$where,"order"=>"id DESC"));
		$backurl=get_post('backurl','h');
		if(!$backurl){
			$backurl=$_SERVER['HTTP_REFERER'];
		}
		if(preg_match("/login/i",$backurl)){
			$backurl="/index.php";
		}
		define("WXTOKEN",$this->wx['token']);
		define("APPID",$this->wx['appid']);
		define("APPSECRET",$this->wx['appkey']);
		define("REDIRECT_URI","http://".$_SERVER['HTTP_HOST']."/index.php?m=wxlogin&a=callback&backurl=".urlencode($backurl)."&wid=".$this->wx['id']);
	}
	public function upload_oss($files){
		$this->loadClass("image");
		$this->loadClass("upload");

		$this->upload->uploaddir="attach/".$this->sitedir; 
	 
		if(empty($_SESSION['ssuser']) && empty($_SESSION['ssadmin']) && empty($_SESSION['ssshopadmin'])){
			$this->goall("die access",1);
		}
		session_write_close();
		set_time_limit(100);
		include_once(ROOT_PATH."api/ossapi/ossapi.php");
		if(!UPLOAD_OSS) return false;
		if(empty($files)) return false;
		$arr=array("",".100x100.jpg",".small.jpg",".middle.jpg");
		foreach($arr as $a){		
			if(file_exists(ROOT_PATH.$files.$a)){
				$to=str_replace("//","/",$files.$a);
				$from=ROOT_PATH.$files.$a;
				$response = oss_upload_file(array("bucket"=>OSS_BUCKET,"to"=>$to,"from"=>$from));
				if(defined("UPLOAD_DEL") && UPLOAD_DEL){
					@unlink($from);
				}
			}
		}
	}
	public function onDefault(){
		echo "hello";
	}
后面还有 198 行代码,购买后查看完整代码

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

AI 解读 AI

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

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