drd_server.install.php.txt in Drupal Remote Dashboard Server 6.2
<?php
/**
* 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.
*/
/**
* Root directory of Drupal installation.
*
* This assumes that you have installed this modules in the directory
* sites/all/modules/drd_server and if this is not true in your case,
* please adjust the first line of code accordingly.
*/
define('DRUPAL_ROOT', realpath(getcwd()));
define('MAINTENANCE_MODE', 'update');
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
require_once DRUPAL_ROOT . '/includes/common.inc';
require_once DRUPAL_ROOT . '/modules/system/system.module';
require_once DRUPAL_ROOT . '/includes/database.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
if (isset($_GET['base_url'])) {
global $base_url;
$base_url = check_plain($_GET['base_url']);
}
if (isset($_GET['install'])) {
module_rebuild_cache();
$modules = array();
if (!module_exists('drd_server')) {
$modules[] = 'drd_server';
}
if (!empty($modules)) {
module_enable($modules);
drupal_install_modules($modules);
drupal_flush_all_caches();
}
$success = module_exists('drd_server');
if (!$success) {
print 'Module DRD_SERVER can not be enabled.';
}
else if (isset($_GET['server'])) {
print 'Successfully installed. Please go to the ' . l('config page', 'admin/config/system/drd_settings', array('absolute' => TRUE, 'attributes' => array('target' => '_blank'))) . ' and input this IP address: ' . ip_address();
}
else {
print 'installed';
}
exit;
}
else if (isset($_GET['uninstall'])) {
if (module_exists('drd_server')) {
module_disable(array('drd_server'));
drupal_uninstall_module('drd_server');
}
variable_del('drd_aes_keys');
drupal_flush_all_caches();
print 'uninstalled';
exit;
}
print 'error';
File
drd_server.install.php.txt
View source
-
- /**
- * 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.
- */
-
- /**
- * Root directory of Drupal installation.
- *
- * This assumes that you have installed this modules in the directory
- * sites/all/modules/drd_server and if this is not true in your case,
- * please adjust the first line of code accordingly.
- */
- define('DRUPAL_ROOT', realpath(getcwd()));
- define('MAINTENANCE_MODE', 'update');
-
- require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
- require_once DRUPAL_ROOT . '/includes/common.inc';
- require_once DRUPAL_ROOT . '/modules/system/system.module';
-
- require_once DRUPAL_ROOT . '/includes/database.inc';
-
- drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
-
- if (isset($_GET['base_url'])) {
- global $base_url;
- $base_url = check_plain($_GET['base_url']);
- }
-
- if (isset($_GET['install'])) {
- module_rebuild_cache();
- $modules = array();
- if (!module_exists('drd_server')) {
- $modules[] = 'drd_server';
- }
- if (!empty($modules)) {
- module_enable($modules);
- drupal_install_modules($modules);
- drupal_flush_all_caches();
- }
- $success = module_exists('drd_server');
- if (!$success) {
- print 'Module DRD_SERVER can not be enabled.';
- }
- else if (isset($_GET['server'])) {
- print 'Successfully installed. Please go to the ' . l('config page', 'admin/config/system/drd_settings', array('absolute' => TRUE, 'attributes' => array('target' => '_blank'))) . ' and input this IP address: ' . ip_address();
- }
- else {
- print 'installed';
- }
- exit;
- }
- else if (isset($_GET['uninstall'])) {
- if (module_exists('drd_server')) {
- module_disable(array('drd_server'));
- drupal_uninstall_module('drd_server');
- }
- variable_del('drd_aes_keys');
- drupal_flush_all_caches();
- print 'uninstalled';
- exit;
- }
- print 'error';