function message($key, $url = '') { global $link, $cmsgs; wap_header(wap_lang('wap_infotip')); $str = $cmsgs[$key] ? $cmsgs[$key] : $key; if (($num = func_num_args()) > 2) { $ars = func_get_args(); array_splice($ars, 1, 1); $ars[0] =& $str; $str = call_user_func_array('sprintf', $ars); } echo str_replace(array("\r\n", "\r", "\n"), '<br/>', wap_encode($str)) . '<br/>'; if ($url) { switch ($url) { case 'back': echo '<onevent type="ontimer"><prev/><timer value="20"/></onevent>' . '<anchor>' . wap_lang('wap_rightnowgoback') . '<prev/></anchor><br/>'; break; default: echo '<onevent type="ontimer"><go href="' . wap_encode($url) . '"/><timer value="20"/></onevent>' . '<a href="' . wap_encode($url) . '">' . wap_lang('wap_rightnowgoback') . '</a><br/>'; } } echo $link; wap_footer(); }
if ($curuser->info['password'] != $md5_password) { $curuser->updatefield('password', $md5_password); } if ($curuser->info['checked'] == 1) { $curuser->updatefield('lastvisit', $timestamp); $curuser->updatefield('lastip', $onlineip); $curuser->updatedb(); $memberid = $curuser->info['mid']; $z = '_' . rawurlencode(authcode("{$md5_password}\t" . $curuser->info['mid'], 'ENCODE')); login_safecheck($username, 0, 1); $forward = empty($forward) ? 'index.php' : $forward; message('wap_login_ok', $forward . (strpos($forward, '?') !== false ? '&z=' : '?z=') . $z, 'ret_index'); } elseif ($curuser->info['checked'] == 2) { //需要重新激活的会员 message('wap_out_member_active'); } else { message('wap_nocheck_member', 'back'); } } elseif ($enable_uc) { //UC帐号需要激活 message('wap_out_member_active'); } login_safecheck($username, $errtimes); $password = preg_replace("/^(.{" . round(strlen($password) / 4) . "})(.+?)(.{" . round(strlen($password) / 6) . "})\$/s", "\\1***\\3", $password); $record = mhtmlspecialchars($timestamp . "\t" . stripslashes($username) . "\t" . $password . "\t" . $onlineip); record2file('badlogin', $record); message($cantimes ? 'wap_login_failed' : 'wap_login_error_times', 'back', $cantimes); } elseif ($action == 'logout') { wap_header(wap_lang('wap_logout')); message('wap_logout_ok', empty($forward) ? 'index.php' : $forward); }