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,23 +109,20 @@ 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) {
$flashMessenger = $this->_helper->getHelper('FlashMessenger');

View File

@ -1,41 +1,23 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('用户登录');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/register.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/account/login">用户登录</a>');
$this->breadcrumb()->setSeparator(' > ');
?>
<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>
</div>
<div id="tool">
<a href="/account/fetchpwd">忘记密码?</a><a href="/account/register">注册新用户</a>
</div>
<?php if (!empty($this->messages)) : ?>
<div id="message">
<?php
foreach ($this->messages as $info)echo $info;
?>
</div>
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('用户登录');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/register.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/account/login">用户登录</a>');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="info">
<img src="/images/Login_title.gif" alt="西部数据中心用户登录" />
<?php echo $this->form;?>
</div>
<div id="tool">
<a href="/account/fetchpwd">忘记密码?</a><a href="/account/register">注册新用户</a>
</div>
<?php if (!empty($this->messages)) : ?>
<div id="message">
<?php
foreach ($this->messages as $info)echo $info;
?>
</div>
<?php endif; ?>