CodeIgniter Forums
Ion Auth - Lightweight Auth System based on Redux Auth 2 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Ion Auth - Lightweight Auth System based on Redux Auth 2 (/showthread.php?tid=27435)



Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-16-2011

[eluser]Ben Edmunds[/eluser]
dallen33,

No, the main thing you need to look at is the difference in the encryption algorithms.


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-17-2011

[eluser]jk215[/eluser]
Having trouble converting my Identity to 'username'. I changed it in the config file but do I have to make edits elsewhere? Cant login by username in the login form.


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-17-2011

[eluser]Oliver Zeyen[/eluser]
hello! Hope somebody can help me!

I can't call any ion_auth methods AFTER I load a module.

I've created an ion_auth module in a slightly different way wayne described. This module works fine, all actions of the demo application work like a charm. To avoid any calls of ion_auth AFTER a module is loaded, for example my navigation module in the template controller, I've build a cascade of controllers which extend each other.

The first one, auth_controller extends the base controller and loads the ion_auth library from the module. Login status and userdata are fetched and checked by the corresponding methods of the library. I am forced do this, because any later call of ion_auth produces errors.

The second controller is my template_controller which initializes all the base templates, loads all views and holds the public render function which is called in my application controllers. In this controller, view modules are merged into my templates. And thats the point. module loaded, good bye ion_auth.

In my application controller: load ion_auth and call $this->ion_auth->get_userdata(); php gives me the following error:

"Call to a member function userdata() on a non-object in /var/www/www.myserver.de/application/modules/auth/models/ion_auth_model.php on line 726" which points to "$this->session->userdata('user_id');"

also this warning is thrown: "Message: Undefined Property: navigation::$session Filename: core/Model.php Line Number: 50"

Does anybody know a solution for this problem?

By the way: This is my second attempt... I previously installed ion_auth "conventionally" as a simple library and not as a module with the same results... errors when calling it after a module.


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-17-2011

[eluser]Ben Edmunds[/eluser]
Oliver,

$this->ion_auth->get_userdata() isn't an Ion Auth method, are you needing $this->ion_auth->get_user() instead?


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-17-2011

[eluser]Ben Edmunds[/eluser]
jk215,

Are you still having this issue?


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-17-2011

[eluser]Civic[/eluser]
Hi Ben. I used your library in one of our web application. We are currently using one proxy when accessing websites. We are having problems on getting the current user logged in. Sometimes I get the wrong username when both of us access the same page. $user = I used
$this->ion_auth->get_user();
echo substr($user->email,0,strpos($user->email,'@',1));

Any help will be greatly appreciated.

Thanks
Civic


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-17-2011

[eluser]Ben Edmunds[/eluser]
Civic,

get_user without any parameters retrieves the ID from the session. You could also pass the id like ion_auth->get_user($user_id).

I'm not sure why you included that substr?


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-17-2011

[eluser]Civic[/eluser]
Wow! that was a fast reply. How do I get the currently logged in userid? The substr was to get the username from email. I used the default setup. when you login I use the email address.
Here is what I could try.

$userid = $this->session->userdata('email');
$user = $this->ion_auth->get_user($userid);

I will update you the results

Thanks,


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-17-2011

[eluser]Ben Edmunds[/eluser]
Civic,

If you having issues with getting the correct currently logged in user using $this->ion_auth->get_user() then something is up with the session. Read up on the CI Session library and see what you can troubleshoot.

BTW, user->id and user->email and not the same. Also, you can get the user's username with $user->username.


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-18-2011

[eluser]Civic[/eluser]
Hi Ben,

We were able to fix the problem. This is the case of 1 proxy server many users 1 session.
We just put in line 102 in ion_auth.php library.

# Handle proxy common session 2011-03-18
session_start();

Thank you so much.
Hope this helps.

Civic