示例#1
0
         if (strlen($password) < 6) {
             msg('新密码最少6位,请修改');
         }
         if ($password != $cpassword) {
             msg('两次输入的密码不一致,请检查');
         }
         $r = $db->get_one("SELECT password FROM {$DT_PRE}member WHERE userid='{$_userid}'");
         if ($r['password'] != md5(md5($oldpassword))) {
             msg('现有密码错误,请检查');
         }
         if ($password == $oldpassword) {
             msg('新密码不能与现有密码相同');
         }
         $password = md5(md5($password));
         $db->query("UPDATE {$DT_PRE}member SET password='******' WHERE userid='{$_userid}'");
         userclean($_username);
         msg('管理员密码修改成功', '?action=main');
     } else {
         include tpl('password');
     }
     break;
 case 'static':
     if ($itemid) {
         foreach (array(DT_ROOT . '/file/flash/', DT_ROOT . '/file/image/', DT_ROOT . '/file/script/', DT_ROOT . '/skin/' . $CFG['skin'] . '/', DT_ROOT . '/' . $MODULE[2]['moduledir'] . '/image/', DT_ROOT . '/' . $MODULE[4]['moduledir'] . '/skin/') as $d) {
             $s = str_replace(DT_ROOT, DT_ROOT . '/file/static', $d);
             dir_copy($d, $s);
         }
         foreach (array(DT_ROOT . '/favicon.ico', DT_ROOT . '/lang/' . DT_LANG . '/lang.js') as $d) {
             $s = str_replace(DT_ROOT, DT_ROOT . '/file/static', $d);
             file_copy($d, $s);
         }
示例#2
0
                }
                if ($password != $cpassword) {
                    message($L['member_payword_match']);
                }
                $options = array('username', 'passport', 'email', 'mobile', 'company', 'qq', 'msn', 'ali', 'skype', 'userid');
                in_array($option, $options) or $option = 'username';
                $r = $db->get_one("SELECT username,groupid,passsalt FROM {$DT_PRE}member WHERE email='{$email}' AND `{$option}`='{$username}'");
                if ($r) {
                    $username = $r['username'];
                    if ($r['groupid'] == 4) {
                        message($L['send_password_checking']);
                    }
                    $authvalue = dpassword($password, $r['passsalt']);
                    $auth = make_auth($username);
                    $db->query("UPDATE {$DT_PRE}member SET auth='{$auth}',authvalue='{$authvalue}',authtime='{$DT_TIME}' WHERE username='******'");
                    userclean($username);
                    $authurl = $MOD['linkurl'] . 'send.php?auth=' . $auth;
                    $title = $L['send_password_mail'];
                    $content = ob_template('password', 'mail');
                    send_mail($email, $title, stripslashes($content));
                    dheader($MOD['linkurl'] . 'goto.php?action=password&email=' . $email);
                } else {
                    message($L['send_password_error']);
                }
            } else {
                $head_title = $L['send_password_title'];
                include template('send', $module);
            }
        }
        break;
}
示例#3
0
 function check($userid)
 {
     if (is_array($userid)) {
         foreach ($userid as $v) {
             $this->check($v);
         }
     } else {
         $this->userid = $userid;
         $user = $this->get_one();
         if ($user) {
             $groupid = $user['regid'] ? $user['regid'] : 6;
             $this->db->query("UPDATE {$this->table_member} SET groupid={$groupid} WHERE userid={$userid}");
             $this->db->query("UPDATE {$this->table_company} SET groupid={$groupid} WHERE userid={$userid}");
             userclean($user['username']);
         }
         return true;
     }
 }