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

[eluser]Ben Edmunds[/eluser]
Bernd,

What do you think about putting the subject and stuff in the config file?

Do you prefer the template?

[eluser]joytopia[/eluser]
Ben,

I would much prefer the template. It is so comfortable to put text and functions in it. Or changing it from text to html for example.

In our project we will have a lot of different emails in different languages, with personal infos for the user, like reminders etc.

So I will put all of them into email templates, load lines from language files or text from database and so on.

I think, sending emails from views is a good practise.

Best regards
Bernd

[eluser]joytopia[/eluser]
Ben,

perhaps it would be a good idea to take the email out of the register (forgot password etc.) method and put it into a separate email method. This could be done in the controller, because sending emails has nothing to do with authentication.

Now, instead of only returning bool, the registration method could return an array with relevant information like id, activation-code etc.

The controller could look like this:

Code:
if($register = $this->ion_auth->register())
{
    //do something with $register like sending a confirmation email
    //or telling the new user his user-number
    //or update the new user-record with some calculated data
}
else
{
    // registration failed
}

So the functionality, look and feel of the emails can be totally controlled by the programmer.

What do you think?

Best regards
Bernd

[eluser]Phil Sturgeon[/eluser]
I'd rather not. The entire point of Ion Auth is that it's simple, lightweight and helps the programmer out. That complicates matters and makes the implementation a little lengthier.

As far as "email has nothing to do with authentication" goes, sure it does. Perhaps we could have a register() and an insert_user() function, one does the whole shebang and the other just literally inserts the user.

[eluser]joytopia[/eluser]
Phil,
a separate email-method could also be situated in the library file and accessed by the register-method.

It would not be less lightweight.
But it would give the programmer the possibility to design his emails without changing the library.

Bernd

[eluser]Phil Sturgeon[/eluser]
I get that, it's just more hassle and involved current users of the library changing their applications for no real reason.

Could you suggest a way to get the same functionality without buggering up the register() method?

[eluser]joytopia[/eluser]
append an additional parameter $send_email = TRUE


Code:
if($send_email)
{
    //send email like before
}
else
{
    return $data;
}

[eluser]Phil Sturgeon[/eluser]
Thank's for suggesting an if statement, I only wish I had thought of that!

Perhaps a config item could be added (defaulting to true) and if set to false it won't send emails.

The true clause could contain the email code moved to its own method so it can be called separately. It's all on GitHub so fork and commit!

[eluser]GlennJ[/eluser]
Hi guys

I've been looking at the code and I would like to implement Ion Auth twice on the same site. Now I can obviously do this via the config files so that one uses a "customers" table and another uses a "admin" table, but if I want both of them to use the "email" field as the identity won't they clash?

[eluser]Ben Edmunds[/eluser]
Glennj,

Why not just use groups?




Theme © iAndrew 2016 - Forum software by © MyBB