Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable/disable verification email #119

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions application/libraries/Aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,10 @@ public function update_remember($user_id, $expression=null, $expire=null) {
* @param string $email User's email address
* @param string $pass User's password
* @param string $name User's name
* @param bool $send_verification Send verification email to user
* @return int|bool False if create fails or returns user id if successful
*/
public function create_user($email, $pass, $name='') {
public function create_user($email, $pass, $name='', $send_verification = TRUE) {

$valid = TRUE;

Expand Down Expand Up @@ -744,15 +745,17 @@ public function create_user($email, $pass, $name='') {
$this->add_member($user_id, $this->config_vars['default_group']);

// if verification activated
if($this->config_vars['verification']){
$data = null;
$data['banned'] = 1;

$this->aauth_db->where('id', $user_id);
$this->aauth_db->update($this->config_vars['users'], $data);

// sends verifition ( !! e-mail settings must be set)
$this->send_verification($user_id);
if($send_verification) {
if($this->config_vars['verification']){
$data = null;
$data['banned'] = 1;

$this->aauth_db->where('id', $user_id);
$this->aauth_db->update($this->config_vars['users'], $data);

// sends verifition ( !! e-mail settings must be set)
$this->send_verification($user_id);
}
}

// Update to correct salted password
Expand Down