revert last change
This commit is contained in:
parent
e0b9945a0a
commit
1e7e4c20e0
|
@ -109,23 +109,20 @@ class AccountController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
function loginAction()
|
function loginAction()
|
||||||
{
|
{
|
||||||
|
$form = new LoginForm();
|
||||||
|
$success=false;
|
||||||
|
$message='';
|
||||||
|
$this->view->form = $form;
|
||||||
$auth = Zend_Auth::getInstance();
|
$auth = Zend_Auth::getInstance();
|
||||||
if ($auth->hasIdentity()) $this->_redirect('/account');
|
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 ($this->_request->isPost()) {
|
||||||
|
$formData = $this->_request->getPost();
|
||||||
if ($vdcode == $_SESSION['vdcodes']) {
|
if ($form->isValid($formData)) {
|
||||||
if (!$this->login($username,$password))
|
if (!$this->login($formData['username'],$formData['password']))
|
||||||
{
|
{
|
||||||
$this->messenger->addMessage('登录失败,请检查您的用户名和密码。');
|
$this->messenger->addMessage('登录失败,请检查您的用户名和密码。');
|
||||||
} else $success=true;
|
} else $success=true;
|
||||||
}else{
|
}
|
||||||
$this->messenger->addMessage('验证码不正确。');
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!$success) {
|
if(!$success) {
|
||||||
$flashMessenger = $this->_helper->getHelper('FlashMessenger');
|
$flashMessenger = $this->_helper->getHelper('FlashMessenger');
|
||||||
|
|
|
@ -1,41 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
$this->headTitle($this->config->title->site);
|
$this->headTitle($this->config->title->site);
|
||||||
$this->headTitle('用户登录');
|
$this->headTitle('用户登录');
|
||||||
$this->headTitle()->setSeparator(' - ');
|
$this->headTitle()->setSeparator(' - ');
|
||||||
$this->headLink()->appendStylesheet('/css/register.css');
|
$this->headLink()->appendStylesheet('/css/register.css');
|
||||||
$this->breadcrumb('<a href="/">首页</a>');
|
$this->breadcrumb('<a href="/">首页</a>');
|
||||||
$this->breadcrumb('<a href="/account/login">用户登录</a>');
|
$this->breadcrumb('<a href="/account/login">用户登录</a>');
|
||||||
$this->breadcrumb()->setSeparator(' > ');
|
$this->breadcrumb()->setSeparator(' > ');
|
||||||
?>
|
?>
|
||||||
<div id="info">
|
<div id="info">
|
||||||
<img src="/images/Login_title.gif" alt="西部数据中心用户登录" />
|
<img src="/images/Login_title.gif" alt="西部数据中心用户登录" />
|
||||||
<form id="login" enctype="application/x-www-form-urlencoded" action="" method="post"><ul class="loginform">
|
<?php echo $this->form;?>
|
||||||
<dt id="id-label"> </dt>
|
</div>
|
||||||
<dd id="id-element">
|
<div id="tool">
|
||||||
<input type="hidden" name="id" value="" id="id"></dd>
|
<a href="/account/fetchpwd">忘记密码?</a><a href="/account/register">注册新用户</a>
|
||||||
<dt id="username-label"><label for="username" class="required">用户名</label></dt>
|
</div>
|
||||||
<dd id="username-element">
|
<?php if (!empty($this->messages)) : ?>
|
||||||
<input type="text" name="username" id="username" value=""></dd>
|
<div id="message">
|
||||||
|
<?php
|
||||||
<dt id="password-label"><label for="password" class="required">密码</label></dt>
|
foreach ($this->messages as $info)echo $info;
|
||||||
<dd id="password-element">
|
?>
|
||||||
<input type="password" name="password" id="password" value=""></dd>
|
</div>
|
||||||
<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"> </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 endif; ?>
|
<?php endif; ?>
|
Loading…
Reference in New Issue