西部数据中心中文版增加了登录时的验证码机制

This commit is contained in:
Li Jianxuan 2011-12-28 06:37:46 +00:00
parent bb6fc19be4
commit 8c3e99dde4
2 changed files with 384 additions and 349 deletions

View File

@ -152,7 +152,7 @@ class AccountController extends Zend_Controller_Action
$auth->clearIdentity(); $auth->clearIdentity();
require_once 'member.php'; require_once 'member.php';
$mb=new member(); $mb=new member();
$mb::flushcookie(); member::flushcookie();
$this->_redirect('/'); $this->_redirect('/');
} }
@ -187,7 +187,10 @@ class AccountController extends Zend_Controller_Action
} }
return true; return true;
} }else
{
return false;
}
return false; return false;
} }
private function aspnet_login($p,$salt,$password) private function aspnet_login($p,$salt,$password)

View File

@ -14,23 +14,25 @@ class LoginForm extends Zend_Form
->addFilter('StringTrim') ->addFilter('StringTrim')
->addValidator('NotEmpty'); ->addValidator('NotEmpty');
$password=new Zend_Form_Element_Password('password'); $password=new Zend_Form_Element_Password('password');
$password->setLabel('密码')->setRequired(true); $password->setLabel('密码')->setRequired(true);
$remember=new Zend_Form_Element_Checkbox('remember'); $remember=new Zend_Form_Element_Checkbox('remember');
$remember->setLabel('记住我'); $remember->setLabel('记住我');
$id = new Zend_Form_Element_Hidden('id');
$id = new Zend_Form_Element_Hidden('id');
$submit = new Zend_Form_Element_Submit('submit'); $submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('登录'); $submit->setLabel('登录');
$submit->setAttrib('id', 'submitbutton'); $submit->setAttrib('id', 'submitbutton');
$this->addElements(array($id, $username, $password, $remember, $submit)); $this->addElements(array($id, $username, $password, $remember));
$this->clearDecorators(); $this->clearDecorators();
$this->addDecorator('FormElements') $this->addDecorator('FormElements')
->addDecorator('HtmlTag', array('tag' => '<ul>','class'=>'loginform')) ->addDecorator('HtmlTag', array('tag' => '<ul>','class'=>'loginform'))
->addDecorator('Form'); ->addDecorator('Form');
/*
$this->setElementDecorators(array( $this->setElementDecorators(array(
array('ViewHelper'), array('ViewHelper'),
array('Errors'), array('Errors'),
@ -38,6 +40,32 @@ class LoginForm extends Zend_Form
array('Label', array('separator'=>' ')), array('Label', array('separator'=>' ')),
array('HtmlTag', array('tag' => 'li', 'class'=>'element-group')), array('HtmlTag', array('tag' => 'li', 'class'=>'element-group')),
)); ));
*/
$captcha = $this->addElement('captcha', 'captcha', array(
'captcha' => array(
// First the type...
'captcha' => 'Image',
// Length of the word...
'wordLen' => 6,
'fontsize'=>16,
'width' => 100,
'height' => 38,
'dotNoiseLevel'=>2,
// Captcha timeout, 5 mins
'timeout' => 300,
// What font to use...
'font' => '../data/fonts/ggbi.ttf',
// Where to put the image
'imgDir' => 'vdimg/',
// URL to the images
// This was bogus, here's how it should be... Sorry again :S
'imgUrl' => '/vdimg',
),
'label' => '验证码'
));
/*
// buttons do not need labels // buttons do not need labels
$submit->setDecorators(array( $submit->setDecorators(array(
@ -46,5 +74,9 @@ class LoginForm extends Zend_Form
array('HtmlTag', array('tag' => 'li', 'class'=>'submit-group')), array('HtmlTag', array('tag' => 'li', 'class'=>'submit-group')),
)); ));
*/
$this->addElements(array($submit));
} }
} }