function pagelogin($inPath) { $kv = new SaeKV(); $ret = $kv->init(); if (!$ret) { $this->ShowMsg("你没有初始化KVDB!"); } if (!file_exists('saekv://' . $_SERVER['HTTP_APPVERSION'] . '/install.lock')) { $this->ShowMsg("你还没有安装smpss!", base_Constant::ROOT_DIR . '/install/index.php'); } $urlParams = $this->getUrlParams($inPath); if (!$_POST) { $this->params['head_title'] = "管理登录-" . $this->params['head_title']; return $this->render("main/login.html", $this->params); } else { $_POST = base_Utils::shtmlspecialchars($_POST); //session_start(); //if(!SCaptcha::check($_POST['captcha'])){ $modelAdmin = new m_admin(); $loginInfo = $modelAdmin->checkLogin($_POST['username'], $_POST['pwd'], (int) $_POST['timeout']); if ($loginInfo) { $this->redirect($this->createUrl('/')); } else { $this->ShowMsg("用户名或者密码错误!"); } //}else{ //$this->ShowMsg("验证码错误!"); //} } }
function pagemodifypwd($inPath) { $admin_id = (int) $_COOKIE['admin_id']; if ($_POST) { $adminObj = new m_admin(); $post = base_Utils::shtmlspecialchars($_POST); $resPwd = $adminObj->get("admin_id = {$admin_id}", 'admin_pwd'); if ($resPwd['admin_pwd'] == md5($post['old_pwd']) and $post['new_pwd'] == $post['new_pwd2'] and $post['new_pwd']) { $pwd = md5($post['new_pwd']); $rs = $adminObj->update("admin_id = {$admin_id}", "admin_pwd = '{$pwd}'"); if ($rs) { $this->ShowMsg('修改成功', $this->createUrl('/account/modifypwd'), '', 1); } else { $this->ShowMsg('修改失败,请重试!错误原因:' . $adminObj->getError()); } } else { $this->ShowMsg('原密码错误或者两次新密码不一致!'); } } return $this->render('account/modifypwd.html', $this->params); }
function pagelogin($inPath) { $urlParams = $this->getUrlParams($inPath); if (!$_POST) { $this->params['head_title'] = "管理登录-" . $this->params['head_title']; return $this->render("main/login.html", $this->params); } else { $_POST = base_Utils::shtmlspecialchars($_POST); //session_start(); if (!SCaptcha::check($_POST['captcha'])) { $modelAdmin = new m_admin(); $loginInfo = $modelAdmin->checkLogin($_POST['username'], $_POST['pwd'], (int) $_POST['timeout']); if ($loginInfo) { $this->redirect($this->createUrl('/')); } else { $this->ShowMsg("用户名或者密码错误!"); } } else { $this->ShowMsg("验证码错误!"); } } }