ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Ion Auth - Lightweight Auth System based on Redux Auth 2

February 10, 2010 7:00pm

Subscribe [287]
  • #181 / Apr 13, 2010 11:51am

    Ben Edmunds

    812 posts

    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]’);

  • #182 / Apr 13, 2010 12:03pm

    joytopia

    76 posts

    Currently you can’t call these directly because they are in the model…

    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

  • #183 / Apr 13, 2010 12:05pm

    Ben Edmunds

    812 posts

    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.

  • #184 / Apr 13, 2010 8:03pm

    Schumacher

    25 posts

    Great, just what i need 😊

    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.

    //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.

  • #185 / Apr 13, 2010 8:09pm

    Ben Edmunds

    812 posts

    Schumacher,

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

  • #186 / Apr 13, 2010 8:18pm

    Schumacher

    25 posts

    Yes i know 😊 ..
    Just thought it would be nice with a example that shows well :p

    But what about the callback thing ?

  • #187 / Apr 14, 2010 12:31am

    Ben Edmunds

    812 posts

    Schumacher,

    I haven’t tested this yet but see if this will do what you need and makes sense, http://github.com/benedmunds/CodeIgniter-Ion-Auth/blob/4b5483ca0705140801591d2588f00744622b3ff7/controllers/auth.php

  • #188 / Apr 14, 2010 10:31am

    Schumacher

    25 posts

    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 😊

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

  • #189 / Apr 14, 2010 10:37am

    Ben Edmunds

    812 posts

    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.

  • #190 / Apr 14, 2010 10:43am

    Schumacher

    25 posts

    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

  • #191 / Apr 14, 2010 1:57pm

    Ben Edmunds

    812 posts

    Just let me know if you have any problems with it and we can walk through it.

    Overloading in this case will map the library method calls to the model if the method doesn’t exist in the library.

    So for instance if you call:

    $this->ion_auth->email_check('[email protected]');

    the email_check() method doesn’t exist in the library but it does in the model so the library will return the model method call.  So to you, who is calling the method, it will be transparent.

  • #192 / Apr 14, 2010 2:01pm

    Schumacher

    25 posts

    Ohh, okay. very nice 😊
    When would that be loaded up ?

  • #193 / Apr 14, 2010 2:04pm

    Ben Edmunds

    812 posts

    I’m trying to get info out of Phil Sturgeon but he’s too sober to code…

  • #194 / Apr 14, 2010 3:19pm

    Ben Edmunds

    812 posts

    The overloading has been pushed.

    Thanks Phil!


    Enjoy,

  • #195 / Apr 14, 2010 4:36pm

    jonathonmorgan

    2 posts

    Hi all,

    Ion Auth has been great to work with—easy to install, and super helpful community discussion to tweak.  I’m a little embarrassed to ask, but I’m having trouble working how to use password recovery.  The activation code is generated, the email is sent, the link seems to work…but when the user arrives at the page via the activation link in their email, their redirected to the main auth/login view, where they’re prompted to enter their password.

    I’m not sure where to go from here. Has the password been reset to their original password (whatever they entered when the account was created)?  Or are they being redirected to the wrong view (should they land, for example, on the change password view instead)? 

    Thanks in advance for any advance—and apologies if I’m just missing something obvious!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases