Welcome Guest, Not a member yet? Register   Sign In
Ion Auth - Lightweight Auth System based on Redux Auth 2

[eluser]Ben Edmunds[/eluser]
And to clear up some confusion, any calls made to the library, eg $this->ion_auth->login(), will automatically be passed through to the model if it's not found in the library. This is standard for PHP 5 apps to use overloading but seems to be confusing to people that are either new or used to using PHP 4.

Also the docs should be completely up-to-date at this point, if you find something that is off please send a pull request or at least on an issue on github. Thanks!


[eluser]adityamenon[/eluser]
Thanks for responding Ben. You're right, I'm sorry, I should have checked first before commenting about the non-availability of controller functions.

For folks who are confused, here's what I found in the docs: http://bit.ly/M3RQm3
Also, here's the code that actually achieves this: http://bit.ly/LEXS6e

[eluser]Keloo[/eluser]
Quote:And to clear up some confusion, any calls made to the library, eg $this->ion_auth->login(), will automatically be passed through to the model if it’s not found in the library. This is standard for PHP 5 apps to use overloading but seems to be confusing to people that are either new or used to using PHP 4.

Thanks for clearing this out for me. Even though I started learning php more then a year ago I didn't know about this, gotta learn more PHP5.

I've tried sending emails using the CI email library and it worked, but when I try using it with Ion_auth I get all sorts of erros, like:

Quote:A PHP Error was encountered

Severity: Warning

Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.googlemail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)

Filename: libraries/Email.php

Line Number: 1689

A PHP Error was encountered

Severity: Warning

Message: fwrite() expects parameter 1 to be resource, boolean given

Filename: libraries/Email.php

Line Number: 1846

A PHP Error was encountered

Severity: Warning

Message: fgets() expects parameter 1 to be resource, boolean given

Filename: libraries/Email.php

Line Number: 1869

A PHP Error was encountered

Severity: Warning

Message: fwrite() expects parameter 1 to be resource, boolean given

Filename: libraries/Email.php

Line Number: 1846

A PHP Error was encountered

Severity: Warning

Message: fgets() expects parameter 1 to be resource, boolean given

Filename: libraries/Email.php

Line Number: 1869

A PHP Error was encountered

Severity: Warning

Message: fwrite() expects parameter 1 to be resource, boolean given

Filename: libraries/Email.php

Line Number: 1846

A PHP Error was encountered

Severity: Warning

Message: fgets() expects parameter 1 to be resource, boolean given

Filename: libraries/Email.php

Line Number: 1869

A PHP Error was encountered

Severity: Warning

Message: fwrite() expects parameter 1 to be resource, boolean given

Filename: libraries/Email.php

Line Number: 1846

A PHP Error was encountered

Severity: Warning

Message: fgets() expects parameter 1 to be resource, boolean given

Filename: libraries/Email.php

Line Number: 1869

A PHP Error was encountered

Severity: Warning

Message: fwrite() expects parameter 1 to be resource, boolean given

Filename: libraries/Email.php

Line Number: 1846

A PHP Error was encountered

Severity: Warning

Message: fwrite() expects parameter 1 to be resource, boolean given

Filename: libraries/Email.php

Line Number: 1846

A PHP Error was encountered

Severity: Warning

Message: fgets() expects parameter 1 to be resource, boolean given

Filename: libraries/Email.php

Line Number: 1869

I'm using the same config like in the older project. Maybe it doesn't work this way because I'm using the latest CI version, and they've changed something.

Else I can't explain why it doesn't work.

[eluser]maccrazy[/eluser]
[quote author="nl_vinyl" date="1337760413"]I am starting work on an application that will house multiple company's with multiple users per company.

Depending on what company they work for and what their rights are different data will be loaded.

How suitable is Ion Auth for this? Is there an option for this within Ion Auth? Cause I am guessing the groups are ment for different right sets and not for say company separation?[/quote]

I'm looking at doing something similar, will need to modify so that a user can be member of multiple companies (which it can switch between), divisions and groups (to limit access).

Curious to know, is Ion Auth in its current state considered production ready?

Thanks. Smile

[eluser]adityamenon[/eluser]
Yes. It's definitely worthy of using anywhere you like. It's even got MongoDB support now. Looks like you've got quite a complex problem at hand (these role and tier systems are much much harder than what they appear on the surface)... IonAuth will not solve all of it, but it's a good tool.

[eluser]maccrazy[/eluser]
Thanks. Definitely easier than starting from scratch though. Wink

[eluser]digital_frog[/eluser]
Hello! I'm working on an educational website, an Ion_Auth looks like it can work, I just have a few questions about how groups work and if they are appropriate for what I'm planning.
I need to create three tiers of users:admins, students and teachers. (Admins already have a category it seems) It seems that I can use groups to separate teachers from students, but can I also use groups to classify students by their teacher's ID and their class? Also, I've read the documentation, but is it possible to apply multiple groups to a single user?

[eluser]Dinko[/eluser]
Hello everyone, my first post here.

My question is how do you check whether the user IS logged in or not in views. For example if user is logged in i want to show admin options in widget area if he isn't logged in i want to show just login form in widget area

Few things:
- I don't want to have multiple views, for example one for admin, one for user, one for guest.
- Right now i'm using this tutorial http://jondavidjohn.com/blog/2011/01/sca...r-ion_auth
- In view files i use (!empty($someuserobject)) to see is he logged in

Is there a better approach?

[eluser]adityamenon[/eluser]
[quote author="digital_frog" date="1339600037"]
I need to create three tiers of users:admins, students and teachers. (Admins already have a category it seems) It seems that I can use groups to separate teachers from students, but can I also use groups to classify students by their teacher's ID and their class? Also, I've read the documentation, but is it possible to apply multiple groups to a single user?[/quote]

Well, you can store the teacher's ID and the class ID in the DB. That's not something IonAuth can help with, though it's very simple. Yes, you can have multiple groups for each user.

[eluser]adityamenon[/eluser]
[quote author="Dinko" date="1339621424"]My question is how do you check whether the user IS logged in or not in views. For example if user is logged in i want to show admin options in widget area if he isn't logged in i want to show just login form in widget area

Few things:
- I don't want to have multiple views, for example one for admin, one for user, one for guest.
- Right now i'm using this tutorial http://jondavidjohn.com/blog/2011/01/sca...r-ion_auth
- In view files i use (!empty($someuserobject)) to see is he logged in

Is there a better approach?[/quote]

This is what I do:

1. Store $this->ion_auth->user() in a variable in the controller's __construct() [I use $this->user)
2. Send the user object to the view. Check inside the view if the object exists, output code accordingly.

This seems very similar to what you are doing, and I don't see why we should search for better approaches when this works perfectly fine...

PS: I just skimmed that tutorial and again that guy seems to be doing the same thing too!




Theme © iAndrew 2016 - Forum software by © MyBB