Browse Source

v2.5.6

- added abilty to set a config for CI's Email Library
develop
REJack 9 years ago
parent
commit
fe117dd30f
  1. 2
      application/config/aauth.php
  2. 14
      application/libraries/Aauth.php

2
application/config/aauth.php

@ -63,6 +63,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| |
| ['email'] Sender email address, used for remind_password, send_verification and reset_password | ['email'] Sender email address, used for remind_password, send_verification and reset_password
| ['name'] Sender name, used for remind_password, send_verification and reset_password | ['name'] Sender name, used for remind_password, send_verification and reset_password
| ['email_config'] Array of Config for CI's Email Library
| |
| ['verification'] User Verification, if TRUE sends a verification email on account creation. | ['verification'] User Verification, if TRUE sends a verification email on account creation.
| ['verification_link'] Link for verification without site_url or base_url | ['verification_link'] Link for verification without site_url or base_url
@ -135,6 +136,7 @@ $config_aauth["default"] = array(
'email' => 'admin@admin.com', 'email' => 'admin@admin.com',
'name' => 'Emre Akay', 'name' => 'Emre Akay',
'email_config' => false,
'verification' => false, 'verification' => false,
'verification_link' => '/account/verification/', 'verification_link' => '/account/verification/',

14
application/libraries/Aauth.php

@ -13,7 +13,7 @@
* *
* @copyright 2014-2016 Emre Akay * @copyright 2014-2016 Emre Akay
* *
* @version 2.5.5 * @version 2.5.6
* *
* @license LGPL * @license LGPL
* @license http://opensource.org/licenses/LGPL-3.0 Lesser GNU Public License * @license http://opensource.org/licenses/LGPL-3.0 Lesser GNU Public License
@ -518,6 +518,10 @@ class Aauth {
$this->aauth_db->where('email', $email); $this->aauth_db->where('email', $email);
$this->aauth_db->update($this->config_vars['users'], $data); $this->aauth_db->update($this->config_vars['users'], $data);
if(is_array($this->config_vars['email_config'])){
$this->CI->email->initialize($this->config_vars['email_config']);
}
$this->CI->email->from( $this->config_vars['email'], $this->config_vars['name']); $this->CI->email->from( $this->config_vars['email'], $this->config_vars['name']);
$this->CI->email->to($row->email); $this->CI->email->to($row->email);
$this->CI->email->subject($this->CI->lang->line('aauth_email_reset_subject')); $this->CI->email->subject($this->CI->lang->line('aauth_email_reset_subject'));
@ -560,6 +564,10 @@ class Aauth {
$this->aauth_db->where('id', $row->id); $this->aauth_db->where('id', $row->id);
$this->aauth_db->update($this->config_vars['users'] , $data); $this->aauth_db->update($this->config_vars['users'] , $data);
if(is_array($this->config_vars['email_config'])){
$this->CI->email->initialize($this->config_vars['email_config']);
}
$this->CI->email->from( $this->config_vars['email'], $this->config_vars['name']); $this->CI->email->from( $this->config_vars['email'], $this->config_vars['name']);
$this->CI->email->to($email); $this->CI->email->to($email);
$this->CI->email->subject($this->CI->lang->line('aauth_email_reset_success_subject')); $this->CI->email->subject($this->CI->lang->line('aauth_email_reset_success_subject'));
@ -944,6 +952,10 @@ class Aauth {
$this->aauth_db->where('id', $user_id); $this->aauth_db->where('id', $user_id);
$this->aauth_db->update($this->config_vars['users'], $data); $this->aauth_db->update($this->config_vars['users'], $data);
if(is_array($this->config_vars['email_config'])){
$this->CI->email->initialize($this->config_vars['email_config']);
}
$this->CI->email->from( $this->config_vars['email'], $this->config_vars['name']); $this->CI->email->from( $this->config_vars['email'], $this->config_vars['name']);
$this->CI->email->to($row->email); $this->CI->email->to($row->email);
$this->CI->email->subject($this->CI->lang->line('aauth_email_verification_subject')); $this->CI->email->subject($this->CI->lang->line('aauth_email_verification_subject'));

Loading…
Cancel
Save