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-23-2011

[eluser]rulin[/eluser]
Hi Ben

Just a quick question.

I want to retrieve a list of groups so I can add a drop down list to the Create User view.
I know I can get them with something like $this->ion_auth_model->get_groups(), but I seem to recall that you prefer if data was accessed via the library and not directly from the model.

Any suggestions? I don’t want to start hacking the core library.

Cheers
Russ


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

[eluser]dhaulagiri[/eluser]
I cannot see register function in auth controller but there is in ion_auth library, how do i implement it ?


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

[eluser]rulin[/eluser]
[quote author="dhaulagiri" date="1300914182"]I cannot see register function in auth controller but there is in ion_auth library, how do i implement it ?[/quote]

Hi dhaulagiri

Look at function create_user() in the sample controller (auth.php), there is an example there.

Code:
if ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data, $group))


Russ


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

[eluser]Ben Edmunds[/eluser]
Russ,

You can use $this->ion_auth->get_groups(). The model methods are routed through the library.


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

[eluser]rulin[/eluser]
[quote author="Ben Edmunds" date="1300924011"]Russ,

You can use $this->ion_auth->get_groups(). The model methods are routed through the library.[/quote]

Thanks Ben

Looked in ion_auth.php and couldn't see it... should have checked the user guide. Doh!

Russ


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

[eluser]Kevin Smith[/eluser]
I'm writing a method to allow a user to update his/her email address, but I'd like to require them to enter their current password and have the application validate against that before updating the email address. Anyone have a best practice for how to do this?


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

[eluser]dhaulagiri[/eluser]
[quote author="rulin" date="1300918918"][quote author="dhaulagiri" date="1300914182"]I cannot see register function in auth controller but there is in ion_auth library, how do i implement it ?[/quote]

Hi dhaulagiri

Look at function create_user() in the sample controller (auth.php), there is an example there.

Code:
if ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data, $group))


Russ[/quote]

Do i need to create new function for user to register ?


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

[eluser]rulin[/eluser]
[quote author="dhaulagiri" date="1300949529"][quote author="rulin" date="1300918918"][quote author="dhaulagiri" date="1300914182"]I cannot see register function in auth controller but there is in ion_auth library, how do i implement it ?[/quote]

Hi dhaulagiri

Look at function create_user() in the sample controller (auth.php), there is an example there.

Code:
if ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data, $group))


Russ[/quote]

Do i need to create new function for user to register ?[/quote]

If you mean you want a screen where users can register themselves, then yes.
I don't think there is anything in Ben's demo code specifically for that.
You can probably create something fairly easily based on the Create_user view.

Russ


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

[eluser]dhaulagiri[/eluser]
i can see lots of people talking abt registration, hi ben can could u pls tell me, if i have to create register function in auth controller or it's already there somewhere ?


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

[eluser]rulin[/eluser]
[quote author="dhaulagiri" date="1300998990"]i can see lots of people talking abt registration, hi ben can could u pls tell me, if i have to create register function in auth controller or it's already there somewhere ?[/quote]


If you go into /index.php/auth and log on with 'admin@admin.com' and 'password' it takes you into a user maintenance screen where you can register new users.
Is this what you mean?

Russ