Ion Auth - Lightweight Auth System based on Redux Auth 2 |
[eluser]Keloo[/eluser]
Hi I've started working with ion_auth, and I have a few questions: 1. I've seen that in the ion_auth library there isn't a login function, but in the example in the login function there is a piece of code that apparently calls the login function from ion_auth and it works Code: if ($this->ion_auth->login($this->input->post('identity'), $this->input->post('password'), $remember)) How ? Because in the latest code of the library there isn't a login function only in the model. 2. When the user is logging in I want to redirect him to a personal user page, and displaying something like "welcome $user"; I can do this with $this->session->userdata('username'), but does the library provide a special function or is ok to use sessions ?
[eluser]adityamenon[/eluser]
Indeed, the documentation is out of date, the underlying code is changing. For example Code: $this->ion_auth->user(); Code: $this->ion_auth->user->row();
[eluser]Keloo[/eluser]
Yea, and I've seen that many functions such as username_check, identity_check, email_check don't exist anymore in the ion_auth library but in the userguide there are example of how to usem them. I am new to this library and it's confusing, because in the userguide you have examples of how to use some functions, and those functions don't exist in the final code. Or I have to call those functions in the library from the model ?
[eluser]adityamenon[/eluser]
I was lucky that way, I was introduced to v1. I suggest you look into using the 'master' branch on github instead, or anything tagged version 1. I think the user guide works perfectly for that version. Version 2 is particularly for when you want each user to have more than 1 group. I'm working towards building such a system right now, I'm kind of scared what I'll run into once I start using this library in earnest in a few hours ![]()
[eluser]Keloo[/eluser]
Ok so I've used the library from the "master" branch from git, and I've got a problem when trying to register. I've enabled email_activation and I get an error: Quote:A PHP Error was encountered What should I do to fix this problem ?
[eluser]adityamenon[/eluser]
That looks like a problem with your underlying server. You seem to be trying this from your development computer, you will need to enable a mail server on it before a mail can go out. For that, you can configure the PHP server to use sendmail, which in turn you can configure to use Gmail as SMTP... Or you can just test on any hosting, it'll work.
[eluser]AlexMason[/eluser]
[quote author="Keloo" date="1338222963"]Ok so I've used the library from the "master" branch from git, and I've got a problem when trying to register. I've enabled email_activation and I get an error: Quote:A PHP Error was encountered What should I do to fix this problem ?[/quote] Ben does not seem to support his product... try running on an actual web server with an underlying smtp stack.
[eluser]adityamenon[/eluser]
AlexMason, while I agree that Ion_Auth can do better with more involvement from Ben (a simple one line pull request has been waiting for three days on his repo [EDIT: This got pulled today, after 3 days, which is not at all an unacceptable wait time for an open source project!]), it's unfair to call it his 'product', and then accuse him of not supporting it. It's free - and it has saved me tons of time in more than one occasion. And it's better than many other similar systems out there. Basically it's his choice to respond and we have no right to demand it (much though we would like it, myself included). Now, regarding the problems with ion_auth 2 in fetching data, I've been using it for a few hours now, and it seems to me that there is a push to remove as much functionality and 'wrapping' from the controller, and take it directly into the model (that, or the wrapping in the controller is not finished yet). So if any of you get problems with $this->ion_auth->groups() not working for example, try using $this->ion_auth_model->groups()->result() for example - it might just work! Create user worked fine, I've yet to encounter update user, I'll let you guys know. As for Keloo's problem, we still haven't heard from HIM, so Keloo doesn't support his friends eh ![]()
[eluser]Keloo[/eluser]
I've changed the smtp server from localhost to my smtp server and I got another error Quote:A PHP Error was encountered Strange, it used to work in the past, no I don't know why it doesn't work anymore. I guess I won't be using the email activation. ![]()
[eluser]Ben Edmunds[/eluser]
Hey guys, I don't get a chance to catch up on the forums that often so if you need more urgent help feel free to email me or contact me through github. Keloo, Those errors are being thrown by CI, not Ion Auth, so you need to troubleshoot from that end. The easiest thing will probably be to write some simple test email logic in a controller and then troubleshoot with the settings until you get it right. Just let me know if I can help anymore with that. |
Welcome Guest, Not a member yet? Register Sign In |