function hosting_update_6009 in Hostmaster (Aegir) 6
Implements hook_update_N().
Fix the reference to the master server so that it no longer points at localhost.
File
- modules/
hosting/ hosting.install, line 270 - 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;
}