You are here

function hostingService_http_pack::load in Hostmaster (Aegir) 6

Overrides hostingService::load

File

modules/hosting/web_pack/hosting_web_pack.service.inc, line 41

Class

hostingService_http_pack

Code

function load() {
  parent::load();
  $ssl_enabled = TRUE;
  $master_servers = array();
  $slave_servers = array();
  $result = db_query('SELECT web_server_nid, type FROM {hosting_web_pack} WHERE vid = %d', $this->server->vid);
  while ($web_server = db_fetch_object($result)) {
    if ($web_server->type == 'master') {
      $master_servers[] = $web_server->web_server_nid;
    }
    else {
      $slave_servers[] = $web_server->web_server_nid;
    }
    $server = node_load($web_server->web_server_nid);
    $ssl_enabled = $ssl_enabled && $server->services['http']->ssl_enabled;
  }
  $this->ssl_enabled = $ssl_enabled;
  $this
    ->setValues(array(
    'master_servers' => drupal_map_assoc($master_servers),
  ));
  $this
    ->setValues(array(
    'slave_servers' => drupal_map_assoc($slave_servers),
  ));
}