Same problem with login always showing login-form, HOWEVER I am actually never logged in (as others claim to be). I’m running CI 2.0.3 and ag_auth 2.0.5.
The call to logged_in() (in admin controller) always returns false and the session is always WITHOUT any userdata when I dump it in admin/index (session->all_userdata()). If I turn on sess_use_database I see that every login-attempt writes two rows to ci_sessions table where the latter is without userdata whereas the first one has userdata - i.o.w. the session seems to be overwritten. What’s going on?
Sorry, my previous post was actually a sigh of relief. The length of user_agent (varchar 120) was the culprit. The sessions never matched because of this so a new session was created on every page load.
CREATE TABLE IF NOT EXISTS `groups` ( `id` int(11) NOT NULL, `title` varchar(20) NOT NULL default '', `description` varchar(100) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- -- Table structure for table `users` --
CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL auto_increment, `username` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `group_id` int(11) NOT NULL default '100', `token` varchar(255) NOT NULL, `identifier` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
NOTE: That the default charset shoud also be utf8 and not latin1
I got 404 in any: /register - /login… I’ve install Auth from spark but doesn’t work… My CI is installed correctly, and some other libraries works fine.
I use a vhost and remove the ‘index.php’, so when I put http://mysite.local/register or http://mysite.local/login, I get the 404.
Other my controllers works fine.
How can I make your lib work?
It’s seems very intresting…but id I can’t try… :(
After a fresh install of CI (2.1.0) I just installed AG_auth (2.0.5) using Sparks, followed all the instructions, but I get a 404 when going to mydomain/index.php/register or mydomain/index.php/admin/register.
Does anyone has a clue, is this library working for anyone else?
PS: I have activerecord (0.0.2) installed as well, if that makes any difference.
@josefo, @aere ==> have you add the redirect from /register to /admin/admin/register in the file /config/routes.php? And added the MY_Controller.php in /application/core/ ?
I have a different problem registering or logging in, when i submit the register/login form i only see a white page.. Any idea?
I’m trying to understand the connection between the groups table and the auth_groups array in the config file. It seems I should need one or the other, but not both.
Also, how can I assign a user to multiple groups?
I’m using CI 2.1.0 and v2.0.0 of The Authentication Library
I have what I think is a simplw question. I have installed AG Auth, I can show the login form on any view page, but I can’t actually log in. It’s as if the form doesn’t have any functionality unless it is in the actual auth/pages/login page. Here is my Controller.
<?php
class Pages extends Application
{
public function __construct()
{
parent::__construct();
}
public function login()
{
$this->ag_auth->login(‘user/dashboard’);
// user/dashboard is a made up URI string
}
public function view($page = ‘home’)
{
if ( ! file_exists(‘application/views/pages/’.$page.’.php’))
{
// Whoops, we don’t have a page for that!
show_404();
}
$data[‘title’] = ucfirst($page); // Capitalize the first letter