ECSTORE1.2系统更改后台密码

时间:2022-11-12 07:59:05
<?php
 set_time_limit(0);

 error_reporting(E_ALL^E_NOTICE);

?>

<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">

<font size=2> ecstore 超级管理员admin 密码修改</font><br />

<form  action="ChgPass.php?act=shopex" method=post>

<font size=2>输入修改后密码:</font>

<input  name="password" type='text'   />

<input  name="submit" type='submit'   value=" Change "   />

</form>

<?php

if($_REQUEST['act']=='shopex'){
    include_once("config/config.php");
    $link=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
    mysql_select_db(DB_NAME);
    mysql_query("set names utf8");
    $table=DB_PREFIX."pam_account";
    $password=!empty($_REQUEST['password'])?trim($_REQUEST['password']):" ";
    function updatePassword($contents,$columns,$table){
        //新的加密方式
        $string_md5 = md5(md5($contents).'admin'.time());
        $front_string = substr($string_md5,0,31);
        $end_string = 's'.$front_string;

        //$contents=md5($contents);
        $sql="update $table set $columns='".$end_string."',createtime='".time()."' where login_name='admin' and account_type='shopadmin'";
        //print_r($sql);exit;
        //echo    "<font color='red' size='2'>执行SQL语句:$sql</font>";
        if(!mysql_query($sql)){
            echo "出现问题"."<br/><br/>".mysql_error();
        } else{
            echo "<font color='red' size='2'>修改密码成功!</font>";
        }
    }
    updatePassword($password,'login_password',$table);//如果客户有想要修改为特殊密码请修改888888为想要的!
} else{
    echo "<font color='red' size='2sss'>注意:请注意使用该脚本安全性,<br/>用完请及时删除!</font>";
}