ucenter创始人密码忘了解决方法

打开uc下面/data/config.inc.php文件

里面有

define('UC_FOUNDERPW', '924a2bd32289075d8055e7e30261dfb1');

define('UC_FOUNDERSALT', '116414');

记下116414这个值,然后

用php输出下面的一个代码

$ucfounderpw= md5(md5($ucfounderpw).$ucsalt);

其中$ucsalt就是116414(这个根据您的需要而定)

$ucfounderpw是您要设置的密码。

得到的$ucfounderpw替换

define('UC_FOUNDERPW', '924a2bd32289075d8055e7e30261dfb1');

这个里面的924a2bd32289075d8055e7e30261dfb1就可以了。

还有另外一种方法,将以下代码保存为PHP,传至UC根目录,运行即可

“<?php

define(ROOT_DIR,dirname(__FILE__)."/");

if(!file_exists('./data/config.inc.php') || !is_writeable('./data')){

   $isucdir= 0;

   echo 'UCenter创始人密码重置工具必须放在UCenter根目录下才能正常使用.';

   exit;

  

}else{

   $isucdir = 1;

}

$info="";

setucadministrator();

function setucadministrator(){

global $isucdir;

global $info;

if($_POST['setucsubmit']){

  

   if($isucdir){

    $configfile = ROOT_DIR."./data/config.inc.php";

    $uc_password = $_POST["uc_password"];

    $salt = substr(uniqid(rand()), 0, 6);

    if(!$uc_password){

     $info = "密码不能为空";

    

    }else{

    

     $md5_uc_password = md5(md5($uc_password).$salt);

     $config = file_get_contents($configfile);

     $config = preg_replace("/define\('UC_FOUNDERSALT',\s*'.*?'\);/i", "define('UC_FOUNDERSALT', '$salt');", $config);

     $config = preg_replace("/define\('UC_FOUNDERPW',\s*'.*?'\);/i", "define('UC_FOUNDERPW', '$md5_uc_password');", $config);

     $fp = @fopen($configfile, 'w');

     @fwrite($fp, $config);

     @fclose($fp);

     $info = "UCenter创始人密码更改成功为:$uc_password";

    }

   }else{

    $info = "本程序文件放置在UCenter跟目录,才能通过程序修改UCenter创始人管理员的密码<br />";

   }

}

templates("setucadministrator");

}

function errorpage($message,$title = '',$isheader = 1,$isfooter = 1){

   $message = "<h4>$title</h4><br><br><table><tr><th> 提示信息</th></tr><tr><td>$message</td>< /tr></table>";

   echo $message;

   exit;

}

function templates($tpl){

switch ($tpl){

   case "header":

    echo '<html>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">

    <title>UCenter 创始人密码更改工具</title>

    <style type="text/css">

    <!--

    body {font-family: Arial, Helvetica, sans-serif, "宋体";font-size: 12px;color:#000;line-height: 120%;padding:0;margin:0;background:#DDE0FF;overflow-x:hidden;word-break:break-all;white-space:normal;scrollbar-3d-light-color:#606BFF;scrollbar-highlight-color:#E3 EFF9;scrollbar-face-color:#CEE3F4;scrollbar-arrow-color:#509AD8;scrollbar-shadow-color:#F0F1FF;scrollbar-base-color:#CEE3F4;}

    a:hover {color:#60F;}

    ul {padding:2px 0 10px 0;margin:0;}

    textarea,table,td,th,select{border:1px solid #868CFF;border-collapse:collapse;}

    input{margin:10px 0 0px 30px;border-width:1px;border-style:solid;border-color:#FFF #64A7DD #64A7DD #FFF;padding:2px 8px;background:#E3EFF9;}

    input.radio,input.checkbox,input.textinput,input.specialsubmit {margin:0;padding:0;border:0;padding:0;background:none;}

    input.textinput,input.specialsubmit {border:1px solid #AFD2ED;background:#FFF;height:24px;}

    input.textinput {padding:4px 0;}     input.specialsubmit {border-color:#FFF #64A7DD #64A7DD #FFF;background:#E3EFF9;padding:0 5px;}

    option {background:#FFF;}

    select {background:#F0F1FF;}

    #header {height:60px;width:100%;padding:0;margin:0;}

      h2 {font-size:24px;font-weight:bold;position:absolute;top:24px;left:20px;padding:10px;margin:0;}

      h3 {font-size:14px;position:absolute;top:28px;right:20px;padding:10px;margin:0;}

    #content {height:510px;background:#F0F1FF;overflow-x:hidden;z-index:1000;}

      #nav {top:60px;left:0;height:510px;width:180px;border-right:1px solid #DDE0FF;position:absolute;z-index:2000;}

          #nav ul {padding:0 10px;padding-top:30px;}

          #nav li {list-style:none;}

          #nav li a {font-size:14px;line-height:180%;font-weight:400;color:#000;}

          #nav li a:hover {color:#60F;}

      #textcontent {padding-left:200px;height:510px;width:100%;line-height:160%;overflow-y:auto;overflow-x:hidden;}

       h4,h5,h6 {padding:4px;font-size:16px;font-weight:bold;margin-top:20px;margin-bottom:5px;color:#006;}

     h5,h6 {font-size:14px;color:#000;}

     h6 {color:#F00;padding-top:5px;margin-top:0;}

     .specialdiv {width:70%;border:1px dashed #C8CCFF;padding:0 5px;margin-top:20px;background:#F9F9FF;}

     #textcontent ul {margin-left:30px;}

     textarea {width:78%;height:320px;text-align:left;border-color:#AFD2ED;}

     select {border-color:#AFD2ED;}

     table {width:74%;font-size:12px;margin-left:18px;margin-top:10px;}

        table.specialtable,table.specialtable td {border:0;}

      td,th {padding:5px;text-align:left;}

        caption {font-weight:bold;padding:8px 0;color:#3544FF;text-align:left;}

        th {background:#D9DCFF;font-weight:600;}

      td.specialtd {text-align:left;}

     .specialtext {background:#FCFBFF;margin-top:20px;padding:5px 40px;width:64.5%;margin-bottom:10px;color:#006;}

    #footer p {padding:0 5px;text-align:center;}

    -->

    </style>

    </head>

    <body>

   

   

    <div id="content">

    <div id="textcontent">';

    break;

   case "footer":

    echo '

      </div></div>

      <div id="footer"><p>UCenter 创始人密码更改工具 &nbsp;

      版权所有 &copy;2001-2007 <a href="http://banu.blog.163.com/blog/http://www.comsenz.com" style="color: #888888; text-decoration: none">

      康盛创想(北京)科技有限公司 Comsenz Inc.</a></font></td></tr><tr style="font-size: 0px; line-height: 0px; spacing: 0px; padding: 0px; background-color: #698CC3">

      </p></div>

      </body>

      </html>';

    exit;

    break;

  

   case "setucadministrator":

    templates("header");

    if(!empty($_POST['setucsubmit'])){

     echo "<h5>UCenter 创始人密码更改工具</h5><h5> <font color=red>使用完毕后请及时删除本文件,以免给您造成不必要的损失</font></h5>";

     echo '<form action="?action=setadmin" method="post"><input type="hidden" name="action" value="login" />';

     global $info;

     errorpage($info,'',0,0);

     echo '</form>';

    }else{

     echo '<form action="?action=setucadministrator" method="post">

     <h5>UCenter 创始人密码更改工具</h5>

     <h5> <font color=red>使用完毕后请及时删除本文件,以免给您造成不必要的损失</font></h5>

     <table>

     <tr><th width="30%">用户名</th><td width="70%"><input class="textinput" readonly="readonly" disabled type="text" name="username" size="25" maxlength="40" value="UCenter Administrator"></td></tr>

     <tr><th width="30%">请输入密码</th><td width="70%"><input class="textinput" type="text" name="uc_password" size="25"></td></tr>

    

     </table>

     <input type="submit" name="setucsubmit" value="提 &nbsp; 交">

     </form>';

    }

    templates("footer");

    break;

}

}

?>”

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

卷边书_王诣

您的鼓励,是我创作的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值