You are here

function hosting_update_6009 in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 hosting.install \hosting_update_6009()
  2. 7.3 hosting.install \hosting_update_6009()

Implements hook_update_N().

Fix the reference to the master server so that it no longer points at localhost.

File

./hosting.install, line 273
Install, update and uninstall for the hosting module.

Code

function hosting_update_6009() {

  // This undoes the change we made previously in update_6008, but can be run again.
  $ret = array();
  db_query("UPDATE {hosting_context} SET name='server_master' WHERE name='server_localhost'");
  $nid = db_result(db_query("SELECT nid from {hosting_context} WHERE name='server_master'"));
  $uname = php_uname('n');
  db_query("UPDATE {node} SET title='%s' WHERE nid=%d", $uname, $nid);
  db_query("UPDATE {node_revisions} SET title='%s' WHERE nid=%d", $uname, $nid);
  return $ret;
}