Reputation: 9055
I try to use ion_auth library for codeigniter but I do not get it to work. Appropriate files already in given folders, mysql structure created
I have my admin structure as follows
controller
--admin
---dashboard.php
---auth.php
I request domain/admin/dashboard and I check if user is logged in
if (!$this->ion_auth->logged_in()) {
redirect('admin/auth/login', 'refresh');
}
else should be able to access dashboard
than in my view I have
--view
---admin
---- tmpl
-----index.php
---auth
----login.php
than I try to log in with the default credentials
fails but I do not even get an error message. than I checked controller/admin/auth.php login method
if ($this->form_validation->run() == true)
{
codes that would check credentials
} else
{
$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');
//and return to login view
}
I try to var_dump($this->data['message']) but I get boolean false,
diving a bit deeper I was checking the form validator under /sytem/libraries/Form_validation.php
if (count($_POST) == 0)
{
return $this;
}
var_dump(count($_POST));
shows on posted data 0
Okay get it to work!! Ignoring the form template coming from the framework fixed the issue
Upvotes: 0
Views: 264
Reputation: 2349
I recently used Ion-auth in CI 2.1.4 on Aug 7th and had no issues. Since u didn't get any validation message , I suspect that u didn't add the language folder of ion-auth
and didn't load the language helper.
The auth controller was recently updated to use error messages from language files.
Hence u won't get any message unless language files are loaded.
If that is the case, i suggest autoloading the language helper in config/autoload.php.
$autoload['helper'] = array('language');
and copy the language files u need from Ion auth languages folder into CI language folder.
This should solve the issue.
Upvotes: 1