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]
  • #961 / Jun 06, 2011 10:52am

    JonoB

    133 posts

    I have noticed that a default Ion Auth install uses $this->ion_auth->errors() which reads the language file for displaying the error in the correct language. How can I make use of $this->ion_auth->errors() within my script to call the correct error message from the language file.

    Sorry if this is a noobish question, this is my first time using a pre written library for CI.

    —Paul

    $this->ion_auth->errors() is a method used to obtain messages generated by the ion_auth library (application/libraries/ion_auth).

    If you look in that file, you will see various bits of code like

    $this->set_error('activate_unsuccessful');

    which corresponds to the language file:

    $lang['activate_unsuccessful'] = 'Unable to Activate Account';

    Finally, all the messages are output via:

    public function errors()
    {
        $_output = '';
        foreach ($this->errors as $error)
        {
            $_output .= $this->error_start_delimiter . $this->ci->lang->line($error) . $this->error_end_delimiter;
        }
    
        return $_output;
    }

    Long story short, if you want to output just a single message without using the lib, you can do something like:

    $this->ci->lang->load('ion_auth');
    echo $this->ci->lang->line('activate_unsuccessful');
  • #962 / Jun 07, 2011 4:14am

    austintbiggs

    40 posts

    I’m trying to figure out how to add a “friends” feature to ion auth, have any clue how to approach this? and also I was wondering what the scope of Ion Auth 2 is, and also how extensible it will be, because I’m aiming to add friends and full profiles

  • #963 / Jun 07, 2011 9:26pm

    playaz

    17 posts

    Just a quicky - does this library work with the latest version of CodeIgniter (currently v2.0.2)

    Thanks - the library looks awesome 😊

  • #964 / Jun 07, 2011 9:30pm

    DephNet[Paul]

    11 posts

    Yes, it does.

    —Paul

  • #965 / Jun 07, 2011 9:47pm

    playaz

    17 posts

    Yes, it does.

    —Paul

    Wow.. that was quick! Cheers Paul :D

  • #966 / Jun 15, 2011 10:48am

    Abdelouahab

    8 posts

    its work with oracle ?

  • #967 / Jun 15, 2011 10:56am

    toopay

    1583 posts

    If you have a ported oracle (MariaDB, Cassandra, Mongo, or anything left in this world)  active record that meet CI requirement & spec, yes.

  • #968 / Jun 16, 2011 9:43am

    rohitailani

    1 posts

    Hello everyone,
    I am new to codeigniter,
    I used your code for login and create, its good but i could not work out with edit and also is there any function by which i can check the uniqueness of the identity field while editing.
    Please guide me.

  • #969 / Jun 16, 2011 9:49am

    cusaro

    1 posts

    supports ion auth multiple groups per user?

    cusaro

  • #970 / Jun 20, 2011 8:45am

    adityamenon

    175 posts

    Hi, can anyone please confirm if the new Ion Auth Spark (https://github.com/benedmunds/CodeIgniter-Spark-Ion-Auth) is better than Ion Auth, and stable to use in production with CI 2.0.2? The README does not cover this question…

    Also, there are zero issues reported for this project on GitHub, so does that mean there are absolutely no issues? Because I can see that Issue #63 which was reported on the original IonAuth (forgotten_password function in model still uses only $email and does not support $identity) has not been solved in Spark. So what is the purpose in creating this new version?

    And finally, is Ben maintaining this project anymore? I sent a pull request that solves #63 in IonAuth yesterday, but it has not been merged yet. The changes I made are no more than a couple of lines that were moved, almost no new code has been added - so verifying it must be simple. I know I’m being extremely impatient with this question, but this is my first experience pushing something, and I’d be overjoyed to see a piece of me in an OS project. How does that have anything to do with Ben’s interest level, you ask? Well, not checking in to your baby once every couple of days indicates waning interest, and Ben didn’t make any changes since 24th last month…

    Sorry about the long post.

  • #971 / Jun 20, 2011 9:43am

    adityamenon

    175 posts

    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…

  • #972 / Jun 20, 2011 8:06pm

    Ben Edmunds

    812 posts

    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.

  • #973 / Jun 20, 2011 11:08pm

    adityamenon

    175 posts

    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:

    $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 😊

    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 😊 I’ve gotten rid of them now.

  • #974 / Jun 25, 2011 7:31pm

    defectivereject

    36 posts

    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.

    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!!!

  • #975 / Jun 26, 2011 12:19am

    mrwbsn

    4 posts

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

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

ExpressionEngine News!

#eecms, #events, #releases