class hostingService_http_ssl

Hierarchy

Expanded class hierarchy of hostingService_http_ssl

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
hostingService::$available public property
hostingService::$has_restart_cmd protected property
hostingService::$server public property
hostingService::default_restart_cmd public function
hostingService::has_port public function
hostingService::mergeData protected function
hostingService::save public function
hostingService::setValues public function
hostingService::__construct function
hostingService_http::$service public property
hostingService_http::$ssl_enabled public property
hostingService_http_public::$has_port protected property Overrides hostingService::$has_port
hostingService_http_public::default_port function Overrides hostingService::default_port
hostingService_http_public::update function Overrides hostingService::update
hostingService_http_ssl::context_import public function Overrides hostingService::context_import
hostingService_http_ssl::context_options public function Overrides hostingService_http_public::context_options
hostingService_http_ssl::delete function Overrides hostingService::delete
hostingService_http_ssl::delete_revision function Overrides hostingService::delete_revision
hostingService_http_ssl::form function Overrides hostingService::form
hostingService_http_ssl::insert function Overrides hostingService::insert
hostingService_http_ssl::load function Overrides hostingService::load
hostingService_http_ssl::validate public function Overrides hostingService::validate
hostingService_http_ssl::view function Overrides hostingService::view

File

web_server/ssl/hosting_ssl.service.inc, line 7
Define Hosting service class for SSL.

View source
class hostingService_http_ssl extends hostingService_http_public {

  function load() {
    parent::load();
    $this->mergeData("SELECT ssl_port FROM {hosting_ssl_server} WHERE vid=:vid", array(':vid' => $this->server->vid));
    $this->ssl_enabled = TRUE;
  }

  function insert() {
    parent::insert();
    $id = db_insert('hosting_ssl_server')->fields(array(
      'vid' => $this->server->vid,
      'nid' => $this->server->nid,
      'ssl_port' => $this->ssl_port,
    ))->execute();
  }

  function delete() {
    parent::delete();
    db_delete('hosting_ssl_server')->condition('nid', $this->server->nid)->execute();
  }

  function delete_revision() {
    parent::delete_revision();
    db_delete('hosting_ssl_server')->condition('vid', $this->server->vid)->execute();
  }

  function form(&$form) {
    parent::form($form);

    $form['ssl_port'] = array(
      '#type' => 'textfield',
      '#title' => t('SSL Port'),
      '#required' => !empty($this->available),
      '#size' => 40,
      '#default_value' => isset($this->ssl_port) ? $this->ssl_port : '443',
      '#description' => t("The port that this service will use for encrypted traffic."),
      '#maxlength' => 255,
      '#weight' => -7,
    );
  }

  function view(&$render) {
    parent::view($render);
    $render['ssl_port'] = array(
      '#type' => 'item',
      '#title' => t('SSL Port'),
      '#markup' => filter_xss($this->ssl_port),
    );
  }

  public function validate(&$node, &$form) {
    parent::validate($node, $form);
    if ((int) $this->ssl_port <= 0) {
      form_set_error('ssl_port', t("The port you specify must be a number."));
    }
  }

  public function context_options($task_type, $ref_type, &$task) {
    parent::context_options($task_type, $ref_type, $task);
    $task->context_options[$this->service . '_ssl_port'] = $this->ssl_port;
  }

  public function context_import($context) {
    parent::context_import($context);

    $this->ssl_port = $context->http_ssl_port;
  }

}