You are here

function user_registrationpassword_uninstall in User registration password 7

Same name and namespace in other branches
  1. 8 user_registrationpassword.install \user_registrationpassword_uninstall()
  2. 6 user_registrationpassword.install \user_registrationpassword_uninstall()

Implements hook_uninstall().

File

./user_registrationpassword.install, line 48
Uninstall function to clean up variables data.

Code

function user_registrationpassword_uninstall() {

  // Reset system variables back to save defauls.
  variable_set('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL);
  variable_set('user_email_verification', TRUE);
  variable_del('user_mail_register_pending_approval_notify');
  variable_del('user_mail_register_no_approval_required_notify');

  // Reset the original (or previous adapted) ativation email template.
  variable_set('user_mail_status_activated_subject', variable_get('user_registrationpassword_user_mail_status_activated_subject_original', ''));
  variable_set('user_mail_status_activated_body', variable_get('user_registrationpassword_user_mail_status_activated_body_original', ''));

  // Delete all variables related to user_registrationpassword.
  db_delete('variable')
    ->condition('name', db_like('user_registrationpassword_') . '%', 'LIKE')
    ->execute();
}