Commit 22641d78 authored by drumm's avatar drumm Committed by Neil Drumm

Remove ip_address, it is no longer used.

parent 22b62c56
......@@ -20,11 +20,6 @@ function hosting_server_schema() {
'not null' => TRUE,
'default' => 0,
),
'ip_address' => array(
'type' => 'text',
'size' => 'big',
'not null' => FALSE,
),
'script_user' => array(
'type' => 'text',
'size' => 'big',
......
......@@ -237,18 +237,6 @@ function hosting_server_form(&$node) {
function hosting_nodeapi_server_presave(&$node) {
hosting_server_services_from_post($node);
if (!$node->services['server']->ip_address) {
$ip = gethostbyname($node->title);
// setup IP only if resolution succeeded
if ($ip != $node->title) {
$node->services['server']->ip_address = $ip; // required to fool the ip check below
}
else {
form_set_error('title', t('Could not resolve IP address of %name. Either set the server name to a FQDN (Fully Qualified Domain Name) or hardcode the IP here.', array('%name' => $node->title)));
}
}
}
/**
......
......@@ -72,17 +72,6 @@ class hostingService_server_base extends hostingService {
public $type = 'base';
function form(&$form) {
$form['ip_address'] = array(
'#type' => 'textfield',
'#title' => t('IP address'),
'#default_value' => $this->ip_address,
'#size' => 15,
'#maxlength' => 15,
'#description' => t("The IP address the server can be accessed by. This will be used to create database grants, amongst other things.<br />If this is empty, Hostmaster will attempt to resolve the hostname to get the address.<br />If that fails, the hostname (ie. the node title) will be used instead."),
'#weight' => -9
);
$form['drush_path'] = array(
'#type' => 'textfield',
'#title' => t('Drush path'),
......@@ -138,18 +127,13 @@ class hostingService_server_base extends hostingService {
if ($this->script_user == 'root') {
form_set_error('script_user', t('For security reasons, you should not run drush commands as the root user. Please choose a different system account name.'));
}
if ($this->ip_address) {
if (!_hosting_valid_ip($this->ip_address)) {
form_set_error('ip_address', t('Invalid IP address'));
}
}
}
function insert() {
parent::insert();
db_query("INSERT INTO {hosting_server} (vid, nid, ip_address, script_user, config_path, backup_path, drush_path)
db_query("INSERT INTO {hosting_server} (vid, nid, script_user, config_path, backup_path, drush_path)
VALUES (%d, %d, '%s', '%s', '%s', '%s', '%s')",
$this->server->vid, $this->server->nid, $this->ip_address, $this->script_user, $this->config_path, $this->backup_path, $this->drush_path);
$this->server->vid, $this->server->nid, $this->script_user, $this->config_path, $this->backup_path, $this->drush_path);
}
function delete_revision() {
......@@ -164,17 +148,10 @@ class hostingService_server_base extends hostingService {
function load() {
parent::load();
$this->mergeData('SELECT ip_address, script_user, config_path, backup_path, drush_path FROM {hosting_server} WHERE vid = %d', $this->server->vid);
$this->mergeData('SELECT script_user, config_path, backup_path, drush_path FROM {hosting_server} WHERE vid = %d', $this->server->vid);
}
function view(&$render) {
if ($this->ip_address) {
$render['ip_address'] = array(
'#type' => 'item',
'#title' => t('IP address'),
'#value' => filter_xss($this->ip_address),
);
}
$render['drush_path'] = array(
'#type' => 'item',
'#title' => t('Drush path'),
......
......@@ -72,7 +72,7 @@ function hosting_web_server_update_6000() {
// THIS IS A MYSQL-ism, but we need it at this point.
db_query("INSERT INTO {hosting_service} (nid, vid, service, type, available) SELECT nid, vid, 'server', 'base', 1 FROM {hosting_web_server}");
db_query("INSERT INTO {hosting_service} (nid, vid, service, type, available) SELECT nid, vid, 'http', 'apache', 1 FROM {hosting_web_server}");
db_query("INSERT INTO {hosting_server} (nid, vid, ip_address, script_user, backup_path, config_path, drush_path) SELECT nid, vid, ip_address, script_user, backup_path, config_path, drush_path FROM {hosting_web_server}");
db_query("INSERT INTO {hosting_server} (nid, vid, script_user, backup_path, config_path, drush_path) SELECT nid, vid, script_user, backup_path, config_path, drush_path FROM {hosting_web_server}");
db_query("UPDATE {node} SET type='server' WHERE type='web_server'");
......
......@@ -35,14 +35,6 @@ function hosting_web_server_views_data() {
),
),
),
'ip_address' => array(
'title' => t('IP Address'),
'help' => t('IP address of the webserver.'),
'field' => array(
'handler' => 'views_handler_field',
'click sortable' => TRUE,
),
),
'script_user' => array(
'title' => t('Script User'),
'help' => t('User.'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment