MDL-15249 $_SERVER['HTTP_HOST'] not availabel in CLI script, replaced by parsing of wwwroot which should give the same info

This commit is contained in:
skodak
2009-05-25 20:55:27 +00:00
parent a600ad359a
commit aa282b10fb
4 changed files with 17 additions and 4 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ function xmldb_main_install() {
'template' => 'default',
'theme' => 'standardwhite',
'filter_multilang_converted' => 1,
'siteidentifier' => random_string(32).$_SERVER['HTTP_HOST'],
'siteidentifier' => random_string(32).get_host_from_url($CFG->wwwroot),
'backup_version' => 2008111700,
'backup_release' => '2.0 dev',
'blocks_version' => 2007081300, // might be removed soon
@@ -158,7 +158,7 @@ function xmldb_main_install() {
$admin->lang = $CFG->lang;
$admin->maildisplay = 1;
$admin->timemodified = time();
$admin->lastip = getremoteaddr(); // installation hijacking prevention
$admin->lastip = CLI_SCRIPT ? '0.0.0.0' : getremoteaddr(); // installation hijacking prevention
$admin->id = $DB->insert_record('user', $admin);