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

[eluser]hovhannes[/eluser]
Thanks Ben Smile

[eluser]davidjlynch[/eluser]
Hi Ben,

I am new to codeigniter, great work, just one thing, I cannot seem to get the email_check to return error message 'Email already in use' or something similar using the below;

Code:
$this->form_validation->set_rules('email', 'Email Address', 'required|valid_email|callback_email_check');

/
Code:
**
     * Checks email
     *
     * @return bool
     * @author Mathew
     **/
    public function email_check($email = '')
    {
        if (empty($email))
        {
        return FALSE;
        }
        return $this->db->where('email', $email)
            ->where($this->ion_auth->_extra_where)
            ->count_all_results($this->tables['users']) > 0;
    }

also tried using you callback function on page 25 of this post, any help would be greatly appreciated.

Thanks in advance

[eluser]Ben Edmunds[/eluser]
davidjlynch,

Add the callback function I posted earlier to your controller and it should work.

Let me know if you get any errors.

[eluser]Timothy_[/eluser]
Does anyone have a good solution to retrieving the users that are currently logged in?

Thanks,

Tim

[eluser]joytopia[/eluser]
Email functions: bug-fixes and new features

Bug-fixes:

forgotten_password and forgotten_password_complete:
in case of success an error-message was set instead of set_message.

Plain-text version of emails did not show the link.
This is fixed by the email_with_markers feature.

New features:

email_with_markers:

Code:
$config['email_templates']     = 'auth/email_with_markers/';

now uses a set of email templates with markers ###subject###, ###message### and ###alt_message###

So you have a comfortable control over functionality, look an feel of your emails.

You can use the methods
Code:
$this->ion_auth->get_message_from_template($template, $data)

and
Code:
$this->ion_auth->send_email($email, $subject, $message, $alt_message = '')
everywhere in your application to easily send well designed admin-emails.

Now supports mailtype

simply set
Code:
/**
     * Mail type, 'text' or 'html'
     */
    $config['mailtype']     = 'html';


Send email and / or return a data-array

Code:
/**
     * Send email
     * Ion_auth either sends an email directly (and returns bool)
     * or it returns a data-array, so that you can write your own email methods
     * or both
     * set to 'email', 'data' or 'both'
     * Default : 'email'
     */
    $config['send_email']     = 'email';

So you can easily do so something with calculated data directly after the registration, i.e. update some fields in the database or show the new user his user_id or make your own confirmation-process.


I tested as well as I could. It should be fully backward compatible.
As I am not yet on GitHub, I post the files here.

Thank you for your feedback!

Best regards

Bernd

[eluser]joytopia[/eluser]
[quote author="Timothy_" date="1273747687"]Does anyone have a good solution to retrieving the users that are currently logged in?

Thanks,

Tim[/quote]

What about showing the username from table ci_sessions WHERE last_activity > now() - 360

Best regards
Bernd

[eluser]Ben Edmunds[/eluser]
Bernd,

Those changes sound pretty good to me but I haven't had a chance to go through the code yet (crazy week!). Any chance you could do a github pull request anytime soon? If not, I can probably get around to going through it sometime next week.


Thanks!

[eluser]megabyte[/eluser]
Library looks utterly amazing. I think both Ben and Phil rock, although I don't know them, lol.

Anyway my question is:

How bug free is it now? would you recommend for or against using it on a live website.

[eluser]Ben Edmunds[/eluser]
megabyte,

I know us and I agree, we do rock.

There are no known bugs at the moment and I am using the library on several production sites plus all of the sites that are using PyroCMS are using Ion Auth under the hood.

[eluser]megabyte[/eluser]
What about the bug fixes joytopia mentioned?

Are these actual bugs that needed to be fixed?




Theme © iAndrew 2016 - Forum software by © MyBB