Welcome Guest, Not a member yet? Register   Sign In
Strange issue with validation libraries
#16

[eluser]tonanbarbarian[/eluser]
ok there is nothing in the model that looks like it would be causing any issues.

Grasping at straws a bit here but there are a couple of things I would try.

1. Move all of the code out of the constructor and into the index of your controller
there has been noted some issues in the past with loading things in the constructor
should not be the case but it think it has to do with issues with some specific versions of php
so try
Code:
<?php
class Login extends Controller {

    function __construct()
    {
        parent::Controller();
    }

    function index()
    {
        $this->load->helper('form');
        $this->load->helper('security');
        // utente non autorizzato
        $this->authUser = FALSE;          
        $this->load->library('validation');

        $data_stack['pageTitle']   = $this->lang->line('titleLogin');
        $this->load->view('admin/custom_validation/logins_validation.php', '', FALSE);
        if($this->validation->run() == TRUE)
        {
            redirect('front', 'location');
            exit();
        }

        $this->load->view('admin/login/index', $data_stack);
    }
    
    function check_login()
    {
      $username = $this->input->post('username');
      $password = dohash($this->input->post('password'));
      if ($this->erkanaauth->try_login(array('username'=>$username, 'password'=>$password)))
      {
        $this->erkanaauth->updateLastVisit();
        return TRUE;
      }
      else
      {
        $this->validation->set_message('check_login', 'Errore, utente e/o password errati');
        return FALSE;
      }
    }
} // END Front
?>
I also removed the library

Also you might want to try using the constructor in the php4 way. I know the user guide says you can use __construct in php5 however I have always used the php4 method and never had any issues, and have seen instances where people have switched to that and it fixed the problem

so you could also try
Code:
<?php
class Login extends Controller {

    function Login()
    {
        parent::Controller();
        $this->load->helper('form');
        $this->load->helper('security');
        // utente non autorizzato
        $this->authUser = FALSE;          
        $this->load->library('validation');
    }

    function index()
    {

        $data_stack['pageTitle']   = $this->lang->line('titleLogin');
        $this->load->view('admin/custom_validation/logins_validation.php', '', FALSE);
        if($this->validation->run() == TRUE)
        {
            redirect('front', 'location');
            exit();
        }

        $this->load->view('admin/login/index', $data_stack);
    }
    
    function check_login()
    {
      $username = $this->input->post('username');
      $password = dohash($this->input->post('password'));
      if ($this->erkanaauth->try_login(array('username'=>$username, 'password'=>$password)))
      {
        $this->erkanaauth->updateLastVisit();
        return TRUE;
      }
      else
      {
        $this->validation->set_message('check_login', 'Errore, utente e/o password errati');
        return FALSE;
      }
    }
} // END Front
?>
again i left the load model out to see if it will work now


Messages In This Thread
Strange issue with validation libraries - by El Forum - 02-11-2008, 03:35 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 03:48 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 04:14 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 04:15 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 04:17 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 04:19 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 04:22 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 04:38 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 04:44 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 04:48 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 05:00 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 05:23 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 05:27 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 06:03 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 06:11 AM
Strange issue with validation libraries - by El Forum - 02-11-2008, 02:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB