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

[eluser]Ben Edmunds[/eluser]
There are three methods for this:

username_check()
email_check()
identity_check()

Currently you can't call these directly because they are in the model but Phil is pushing overloading today or tomorrow that will enable you to call these through the library, ie $this->ion_auth->email_check('[email protected]');

[eluser]joytopia[/eluser]
[quote author="Ben Edmunds" date="1271188296"]

Currently you can't call these directly because they are in the model...[/quote]

Ben,
perhaps it is a stupid question:
Why can't I call directly a method in a model?
I did this an it worked.

Thanks and best regards
Bernd

[eluser]Ben Edmunds[/eluser]
Bernd,

You can through the model, $this->ion_auth_model->method(), but ideally you it should be called through the library, $this->ion_auth->method().

This will be possible once Phil pushes the overloading.

[eluser]Schumacher[/eluser]
Great, just what i need Smile

just a thought, you might want to make a slict chance in the auth controller.
Because when im creating a user it redirects me to the auth site, without any messages if there was an error(email, username allready exists), so the user thinks it has been created , but wasn't.

so i did it this way.
Code:
//register the user
            if($this->ion_auth->register($username,$password,$email,$additional_data))
            {
                $this->session->set_flashdata('message', "Brugeren er nu oprettet");
                   redirect("site", 'refresh');
            }else {
                $this->session->set_flashdata('message', $this->ion_auth->errors());
                redirect("auth/create_user", 'refresh');
            }
though the form dosn't get filled out with the old information, because it wasn't the form_validation that sent it back. So, is there a way to get that to work, or should i just make a callback function on this.

[eluser]Ben Edmunds[/eluser]
Schumacher,

The controller is just there as an example so feel free to modify it as much as needed.

[eluser]Schumacher[/eluser]
Yes i know Smile ..
Just thought it would be nice with a example that shows well :p

But what about the callback thing ?

[eluser]Ben Edmunds[/eluser]
Schumacher,

I haven't tested this yet but see if this will do what you need and makes sense, http://github.com/benedmunds/CodeIgniter...s/auth.php

[eluser]Schumacher[/eluser]
ahh, think you missunderstood me in the last one there, that wasn't the thing i was looking for..
Forget about the controller thing :p
Its just about the thing about username/email hwas taken, because it redirects me without putting the information back in the fields agian.
You said phil would do something about being able to access those functions from the library, but does that mean i can use them as callback functions, so it will fix the problem i have about the from dosn't get repopulated..
hopfully you know what i mean Smile

Sorry for all the questions, still gettting used to CI Smile

[eluser]Ben Edmunds[/eluser]
Schumacher,

Yea I think I understood and this change should fix your problem since it checks for the register() to come back with success and if not displays $this->ion_auth->errors(). There should be an error if the email is already taken and with the way the if is structured you should not lose your form data.

Once the overloading is in you can definitely use that in a callback as well but this should fix it for now.

[eluser]Schumacher[/eluser]
okay, i havn't tried it yet, but okay.
Im not used to how the form_validation work, and at which points it makes it possible to repopulate the form

though what is the meaning of that 'overloading' you speak about? dosn't seem to ring a bell




Theme © iAndrew 2016 - Forum software by © MyBB