You are here

system_status.module in System Status 6.2

Same filename and directory in other branches
  1. 8.2 system_status.module
  2. 8 system_status.module
  3. 7 system_status.module

Drupal system status

File

system_status.module
View source
<?php

/**
 * @file
 * Drupal system status
 */

/**
 * Implements hook_help().
 *
 * Displays help and module information.
 */
function system_status_help($path, $arg) {
  switch ($path) {
    case 'admin/help#system_status':
      $output = '<h2>' . t('System Status module information') . '</h2>';
      $output .= '<p>' . t('System Status provides an easy way to get an overview of all the available updates for your Drupal websites.') . '<br/>';
      $output .= t('Enable the System Status module on all your Drupal websites and allow reporting to DrupalStatus.org for a centralized overview and email summaries of available updates and installed versions.') . '</p>';
      $output .= '<p>' . t('The accompanying service offered by DrupalStatus.org is free but if you do not want to use this service this lightweight module allows you to built your own overviews and dashboard.') . '</p>';
      $output .= '<p>' . t('How does it work?') . '</p>';
      $output .= '<ul>';
      $output .= '<li>' . t('Enable the System Status module on your Drupal website') . '</li>';
      $output .= '<li>' . t('Click the "Add this site to your DrupalStatus.org overview" button to be redirected to the DrupalStatus website with the necessary credentials.') . '</li>';
      $output .= '</ul>';
      return $output;
      break;
  }
}

/**
 * Implements hook_menu().
 */
function system_status_menu() {
  $items = array();
  $items['admin/reports/system_status'] = array(
    'title' => 'System Status',
    'description' => 'Output of the System status module',
    'access callback' => 'system_status_access_callback',
    'access arguments' => array(
      3,
    ),
    'page callback' => 'system_status_status_page',
    'file' => 'system_status_status.page.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/system/system_status'] = array(
    'title' => 'System Status',
    'description' => 'Configuration for System status module',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'system_status_form',
    ),
    'file' => 'system_status.admin.inc',
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  return $items;
}

/**
 * Access callback: Check authorized IP.
 *
 * @see system_status_menu()
 */
function system_status_access_callback($token = FALSE) {
  if ($token !== variable_get('system_status_token', "")) {
    return FALSE;
  }
  $ip_address = ip_address();
  if (variable_get('system_status_service_allow_drupalstatus', 1) == 1) {
    if ($ip_address == gethostbyname("status.drupalstatus.org.")) {
      return TRUE;
    }
  }
  return FALSE;
}

Functions

Namesort descending Description
system_status_access_callback Access callback: Check authorized IP.
system_status_help Implements hook_help().
system_status_menu Implements hook_menu().