You are here

function user_email_verification_user_presave in User email verification 7

Same name and namespace in other branches
  1. 8 user_email_verification.module \user_email_verification_user_presave()

Implements hook_user_presave().

File

./user_email_verification.module, line 584
This module allows you to have e-mail verification and in meanwhile allowing the users to type their own passwords. If they do not verify their accounts in a certain time interval the user will be blocked.

Code

function user_email_verification_user_presave(&$edit, $account, $category) {

  // An admin user activated a user account
  if (user_access('administer users') && (isset($edit['status']) && $edit['status'] == 1) && (isset($account->original, $account->original->status) && $account->original->status == 0)) {

    // Mark user as verified
    db_update('user_email_verification')
      ->fields(array(
      'verified' => 1,
    ))
      ->condition('uid', $account->uid, '=')
      ->execute();
  }
}