koreaqing 2012-12-09 18:51:20 3442次浏览 1条回复 0 0 0

我想做个忘记密码取回的功能,碰到验证方面的问题,望大侠不吝指教。

我的想法是忘记密码页提交用户名和验证码,先验证验证码,再验证用户是否存在,UserController中验证码不做验证 view就一个username,一个captcha, UserController

public function actionForget_pass() {
$model = new User();
if (isset($_POST['User']) && isset($_POST['User']['username'])) {
    if ($model->validate()) {
        $username = trim($_POST['User']['username']);
        $mod
  • 回复于 2012-12-10 11:23 举报

    Model的rules里,有这个吗:array('captcha', 'allowEmpty'=>!CCaptcha::checkRequirements()),

您需要登录后才可以回复。登录 | 立即注册