You are here

function drd_server_domain_info in Drupal Remote Dashboard Server 7.2

Same name and namespace in other branches
  1. 6.2 drd_server.domain.inc \drd_server_domain_info()
  2. 6 drd_server.domain.inc \drd_server_domain_info()
  3. 7 drd_server.domain.inc \drd_server_domain_info()

DRD Server Action to retrieve all kind of information from the current domain.

Return value

string Array prepared as returnable string to DRD containing domain information.

1 string reference to 'drd_server_domain_info'
drd_server_drd_server_actions in ./drd_server.module
Implements hook_drd_server_actions().

File

./drd_server.domain.inc, line 14
Provides domain related functionality triggered by DRD.

Code

function drd_server_domain_info() {
  if (module_exists('mollom')) {
    $mollom_status = _mollom_status(TRUE);
    if (is_array($mollom_status)) {
      if (empty($mollom_status['isVerified'])) {

        /*
         * The index 'isVerified' is either not defined (pre Mollom version 2.9)
         * or it is set to false, from version 2.9 onwards.
         *
         * In both cases, mollom doesn't work and therefore gets disabled.
         */
        module_disable(array(
          'mollom',
        ));
      }
    }
  }
  $result = array(
    'drd_db' => array(
      'drd_domain' => array(
        'mode' => 'update',
        'field' => 'name',
        'value' => variable_get('site_name', ''),
        'where' => 'did = @id',
      ),
      'drd_server' => array(
        'mode' => 'update',
        'field' => 'drupalversion',
        'value' => VERSION,
        'where' => 'sid = @sid',
      ),
    ),
  );

  // Load .install files.
  include_once DRUPAL_ROOT . '/includes/install.inc';
  drupal_load_updates();

  // Check run-time requirements and status information.
  $requirements = module_invoke_all('requirements', 'runtime');
  $result['cache']['info']['domain'] = array(
    'title' => 'Information',
    'callback' => 'theme',
    'arguments' => array(
      'status_report',
      'variables' => array(
        'requirements' => $requirements,
      ),
    ),
  );
  $vars = $GLOBALS;
  $result['cache']['variable']['domain'] = array(
    'title' => 'Variables',
    'callback' => '_drd_variables_block',
    'arguments' => array(
      serialize($vars['conf']),
    ),
  );
  unset($vars['conf']);
  $result['cache']['globals']['domain'] = array(
    'title' => 'Globals',
    'callback' => '_drd_variables_block',
    'arguments' => array(
      serialize($vars),
    ),
  );
  return drd_server_result('info', $result);
}