} elseif (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) { $onlineip = $_SERVER['REMOTE_ADDR']; } preg_match("/[\\d\\.]{7,15}/", $onlineip, $onlineipmatches); $onlineip = $onlineipmatches[0] ? $onlineipmatches[0] : ''; unset($onlineipmatches); if (empty($_GET['use_push'])) { if ($gzipenable && function_exists('ob_gzhandler')) { ob_start('ob_gzhandler'); } else { $gzipenable = 0; ob_start(); } } $dbcharset = !$dbcharset && in_array(strtolower($mcharset), array('gbk', 'big5', 'utf-8')) ? str_replace('-', '', $mcharset) : $dbcharset; $db = new cls_mysql(); $db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset); $authorization = md5($authkey); load_cache('grouptypes,permissions,repugrades'); sys_cache('nouserinfos'); $curuser = new cls_userinfo(); if (defined('M_ANONYMOUS')) { $curuser->activeuser(1); } else { $curuser->currentuser(); $memberid = $curuser->info['mid']; if ($phpviewerror == 2 || $phpviewerror == 1 && $curuser->isadmin()) { // error_reporting(2047); error_reporting(E_ERROR | E_WARNING | E_PARSE); } }
mcmessage('safecodeerr'); } $mname = trim($mname); $email = trim($email); if (strlen($mname) < 3 || strlen($mname) > 15) { mcmessage('membernamelenillegal'); } $guestexp = '\\xA1\\xA1|^Guest|^\\xD3\\xCE\\xBF\\xCD|\\xB9\\x43\\xAB\\xC8'; if (preg_match("/^\\s*\$|^c:\\con\\con\$|[%,\\*\"\\s\t\\<\\>\\&]|{$guestexp}/is", $mname)) { mcmessage('membercnameillegal'); } if (!$email || !isemail($email)) { mcmessage('emailillegal'); } $cmember = $db->fetch_one("SELECT mid,mname,email FROM {$tblprefix}members WHERE mname='{$mname}' AND email='{$email}'"); if (!$cmember) { mcmessage('nomemberemail'); } $actuser = new cls_userinfo(); $actuser->activeuser($cmember['mid']); if ($actuser->isadmin()) { mcmessage('mastercannotuse'); } unset($actuser); $confirmid = random(6); $confirmstr = "{$timestamp}\t1\t{$confirmid}"; $db->query("UPDATE {$tblprefix}members_sub SET confirmstr='{$confirmstr}' WHERE mid='{$cmember['mid']}'"); mailto("{$mname} <{$email}>", 'member_getpwd_subject', 'member_getpwd_content', array('mid' => $cmember['mid'], 'mname' => $mname, 'url' => "{$cms_abs}tools/lostpwd.php?action=getpwd&mid={$cmember['mid']}&id={$confirmid}", 'onlineip' => $onlineip)); mcmessage('lostpwd_send', $forward); } }