revert last change

This commit is contained in:
wlx 2012-01-15 02:46:41 +00:00
parent e0b9945a0a
commit 1e7e4c20e0
2 changed files with 30 additions and 51 deletions

View File

@ -109,22 +109,19 @@ class AccountController extends Zend_Controller_Action
}
function loginAction()
{
$form = new LoginForm();
$success=false;
$message='';
$this->view->form = $form;
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) $this->_redirect('/account');
$username = $this->_request->getParam('username');
$password = $this->_request->getParam('password');
$vdcode = $this->_request->getParam('vdcode');
if ($this->_request->isPost()) {
if ($vdcode == $_SESSION['vdcodes']) {
if (!$this->login($username,$password))
$formData = $this->_request->getPost();
if ($form->isValid($formData)) {
if (!$this->login($formData['username'],$formData['password']))
{
$this->messenger->addMessage('登录失败,请检查您的用户名和密码。');
} else $success=true;
}else{
$this->messenger->addMessage('验证码不正确。');
}
if(!$success) {

View File

@ -9,25 +9,7 @@
?>
<div id="info">
<img src="/images/Login_title.gif" alt="西部数据中心用户登录" />
<form id="login" enctype="application/x-www-form-urlencoded" action="" method="post"><ul class="loginform">
<dt id="id-label">&#160;</dt>
<dd id="id-element">
<input type="hidden" name="id" value="" id="id"></dd>
<dt id="username-label"><label for="username" class="required">用户名</label></dt>
<dd id="username-element">
<input type="text" name="username" id="username" value=""></dd>
<dt id="password-label"><label for="password" class="required">密码</label></dt>
<dd id="password-element">
<input type="password" name="password" id="password" value=""></dd>
<dt id="remember-label"><label for="remember" class="optional">记住我</label></dt>
<dd id="remember-element">
<input type="hidden" name="remember" value="0"><input type="checkbox" name="remember" id="remember" value="1"></dd>
<dt id="captcha-input-label"><label for="captcha-input" class="required">验证码</label></dt>
<dd id="captcha-element">
<img id="imgcode" style="margin-bottom:-10px;cursor:pointer;border:0px;" src="/service/imgcode/" onClick="this.src=this.src+'?'"><input type="text" name="vdcode" id="vdcode" maxlength="4" value="" /></dd>
<dt id="submit-label">&#160;</dt><dd id="submit-element">
<input type="submit" name="submit" id="submitbutton" value="登录"></dd></ul></form>
<?php echo $this->form;?>
</div>
<div id="tool">
<a href="/account/fetchpwd">忘记密码?</a><a href="/account/register">注册新用户</a>