Welcome Guest, Not a member yet? Register   Sign In
The Easiest Authentication Library for CodeIgniter just got easier.
#71

[eluser]Adam Griffiths[/eluser]
[quote author="North2Alaska" date="1243024154"]I like the time out feature that requires you to log back in if you have been idle. When I have a view that is protected by if (logged_in(() and timed out, how do I get the login to pop up, validate my credentials and then continue with the view I had previously attempted?[/quote]

The Authentication Library doesn't actually do this yet. You could make it so that when the login box comes up after a timeout, you would pass the name of the view to load in the first parameter to login(). I'll implement this for the next "big update".


Thanks,


Adam.
#72

[eluser]North2Alaska[/eluser]
Sorry for my premature post. :-( It helps to "Study" the documentation rather than just skim it. Nice work.
#73

[eluser]North2Alaska[/eluser]
[quote author="Adam Griffiths" date="1243024442"]
The Authentication Library doesn't actually do this yet. You could make it so that when the login box comes up after a timeout, you would pass the name of the view to load in the first parameter to login(). I'll implement this for the next "big update".[/quote]

This is the index function in the output controller. Here is what I am doing:

function index()
{
if(logged_in())
{

$this->load->view('mobile/header');
}
else
{
$this->auth->login('output');
}
}

I will put something like this in each function of each controller. Shouldn't this accomplish what I'm trying to do?
#74

[eluser]Adam Griffiths[/eluser]
Yes that's exactly it.
#75

[eluser]jbawarren[/eluser]
GREAT AUTH PACKAGE!

Potential concern with gethub (or whatever it is that you're using) though.

I just downloaded the latest and greatest and the group/group_id issue in the helper still exists. I know its not top priority, but maybe the problem is with gethub?

I dunno, but you should be aware.

I'm digging through your stuff now and so far its great. Thanks for your efforts! cant wait for ACL.
#76

[eluser]Unknown[/eluser]
After logout I have
Fatal error: Call to undefined method CI_Session:Confusedess_destroy(), why?

codeigniter 1.7.1
#77

[eluser]Adam Griffiths[/eluser]
[quote author="kollo" date="1243564068"]After logout I have
Fatal error: Call to undefined method CI_Session:Confusedess_destroy(), why?

codeigniter 1.7.1[/quote]

Are you using the version from the .zip archive from the CodeIgniter homepage or the svn trunk? Are you using an extended or overridden Session class?

The user guide shows that the function is sess_destroy() but another user changed it to destroy() and it worked fine.

It works fine on my server and locally, so I can only imagine you've either used an extended Session class or the svn version of CodeIgniter.


Thanks,
Adam
#78

[eluser]Jbeasley6651[/eluser]
This is amazing, keep up the good work. I am able to speed right though adding authentication to my current application, i didn't have to change my files around to different folders or anything really Just uploaded, configured and was on my way. SO SIMPLE. Thanks!
#79

[eluser]jbawarren[/eluser]
In the _verify_cookie() private function in libraries/auth, wouldn't you want the line:

Code:
if ((array_key_exists('login_attempts', $_COOKIE)) && ($_COOKIE['login_attempts'] >= 5)) {

to read:

Code:
if ((array_key_exists('login_attempts', $_COOKIE)) && ($_COOKIE['login_attempts'] <= 5)) {

instead? So that login attempts is evaluates if it's less than 5, So that a new identifier isn't generated at every request? Or is that the point and maybe I'm just missing something?
#80

[eluser]Jbeasley6651[/eluser]
I did a quick browse of the thread and didn't find anyone talking about the bug i found this morning so i'll post it. (sorry if it's been posted)

I was building an app to save the users information into a profile and I was trying to get the logged in users ID, no luck because you need to change the following.

in Auth.php on line 237 and line 144

From

Code:
'user_id' => $row['id'],

to

Code:
'id' => $row['id'],

the script is writing the column "user_id" to the session data and this is not a valid field in the database. You need to change it to "id"

Then, if you wanna make it easier on yourself to use the user id in multiple places open up the auth_helper and find this

Code:
function username()
{
    $CI =& get_instance();
    return $CI->session->userdata('username');
}

directly below it add this

Code:
function userid()
{
    $CI =& get_instance();
    return $CI->session->userdata('id');
}

Now, where ever you would like to use the user id you can simple use

Code:
&lt;?php echo userid(); ?&gt;

Thanks,

Joel Beasley




Theme © iAndrew 2016 - Forum software by © MyBB