Welcome Guest, Not a member yet? Register   Sign In
The Authentication Library 1.0.6
#61

[eluser]Unknown[/eluser]
Are you expecting to add a 'Forgotten Password' type process to the library anytime soon? It'd be great to see that added in. Since my application is built upon your library, it looks like I'm going to be adding that no matter what.

I'd be interested in helping you code that, you can find me on github with the same handle as my CI forums handle if you want to chat futher about it before I dive in.
#62

[eluser]wildarp[/eluser]
Hi all. I compelled it to work, but I got anothe problem, it doesn`t want to work with Template CI Library (http://williamsconcepts.com/ci/codeignit...rence.html)

I replace any where line like
$this->auth->view('dashboard')

with

$this->template->write_view('content', $this->auth->view('dashboard'));
$this->template->render();

But it not work. Can anybody helps me?
#63

[eluser]Adam Griffiths[/eluser]
[quote author="wildarp" date="1255706380"]Hi all. I compelled it to work, but I got anothe problem, it doesn`t want to work with Template CI Library (http://williamsconcepts.com/ci/codeignit...rence.html)

I replace any where line like
$this->auth->view('dashboard')

with

$this->template->write_view('content', $this->auth->view('dashboard'));
$this->template->render();

But it not work. Can anybody helps me?[/quote]

In that case you'll need to manually include the path to the view folder and the headers and footers. I've never used the Template Library you linked to, so this code is all just a guess form what you've put in your post.

Code:
$this->template->write_view('header',     $this->load->view('auth/header'));
$this->template->write_view('content',     $this->load->view('auth/dashboard'));
$this->template->write_view('footer',     $this->load->view('auth/footer'));
$this->template->render();

Hopefully this helps you out.



Thanks,
Adam
#64

[eluser]Robati[/eluser]
Hi,

Just wanted to say I finally got it working.

I had database trouble. What I discovered was that importing the provided dump.sql file via phpMyAdmin, the ci_ prefix was trashed on the users and groups tables.

After adding the prefix to the tables I was able to successfully open the registration page, change my new user to admin, reauthenticate, and see the manage users options.

Im impressed overall. Definitely will be playing with this library over the next few weeks. See what I can do with it. Smile
#65

[eluser]Unknown[/eluser]
Code:
function _verify_cookie()
{
    if((array_key_exists('login_attempts', $_COOKIE)) && ($_COOKIE['login_attempts'] >= 5))
    {
        $username = $this->CI->session->userdata('username');
        $userdata = $this->CI->db->query("SELECT * FROM `$this->user_table` WHERE `z_username` = '$username'");
        
        $result = $userdata->row();

        $identifier = $result->z_username . $result->token;
        $identifier = $this->_salt($identifier);
        
        if($identifier !== $_COOKIE['logged_in'])
        {
            $this->CI->session->sess_destroy();
            
            show_error($this->CI->lang->line('logout_perms_error'));
        }
    }
    else
    {
        $this->_generate();
    }
}

Is this correct?

Right now, if you are logged in it generates a new identifier every page load. Should it not be, that if there is no cookie, it should generate an identifier?
#66

[eluser]Alfredor[/eluser]
Hello, I'm having troubles with this:

A Database Error Occurred
Error Number: 1364

Field 'token' doesn't have a default value

INSERT INTO `users` (username, email, password) VALUES ('admin', '[email protected]', 'xxxxxxxxxxxxxxxxxxxxxxxxxx')

Its shown when I try to register a new user :/ Any Idea?
#67

[eluser]Alfredor[/eluser]
Okay solved the isue myself,
the problem was that the 'token' field dosent have a default value on the mysql syntax, and no default values are passed trough the registration form, so the fix is just put as NULL both token and identifier fields.

The correct syntax should be:
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) DEFAULT NULL,
`identifier` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
#68

[eluser]jonathanstegall[/eluser]
Hello,

I'm confused on how to use the Update feature for user accounts. I have tried visiting /admin/register as a logged in user, and have also tried visiting /admin/users/edit and /admin/users/edit/1 (for the user id), as I saw edit in the Users controller. Register just tries to edit again, and /users/edit tells me I don't have sufficient privileges. For what it's worth, /admin/users/manage returns the same privileges error.

Any advice on how to use this functionality?

Otherwise, I'm so far very impressed by the library. Good stuff.

Thanks,
Jonathan
#69

[eluser]Alfredor[/eluser]
Hello Jonathan, Have you check that the user level is correct? also for register it should be /admin/admin/register, so you can register users.
#70

[eluser]jonathanstegall[/eluser]
Thanks for the response. I did ensure that the user I'm testing with is in the admin group. Also, /admin/register lets me register users very nicely. It just doesn't let me update them.. tries to re-register, of course.

Thanks,
Jonathan




Theme © iAndrew 2016 - Forum software by © MyBB