smtp.install 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * @file
  4. * The installation instructions for the SMTP Authentication Support.
  5. */
  6. /**
  7. * Implementation of hook_install().
  8. */
  9. function smtp_install() {
  10. variable_set('smtp_on', 0);
  11. }
  12. /**
  13. * @file
  14. * The uninstallation instructions for the SMTP Authentication Support.
  15. */
  16. /**
  17. * Implementation of hook_uninstall().
  18. */
  19. function smtp_uninstall() {
  20. variable_del('smtp_from');
  21. variable_del('smtp_fromname');
  22. variable_del('smtp_host');
  23. variable_del('smtp_hostbackup');
  24. variable_del('smtp_on');
  25. variable_del('smtp_password');
  26. variable_del('smtp_port');
  27. variable_del('smtp_protocol');
  28. variable_del('smtp_test_address');
  29. variable_del('smtp_username');
  30. if (variable_get('smtp_library', '') == drupal_get_path('module', 'smtp') . '/smtp.module') {
  31. variable_del('smtp_library');
  32. }
  33. } // End of contact_attach_uninstall().
  34. function smtp_enable() {
  35. variable_set('mail_system', array('default-system' => 'SmtpMailSystem'));
  36. }
  37. function smtp_disable() {
  38. variable_set('mail_system', array('default-system' => 'DefaultMailSystem'));
  39. }
  40. function smtp_update_7000() {
  41. if (variable_get('smtp_on', 0) != 0) {
  42. variable_set('mail_system', array('default-system' => 'SmtpMailSystem'));
  43. }
  44. }