logintoboggan.install 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the logintoboggan module.
  5. */
  6. /**
  7. * Implement hook_update_last_removed().
  8. */
  9. function logintoboggan_update_last_removed() {
  10. return 6001;
  11. }
  12. /**
  13. * Implement hook_disable().
  14. *
  15. */
  16. function logintoboggan_disable() {
  17. // Clean up the custom access denied path if it's set.
  18. if (variable_get('site_403', '') == 'toboggan/denied') {
  19. variable_set('site_403', '');
  20. }
  21. }
  22. /**
  23. * Remove hardcoded numeric deltas from blocks.
  24. */
  25. function logintoboggan_update_7000(&$sandbox) {
  26. // Get an array of the renamed block deltas, organized by module.
  27. $renamed_deltas = array(
  28. 'logintoboggan' => array(
  29. '0' => 'logintoboggan_logged_in',
  30. ),
  31. );
  32. update_fix_d7_block_deltas($sandbox, $renamed_deltas, array());
  33. }
  34. /**
  35. * Implement hook_uninstall().
  36. */
  37. function logintoboggan_uninstall() {
  38. $variables = array(
  39. 'logintoboggan_login_block_type',
  40. 'logintoboggan_login_block_message',
  41. 'logintoboggan_login_with_email',
  42. 'logintoboggan_confirm_email_at_registration',
  43. 'logintoboggan_pre_auth_role',
  44. 'logintoboggan_purge_unvalidated_user_interval',
  45. 'logintoboggan_redirect_on_register',
  46. 'logintoboggan_redirect_on_confirm',
  47. 'logintoboggan_login_successful_message',
  48. 'logintoboggan_minimum_password_length',
  49. 'logintoboggan_immediate_login_on_register',
  50. 'logintoboggan_override_destination_parameter',
  51. 'logintoboggan_denied_remove_sidebars',
  52. );
  53. foreach ($variables as $variable) {
  54. variable_del($variable);
  55. }
  56. }