带ion_auth的编码点火器 - 无法登录,无需验证


Codeigniter with ion_auth - can't login, no validation

将codeigniter与ion_auth一起使用。在登录页面上,验证似乎不起作用;"if ($this->form_validation->run() == true)" 总是返回 false,但表单中不显示任何错误消息。这是开箱即用的控制器和视图,我没有编辑任何内容。不知道如何调试;有什么想法吗?

这是正在运行但不工作的函数:

function login()
{
    $this->data['title'] = "Login";
    //validate form input
    $this->form_validation->set_rules('identity', 'Identity', 'required');
    $this->form_validation->set_rules('password', 'Password', 'required');
    if ($this->form_validation->run() == true)
    {
        // check to see if the user is logging in
        // check for "remember me"
        $remember = (bool) $this->input->post('remember');
        if ($this->ion_auth->login($this->input->post('identity'), $this->input->post('password'), $remember))
        {
            //if the login is successful
            //redirect them back to the home page
            $this->session->set_flashdata('message', $this->ion_auth->messages());
            redirect('/', 'refresh');
        }
        else
        {
            // if the login was un-successful
            // redirect them back to the login page             
            $this->session->set_flashdata('message', $this->ion_auth->errors());
            redirect('auth/login', 'refresh'); // use redirects instead of loading views for compatibility with MY_Controller libraries
        }
    }
    else
    {
        // the user is not logging in so display the login page
        // set the flash data error message if there is one
        $this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');
        $this->data['identity'] = array('name' => 'identity',
            'id'    => 'identity',
            'type'  => 'text',
            'value' => $this->form_validation->set_value('identity'),
        );
        $this->data['password'] = array('name' => 'password',
            'id'   => 'password',
            'type' => 'password',
        );
        $this->_render_page('auth/login', $this->data);
    }
}

页面发布到错误的位置。咄。