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

[eluser]adityamenon[/eluser]
Okay, I just traveled the forums a bit, and discovered this site: http://getsparks.org/

So I guess Codeigniter-spark-ion-auth was created separately for the purposes of that site.

I still welcome answers for the rest of my questions...

[eluser]Ben Edmunds[/eluser]
Hey adityamenon,

I'm still very active with Ion Auth. I saw your pull request but haven't gotten to it yet.

The spark isn't any better, it's there so people can install it with sparks. The main github repo will always be the most up-to-date but I periodically update the spark.


OK, I just looked at Issue #63 (which has only been open for 4 days BTW). You're library code looks good but what's the reason for all the human_identity code? Send me another pull request with just the library changes and I'll be glad to merge it in.

Also, please stop using # for comments. We don't use that anywhere else in the project.


And, last but not least, glad you're excited about Ion Auth and open source. Feel free to test Ion Auth v2, I'm sure there are a few bugs in there you can help out with.

[eluser]adityamenon[/eluser]
Thanks for the clarifications...

Previously, since we were assuming that the identity selected would always be "email", the view file was written like this : "Please provide your email address so we can send you a new password"

But now, any identity can be used, not just email address, the view file has to account for this. When it is loaded, we must pass it the identity's name, so we can communicate with the user.

If a coder decides to use some sort of esoteric new column for "identity", their database column field will most likely have a name like this : esoteric_identity.

It will not look good if we say : "Please provide your esoteric_identity so we can send you a new password"

So, the human_identity is simply a variable that does this:
Code:
$identity_human = ucwords(str_replace('_', ' ', $identity)); //gets rid of underscores and capitalizes

You might want to look at the view file for forgot_password to see what this was for...

I think that should go into the config file, for easy use all over Smile

I'm sorry about the # used in the code for comments, I was doing that to differentiate my code from others... didn't realize git had this awesome code difference highlighting feature Smile I've gotten rid of them now.

[eluser]defectivereject[/eluser]
[quote author="Ben Edmunds" date="1303793835"]Madoc,

From a quick glance that code looks pretty good. Here's a little constructive criticism:

I really hate when people use php alt syntax outside of a view, I would recommend changing that for uniformity.

Also, some of your logic could be simplified, for example the is_user_banned() method should return FALSE by default and then the only additional return statements you need are when you're returning TRUE.

If I was using this I would integrate it into the login() method as well so your controller code doesn't change.[/quote]

I've done a similar check, but purely added it to the login script.
If an email address enters a wrong password it adds 1 to a field in the user table. once it hits 4 a check in the log in code before the check email, and get password, checks first the number of bad log in attempts. If it's 4 it stops the script, therefore not getting the password and ignores any further attempt to log in.
So if you try for a fifth time you just straight away get sent to a account locked page. No time limits e.t.c.
Stops brute force I guess?
I also implemented crypt on the salt to make it stronger???
Tell me if I'm wrong!!!

[eluser]mrwbsn[/eluser]
hello sir.. i wanna ask something.. i've set delimiter for message and error but when i see in page source it's still print in tag p.. how to fix that? thx sir. Smile

[eluser]dUspan[/eluser]
Hi

do you have a demo site for this app?thanks

i really want to see how this work first Big Grin thanks again.

[eluser]kimo_gusatava[/eluser]
is there a way to check if a passed ID is currently logged in?
like:
Code:
// url: http://example.com/user/profile/3213

function profile($id) {
    if(this->ion_auth->is_current_user($id)) {
        // show an editable profile
    } else {
        // show profile to public
    }

}

[eluser]adityamenon[/eluser]
Yes! Check this out : http://benedmunds.com/ion_auth/#get_user

[eluser]kimo_gusatava[/eluser]
hmmm I think i need to expand that further:

Code:
public function is_current_user($id=false) {
        $user = $this->get_user($id);
        if(sizeof($user)>0) {
            return ($user->id == $this->ci->session->userdata("id") && $id ) ? true: false;
        } else {
            return false;
        }
    }

so I can just call it like this :

Code:
public function view($id) {
        if($this->ion_auth->is_current_user($id)) {
            // display profile with editing options or a dashed board;
        } else {
            // display as other users or a front page or anything else;
        }
        
        
    }

[eluser]fima[/eluser]
Hello people.
I’am using Ion_auth in my project. And in project i want to not logout from site after i change user info.
Help me solve this problem.




Theme © iAndrew 2016 - Forum software by © MyBB