⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adm.inc.php

📁 asp新闻网站源码
💻 PHP
字号:
<?php 

/////////管理系统用户验证

function AdminCheck(){
	global $msql,$tbl_admin,$strAdminLoginErr1,$strAdminLoginErr2,$strAdminLoginErr3,$charset;
	ChkLic();
	
	$user=$_POST["user"];
	$password=$_POST["password"];
	$ImgCode=$_POST["ImgCode"];
	$oem=$_POST["oem"];

	if($user=="" || $password==""){
		echo "<html><head><title>LOGIN</title><meta http-equiv='Content-Type' content='text/html; charset=".$charset."'></head>";
		echo err($strAdminLoginErr1,"index.php","");
		exit;
	}
	$Ic=$_COOKIE["SYSIMG"];
	$Ic=strrev($Ic)+5*2-9;
	$Ic=substr ($Ic,0,4);

	if($oem!="yes" && ($ImgCode=="" || $Ic!=$ImgCode)){

	echo "<html><head><title>LOGIN</title><meta http-equiv='Content-Type' content='text/html; charset=".$charset."'></head>";
	echo err($strAdminLoginErr3,"index.php","");
	exit;
	}
	$md5pass=md5($password);


	$msql->query("select * from $tbl_admin where user='$user' and password='$md5pass'");
	if($msql->next_record()){
		$psd=$msql->f('password');
		$name=$msql->f('name');
		$tm=time();
		$md5=md5($user."l0aZXUYJ876Mn5rQoL55B".$psd.$tm);

		setCookie("SYSZC",$md5);
		setCookie("SYSUSER",$user);
		setCookie("SYSNAME",$name);
		setCookie("SYSTM",$tm);
		echo "<script>window.location='main.php'</script>";
		
	}else{
		
		echo "<html><head><title>LOGIN</title><meta http-equiv='Content-Type' content='text/html; charset=".$charset."'></head>";

		echo err($strAdminLoginErr2,"index.php","");
		exit;
		
	}
}

////////管理系统用户权限

function NeedAuth($au){

	global $msql,$tbl_admin,$tbl_admin_rights,$PHP_SELF;


	if(!isset($_COOKIE["SYSUSER"]) || $_COOKIE["SYSUSER"]==""){
		echo "<script>top.location='logout.php'</script>";	
		exit;
	}



	$msql->query("select * from $tbl_admin where user='".$_COOKIE["SYSUSER"]."'");
	if($msql->next_record()){

		$psd=$msql->f('password');

		$needmd5=md5($_COOKIE["SYSUSER"]."l0aZXUYJ876Mn5rQoL55B".$psd.$_COOKIE["SYSTM"]);
		if($needmd5!=$_COOKIE["SYSZC"]){
			echo "<script>top.location='logout.php'</script>";	
			exit;
		}

		if($au!="0"){
			$msql->query("select * from $tbl_admin_rights where user='".$_COOKIE["SYSUSER"]."' and auth='$au'");

			if($msql->next_record()){
			
			}else{
				echo "<script>window.location='noright.php'</script>";
				exit;
			}
		}

	}else{
		echo "<script>top.location='logout.php'</script>";
		exit;
	}
	
	

}


function sendback($reson){
	global $charset;
	echo "<html><head>
			<title>LOGIN</title><meta http-equiv='Content-Type' content='text/html; charset=".$charset."'></head>";
	echo "<script>alert(\"$reson\");
	window.location='javascript:history.back()';
	</script>";
	exit;
}



function TryLimit($tbl,$nums){

	ChkLic();
	
	global $msql;

	if(file_exists("../license.php")){
		include("../license.php");
	}else{
		echo "License Not Found";
		exit;
	}


	if($lic_3=="try"){
		$msql->query("select count(id) from $tbl");
		if($msql->next_record()){
			$WaStarCount=$msql->f('count(id)');
			if($WaStarCount>=$nums){

				echo "NOTICE : Limited For Try Version";
				exit;
			}
		}
	}

}


?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -