function ToValidate($email) { global $show, $url; $smarty = InitSmarty(); $smarty->assign('email', $email); $smarty->assign('show', $show); $smarty->assign('url', $url); $smarty->display('validate.html'); exit; }
/* if(empty($captcha)) ShowError('请输入验证码',$url['login']); //判断验证码 include(ROOT_PATH.'/source/class/Captcha.class.php'); if(!Captcha::Check($captcha)) ShowError('验证码输入错误',$url['login']); */ $auto = Val('auto', 'POST', 1); if ($user->userId <= 0) { if ($user->Login($username, $userpwd, $auto)) { ShowSuccess('登录成功'); } else { ShowError('登录失败,请检查用户/邮箱或密码', $url['login']); } } break; case 'logout': if ($user->Logout()) { ShowSuccess('成功退出'); } break; default: if ($user->userId > 0) { ShowError('已经登录'); } $smarty = InitSmarty(); $smarty->assign('do', $do); $smarty->assign('show', $show); $smarty->assign('url', $url); $smarty->display('login.html'); break; }
die('Access Denied'); } $db = DBConnect(); $tbUser = $db->tbPrefix . 'user'; $tbSession = $db->tbPrefix . 'session'; $tbContent = $db->tbPrefix . 'content'; $tbComment = $db->tbPrefix . 'comment'; //社区概况 $situation = array(); $situation['userCount'] = $db->FirstValue("SELECT COUNT(*) FROM {$tbUser}"); //注册用户总数 $tbSession = $db->tbPrefix . 'session'; $situation['onlineCount'] = $db->FirstValue("SELECT COUNT(DISTINCT userId) FROM {$tbSession} WHERE updateTime>" . (time() - EXPIRES)); //在线用户总数 $situation['onlineUsers'] = $db->Dataset("SELECT DISTINCT u.id,u.userName FROM {$tbSession} s INNER JOIN {$tbUser} u ON u.id=s.userId WHERE updateTime>" . (time() - EXPIRES)); //在线用户 //系统环境 $sysInfo = array(); $sysInfo['sys_version'] = 'IT121 1.0'; $sysInfo['serverOS'] = PHP_OS; $sysInfo['serverSoftware'] = $_SERVER['SERVER_SOFTWARE']; $sysInfo['phpVersion'] = 'PHP v' . PHP_VERSION; $sysInfo['mysqlVersion'] = 'MySQL ' . $db->FirstValue('SELECT VERSION()'); include ROOT_PATH . '/source/common.php'; $smarty = InitSmarty(1); $smarty->assign('situation', $situation); $smarty->assign('sysInfo', $sysInfo); $smarty->assign('do', $do); $smarty->assign('show', $show); $smarty->assign('url', $url); $smarty->display('admin_index.html');
function Notice($str = '', $turnto = URL_ROOT, $time = 3, $style = 'success', $urltitle) { global $show, $url; $notice = array('str' => $str, 'turnto' => $turnto, 'time' => $time, 'style' => $style, 'urltitle' => $urltitle); $smarty = InitSmarty(); $smarty->assign('show', $show); $smarty->assign('url', $url); $smarty->assign('notice', $notice); $smarty->display('notice.html'); exit; }