使用方法:
新建文件password.php复制下方文件 在/e/extend/目录etBECMSPLUS
然后访问你的域名/e/extend/password.php,再点击确认重置即可看到新的账号密码了,记住这个账号密码然后点登录后台就可以了etBECMSPLUS
etBECMSPLUS
重置密码
<?php
etBECMSPLUS/**
etBECMSPLUS *
帝国cms重置密码工具
etBECMSPLUS * Powered by ECMSPLUS https://www.ecmsplus.com
etBECMSPLUS */
etBECMSPLUSerror_reporting(E_ALL ^ E_NOTICE);
etBECMSPLUSrequire('../class/connect.php');
etBECMSPLUSrequire('../class/db_sql.php');
etBECMSPLUSrequire('../class/functions.php');
etBECMSPLUS$link=db_connect();
etBECMSPLUS$empire=new mysqlquery();
etBECMSPLUS$extend_r['ename']='ECMSPLUS
帝国cms密码重置工具';
etBECMSPLUS//重置
etBECMSPLUSfunction chongzhi(){
etBECMSPLUS global $empire,$dbtbpre;
etBECMSPLUS $pr=$empire->fetch1("select userid from {$dbtbpre}enewsuser where username='admin' limit 1");
etBECMSPLUS if($pr){
etBECMSPLUS $rnd=make_password(20);
etBECMSPLUS $salt=make_password(8);
etBECMSPLUS $salt2=make_password(20);
etBECMSPLUS $password=DoEmpireCMSAdminPassword('ecmsplus.com',$salt,$salt2);
etBECMSPLUS $empire->query("update `{$dbtbpre}enewsuser` set rnd='$rnd',password='$password',salt='$salt',salt2='$salt2' where userid=$pr[userid]");
etBECMSPLUS echo '密码重置成功,账号为:admin,密码为:ecmsplus.com,记得马上登陆后台修改密码';
etBECMSPLUS }else{
etBECMSPLUS $insert_class="|";
etBECMSPLUS $styleid=1;
etBECMSPLUS $groupid=1;
etBECMSPLUS $checked=0;
etBECMSPLUS $filelevel=0;
etBECMSPLUS $classid=0;
etBECMSPLUS $rnd=make_password(20);
etBECMSPLUS $salt=make_password(8);
etBECMSPLUS $salt2=make_password(20);
etBECMSPLUS $password=DoEmpireCMSAdminPassword('ecmsplus.com',$salt,$salt2);
etBECMSPLUS $addtime=time();
etBECMSPLUS $addip=egetip();
etBECMSPLUS $addipport=egetipport();
etBECMSPLUS $userprikey=make_password(48);
etBECMSPLUS $sql=$empire->query("insert into {$dbtbpre}enewsuser(username,password,rnd,groupid,adminclass,checked,styleid,filelevel,salt,loginnum,lasttime,lastip,truename,email,classid,addtime,addip,userprikey,salt2,lastipport,preipport,addipport,wname,tel,wxno,qq) values('admin','$password','$rnd','$groupid','$insert_class','$checked','$styleid','$filelevel','$salt',0,0,'','$truename','$email','$classid','$addtime','$addip','$userprikey','$salt2','$addipport','$addipport','$addipport','$wname','$tel','$wxno','$qq');");
etBECMSPLUS $userid=$empire->lastid();
etBECMSPLUS if($userid){
etBECMSPLUS $empire->query("insert into {$dbtbpre}enewsuseradd(userid,equestion,eanswer,openip) values('$userid',0,'','');");
etBECMSPLUS echo '密码重置成功,账号为:admin,密码为:ecmsplus.com,记得马上登陆后台修改密码';
etBECMSPLUS }else{
etBECMSPLUS echo '密码重置失败,请联系作者https://www.ecmsplus.com';
etBECMSPLUS }
etBECMSPLUS }
etBECMSPLUS}
etBECMSPLUS etBECMSPLUSif($_POST['ecms']=="chongzhi")
etBECMSPLUS{
etBECMSPLUS chongzhi();
etBECMSPLUS}
etBECMSPLUS?>
etBECMSPLUS<html>
etBECMSPLUS<head>
etBECMSPLUS<meta http-equiv="Content-Type" content="text/html; charset=<?=$pagechar?>">
etBECMSPLUS<title><?=$extend_r['ename']?></title>
etBECMSPLUS<style>
etBECMSPLUSa:link { COLOR: #003399; TEXT-DECORATION: none }
etBECMSPLUSa:visited { COLOR: #000000 ; TEXT-DECORATION: none }
etBECMSPLUSa:active { COLOR: #000000 ; TEXT-DECORATION: underline }
etBECMSPLUSa:hover { COLOR: #000000 ; TEXT-DECORATION:underline }
etBECMSPLUS.home_top { border-top:2px solid #4798ED; }
etBECMSPLUS.home_path { background:#4798ED; padding-right:10px; color:#F0F0F0; font-size: 11px; }
etBECMSPLUStd, th, caption { font-family: "宋体"; font-size: 14px; color:#000000; LINE-HEIGHT: 165%; }
etBECMSPLUS.hrLine{MARGIN: 0px 0px; BORDER-BOTTOM: #807d76 1px dotted;}
etBECMSPLUS</style>
etBECMSPLUS<script>
etBECMSPLUSfunction CheckUpdate(obj){
etBECMSPLUS if(confirm('确认操作?'))
etBECMSPLUS {
etBECMSPLUS obj.updatebutton.disabled=true;
etBECMSPLUS return true;
etBECMSPLUS }
etBECMSPLUS return false;
etBECMSPLUS}
etBECMSPLUS</script>
etBECMSPLUS</head>
etBECMSPLUS<body>
etBECMSPLUS<form method="POST" action="password.php" name="formupdate" onSubmit="return CheckUpdate(document.formupdate);">
etBECMSPLUS <br>
etBECMSPLUS <br>
etBECMSPLUS <br>
etBECMSPLUS <table width="500" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#4FB4DE">
etBECMSPLUS <tr>
etBECMSPLUS <td height="30" colspan="2"> <div align="center"><strong><font color="#FFFFFF"><?=$extend_r['ename']?> </font></strong></div></td>
etBECMSPLUS </tr>
etBECMSPLUS <tr bgcolor="#FFFFFF">
etBECMSPLUS <td width="141" height="36">
etBECMSPLUS <div align="right">选择操作:</div></td>
etBECMSPLUS <td>
etBECMSPLUS <input type=submit name=updatebutton value="确认重置"> <input name="ecms" type="hidden" id="ecms" value="chongzhi">
etBECMSPLUS </td>
etBECMSPLUS </tr>
etBECMSPLUS <tr bgcolor="#FFFFFF">
etBECMSPLUS <td width="141" height="36">
etBECMSPLUS <div align="right">作者信息:</div></td>
etBECMSPLUS <td>
etBECMSPLUS <span style="float:left">网址:<a href="https://www.ecmsplus.com">https://www.ecmsplus.com</a></span>
etBECMSPLUS </td>
etBECMSPLUS </tr>
etBECMSPLUS </table>
etBECMSPLUS </form>
etBECMSPLUS etBECMSPLUS </body>
etBECMSPLUS </html>
etBECMSPLUS <?
etBECMSPLUS db_close();
etBECMSPLUS $empire=null;
etBECMSPLUS exit();
etBECMSPLUS ?>
etBECMSPLUSetBECMSPLUS修改密码
etBECMSPLUSetBECMSPLUS<?php
etBECMSPLUSdefine('EmpireCMSAdmin','1');
etBECMSPLUS$ecms_config=array();
etBECMSPLUS$do_loginauth='';
etBECMSPLUSrequire('../class/connect.php');
etBECMSPLUSrequire('../class/db_sql.php');
etBECMSPLUSrequire('../class/functions.php');
etBECMSPLUS$link=db_connect();
etBECMSPLUS$empire=new mysqlquery();
etBECMSPLUSetBECMSPLUS//------- 插件参数设置开始 -----
etBECMSPLUSetBECMSPLUS//进入重置页面密码
etBECMSPLUS$pagepassword='123456';
etBECMSPLUSetBECMSPLUS//------- 插件参数设置结束 -----
etBECMSPLUSetBECMSPLUSetBECMSPLUS@header('Content-Type: text/html; charset=gb2312');
etBECMSPLUSetBECMSPLUS//重置密码
etBECMSPLUSfunction user_ResetUser($add){
etBECMSPLUS global $empire,$dbtbpre;
etBECMSPLUS user_CheckGotoPagePass();
etBECMSPLUS $userid=(int)$add['userid'];
etBECMSPLUS $password=RepPostVar($add['password']);
etBECMSPLUS if(!$userid||!$password||!$add['repassword'])
etBECMSPLUS {
etBECMSPLUS printerror2('请输入重置的新密码','');
etBECMSPLUS }
etBECMSPLUS if($password<>$add['repassword'])
etBECMSPLUS {
etBECMSPLUS printerror2('两次输入的密码不一致','');
etBECMSPLUS }
etBECMSPLUS if(strlen($password)<6)
etBECMSPLUS {
etBECMSPLUS printerror2('密码不能少于6位','');
etBECMSPLUS }
etBECMSPLUS if(function_exists('DoEmpireCMSAdminPassword'))
etBECMSPLUS {
etBECMSPLUS $salt=make_password(8);
etBECMSPLUS $salt2=make_password(20);
etBECMSPLUS $password=DoEmpireCMSAdminPassword($password,$salt,$salt2);
etBECMSPLUS $a="password='$password',salt='$salt',salt2='$salt2'";
etBECMSPLUS }
etBECMSPLUS else
etBECMSPLUS {
etBECMSPLUS $salt=make_password(8);
etBECMSPLUS $password=md5(md5($password).$salt);
etBECMSPLUS $a="password='$password',salt='$salt'";
etBECMSPLUS }
etBECMSPLUS $sql=$empire->query("update {$dbtbpre}enewsuser set ".$a." where userid='$userid'");
etBECMSPLUS if($add['noquestion']==1)
etBECMSPLUS {
etBECMSPLUS $addsql=$empire->query("update {$dbtbpre}enewsuseradd set equestion='0',eanswer='' where userid='$userid'");
etBECMSPLUS }
etBECMSPLUS echo"<script>self.location.href='resetuser.php?ecms=success';</script>";
etBECMSPLUS exit();
etBECMSPLUS}
etBECMSPLUSetBECMSPLUS//返回用户列表
etBECMSPLUSfunction user_ReturnUserlist(){
etBECMSPLUS global $empire,$dbtbpre;
etBECMSPLUS $users='';
etBECMSPLUS $sql=$empire->query("select userid,username from {$dbtbpre}enewsuser");
etBECMSPLUS while($r=$empire->fetch($sql))
etBECMSPLUS {
etBECMSPLUS $users.="<option value='".$r[userid]."'>".$r[username]."</option>";
etBECMSPLUS }
etBECMSPLUS return $users;
etBECMSPLUS}
etBECMSPLUSetBECMSPLUS//登陆验证
etBECMSPLUSfunction user_GotoPagePassword($ckpassword){
etBECMSPLUS global $pagepassword;
etBECMSPLUS if($pagepassword<>$ckpassword)
etBECMSPLUS {
etBECMSPLUS printerror2('页面密码错误','');
etBECMSPLUS }
etBECMSPLUS @setcookie('ckecmspagepass',md5($ckpassword));
etBECMSPLUS echo"<script>self.location.href='resetuser.php?ecms=resetpage';</script>";
etBECMSPLUS exit();
etBECMSPLUS}
etBECMSPLUSetBECMSPLUS//验证信息
etBECMSPLUSfunction user_CheckGotoPagePass(){
etBECMSPLUS global $pagepassword;
etBECMSPLUS if(md5($pagepassword)<>$_COOKIE['ckecmspagepass'])
etBECMSPLUS {
etBECMSPLUS printerror2('您还未验证权限','resetuser.php');
etBECMSPLUS }
etBECMSPLUS}
etBECMSPLUSetBECMSPLUS$ecms=$_POST['ecms'];
etBECMSPLUSif(empty($ecms))
etBECMSPLUS{
etBECMSPLUS $ecms=$_GET['ecms'];
etBECMSPLUS}
etBECMSPLUSetBECMSPLUSif($ecms=='GotoPagePassword')//登陆验证
etBECMSPLUS{
etBECMSPLUS user_GotoPagePassword($_POST['ckpassword']);
etBECMSPLUS}
etBECMSPLUSelseif($ecms=='ResetUser')//重置密码
etBECMSPLUS{
etBECMSPLUS user_ResetUser($_POST);
etBECMSPLUS}
etBECMSPLUS?>
etBECMSPLUS<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
etBECMSPLUS<html>
etBECMSPLUS<head>
etBECMSPLUS<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
etBECMSPLUS<link rel="stylesheet" href="https://m.ecmsplus.com/themes/css/bootstrap.min.css" type="text/css" media="all" />
etBECMSPLUS<title>重置管理员密码</title>
etBECMSPLUS etBECMSPLUS<script>
etBECMSPLUSfunction CheckUserInfo(obj){
etBECMSPLUS if(obj.userid.value=='')
etBECMSPLUS {
etBECMSPLUS alert('请选择要重置的用户');
etBECMSPLUS obj.userid.focus();
etBECMSPLUS return false;
etBECMSPLUS }
etBECMSPLUS if(obj.password.value=='')
etBECMSPLUS {
etBECMSPLUS alert('请输入重置的新密码');
etBECMSPLUS obj.password.focus();
etBECMSPLUS return false;
etBECMSPLUS }
etBECMSPLUS if(obj.password.value!=obj.repassword.value)
etBECMSPLUS {
etBECMSPLUS alert('两次输入的密码不一致');
etBECMSPLUS obj.password.focus();
etBECMSPLUS return false;
etBECMSPLUS }
etBECMSPLUS if(obj.password.value.length<6)
etBECMSPLUS {
etBECMSPLUS alert('密码不能少于6位');
etBECMSPLUS obj.password.focus();
etBECMSPLUS return false;
etBECMSPLUS }
etBECMSPLUS return true;
etBECMSPLUS}
etBECMSPLUS</script>
etBECMSPLUS</head>
etBECMSPLUS<body>
etBECMSPLUS<br>
etBECMSPLUS<br>
etBECMSPLUS<br>
etBECMSPLUS<?php
etBECMSPLUSif($ecms=='success')
etBECMSPLUS{
etBECMSPLUS user_CheckGotoPagePass();
etBECMSPLUS?>
etBECMSPLUS<table class="table table-condensed">
etBECMSPLUS <tr>
etBECMSPLUS <td height="30"><div align="center"><strong><font color="#FFFFFF">已完成重置</font></strong></div></td>
etBECMSPLUS </tr>
etBECMSPLUS <tr>
etBECMSPLUS <td height="120" bgcolor="#FFFFFF">
etBECMSPLUS <div align="center"><font color="#FF0000"><strong>恭喜!密码重置完毕,现在您可以用新的密码登陆后台了。</strong><br>
etBECMSPLUS <br>
etBECMSPLUS <br>
etBECMSPLUS </font>(友情提示:建议马上删除 /e/extend/password.php 文件,防止被重复使用。) </div></td>
etBECMSPLUS </tr>
etBECMSPLUS</table>
etBECMSPLUS<?php
etBECMSPLUS}
etBECMSPLUSelseif($ecms=='resetpage')
etBECMSPLUS{
etBECMSPLUS user_CheckGotoPagePass();
etBECMSPLUS?>
etBECMSPLUS<form name="reseteform" method="post" action="resetuser.php" onSubmit="return CheckUserInfo(document.reseteform);">
etBECMSPLUS <table class="table table-condensed">
etBECMSPLUS <tr>
etBECMSPLUS <td height="30" colspan="2"><strong><font color="#FFFFFF">重置管理员密码:</font></strong></td>
etBECMSPLUS </tr>
etBECMSPLUS <tr>
etBECMSPLUS <td width="146" height="25" bgcolor="#FFFFFF">用户:</td>
etBECMSPLUS <td width="339" bgcolor="#FFFFFF"><select name="userid" id="userid">
etBECMSPLUS <?=user_ReturnUserlist()?>
etBECMSPLUS </select></td>
etBECMSPLUS </tr>
etBECMSPLUS <tr>
etBECMSPLUS <td height="25" bgcolor="#FFFFFF">新密码:</td>
etBECMSPLUS <td bgcolor="#FFFFFF"><input name="password" type="password" id="password"></td>
etBECMSPLUS </tr>
etBECMSPLUS <tr>
etBECMSPLUS <td height="25" bgcolor="#FFFFFF">重复新密码:</td>
etBECMSPLUS <td bgcolor="#FFFFFF"><input name="repassword" type="password" id="repassword"></td>
etBECMSPLUS </tr>
etBECMSPLUS <tr>
etBECMSPLUS <td height="25" bgcolor="#FFFFFF">安全问题设为空:</td>
etBECMSPLUS <td bgcolor="#FFFFFF"><input name="noquestion" type="checkbox" id="noquestion" value="1" checked>
etBECMSPLUS 清空安全问题</td>
etBECMSPLUS </tr>
etBECMSPLUS <tr>
etBECMSPLUS <td height="25" bgcolor="#FFFFFF">当前认证码为:</td>
etBECMSPLUS <td bgcolor="#FFFFFF"><?=$do_loginauth?$do_loginauth:$ecms_config['esafe']['loginauth']?></td>
etBECMSPLUS </tr>
etBECMSPLUS <tr>
etBECMSPLUS <td height="25" bgcolor="#FFFFFF"> </td>
etBECMSPLUS <td bgcolor="#FFFFFF"><input type="submit" name="Submit" value="马上重置登录信息">
etBECMSPLUS <input name="ecms" type="hidden" id="ecms" value="ResetUser"></td>
etBECMSPLUS </tr>
etBECMSPLUS <tr>
etBECMSPLUS <td height="25" colspan="2" bgcolor="#FFFFFF"><font color="#666666">说明:密码设置6位以上,且密码不能包含:$
etBECMSPLUS & * # < > ' " / \ % ; 空格</font></td>
etBECMSPLUS </tr>
etBECMSPLUS </table>
etBECMSPLUS</form>
etBECMSPLUS<?php
etBECMSPLUS}
etBECMSPLUSelse
etBECMSPLUS{
etBECMSPLUS?>
etBECMSPLUS<form name="loginform" method="post" action="resetuser.php">
etBECMSPLUS <table class="table table-condensed">
etBECMSPLUS <tr>
etBECMSPLUS <td height="30" colspan="2"><strong><font color="#FFFFFF">进入重置页面密码:</font></strong></td>
etBECMSPLUS </tr>
etBECMSPLUS <tr>
etBECMSPLUS <td width="146" height="25" bgcolor="#FFFFFF">输入密码:</td>
etBECMSPLUS <td width="339" bgcolor="#FFFFFF"><input name="ckpassword" type="password" id="password"></td>
etBECMSPLUS </tr>
etBECMSPLUS <tr>
etBECMSPLUS <td height="25" bgcolor="#FFFFFF"> </td>
etBECMSPLUS <td bgcolor="#FFFFFF"><input type="submit" name="Submit2" value="进入重置登录页面">
etBECMSPLUS <input name="ecms" type="hidden" id="ecms" value="GotoPagePassword"></td>
etBECMSPLUS </tr>
etBECMSPLUS </table>
etBECMSPLUS</form>
etBECMSPLUS<?php
etBECMSPLUS}
etBECMSPLUS?>
etBECMSPLUS</body>
etBECMSPLUS</html>
etBECMSPLUS<?php
etBECMSPLUSdb_close();
etBECMSPLUS$empire=null;
etBECMSPLUS?>