mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merged siteidentifier from stable
This commit is contained in:
parent
58a1c3ea32
commit
9ff24fb76a
1 changed files with 3 additions and 7 deletions
|
@ -21,12 +21,8 @@
|
||||||
$admin->country = $CFG->country;
|
$admin->country = $CFG->country;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$admin->secret) { // secret field hasn't been set yet
|
if (empty($CFG->siteidentifier)) { // Unique site identification code
|
||||||
$admin->secret = random_string(15);
|
set_config('siteidentifier', random_string(32));
|
||||||
|
|
||||||
if (!set_field("user", "secret", $admin->secret, "id", $admin->id)) {
|
|
||||||
error("Could not set admin's secret string!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,7 +56,7 @@
|
||||||
echo "<!-- is flagged as a new entry and will be manually checked by the list maintainer -->\n";
|
echo "<!-- is flagged as a new entry and will be manually checked by the list maintainer -->\n";
|
||||||
|
|
||||||
echo "<input type=\"hidden\" name=\"url\" value=\"$CFG->wwwroot\">\n";
|
echo "<input type=\"hidden\" name=\"url\" value=\"$CFG->wwwroot\">\n";
|
||||||
echo "<input type=\"hidden\" name=\"secret\" value=\"$admin->secret\">\n";
|
echo "<input type=\"hidden\" name=\"secret\" value=\"$CFG->siteidentifier\">\n";
|
||||||
echo "<input type=\"hidden\" name=\"host\" value=\"".$_SERVER["HTTP_HOST"]."\">\n";
|
echo "<input type=\"hidden\" name=\"host\" value=\"".$_SERVER["HTTP_HOST"]."\">\n";
|
||||||
echo "<input type=\"hidden\" name=\"lang\" value=\"".current_language()."\">\n";
|
echo "<input type=\"hidden\" name=\"lang\" value=\"".current_language()."\">\n";
|
||||||
echo "</td></tr>\n";
|
echo "</td></tr>\n";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue