You are here

drd_server.install.php.txt in Drupal Remote Dashboard Server 7.2

Same filename and directory in other branches
  1. 6.2 drd_server.install.php.txt

This file is used to remotely install the module drd_server on a server where the files of the module are available. If you do not want that to happen (i.e. for security reason) then either remove this file or rename it so that it can't be executed by a direct call. If you decided to do so, the module itself will not be affected in any case, just that you have to setup and configure it manually.

File

drd_server.install.php.txt
View source
  1. /**
  2. * @file
  3. * This file is used to remotely install the module drd_server on a server
  4. * where the files of the module are available. If you do not want that to
  5. * happen (i.e. for security reason) then either remove this file or rename
  6. * it so that it can't be executed by a direct call. If you decided to do so,
  7. * the module itself will not be affected in any case, just that you have to
  8. * setup and configure it manually.
  9. */
  10. /**
  11. * Root directory of Drupal installation.
  12. *
  13. * This assumes that you have installed this modules in the directory
  14. * sites/all/modules/drd_server and if this is not true in your case,
  15. * please adjust the first line of code accordingly.
  16. */
  17. define('DRUPAL_ROOT', realpath(getcwd()));
  18. define('MAINTENANCE_MODE', 'update');
  19. require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
  20. require_once DRUPAL_ROOT . '/includes/common.inc';
  21. require_once DRUPAL_ROOT . '/includes/entity.inc';
  22. require_once DRUPAL_ROOT . '/modules/system/system.module';
  23. require_once DRUPAL_ROOT . '/includes/database/query.inc';
  24. require_once DRUPAL_ROOT . '/includes/database/select.inc';
  25. drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
  26. if (isset($_GET['base_url'])) {
  27. global $base_url;
  28. $base_url = check_plain($_GET['base_url']);
  29. }
  30. if (isset($_GET['install'])) {
  31. $success = TRUE;
  32. if (!module_exists('drd_server')) {
  33. $success = module_enable(array('drd_server'));
  34. }
  35. drupal_flush_all_caches();
  36. if (!$success) {
  37. print 'Module DRD_SERVER can not be enabled.';
  38. }
  39. elseif (isset($_GET['server'])) {
  40. print 'Successfully installed. Please go to the ' .
  41. l('config page', 'admin/config/system/drd_settings',
  42. array('absolute' => TRUE, 'attributes' => array('target' => '_blank'))
  43. ) . ' and input this IP address: ' . ip_address();
  44. }
  45. else {
  46. print 'installed';
  47. }
  48. exit;
  49. }
  50. elseif (isset($_GET['uninstall'])) {
  51. if (module_exists('drd_server')) {
  52. module_disable(array('drd_server'));
  53. drupal_uninstall_modules(array('drd_server'));
  54. }
  55. variable_del('drd_aes_keys');
  56. drupal_flush_all_caches();
  57. print 'uninstalled';
  58. exit;
  59. }
  60. print 'error';