From: moodler Date: Sat, 17 May 2003 05:34:49 +0000 (+0000) Subject: Improvements to trustworthiness of the registry form (for suspicious admins!) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2563c5ef7bff2742754a3b421c1432e542d0c470;p=moodle.git Improvements to trustworthiness of the registry form (for suspicious admins!) Hashed password is no longer sent as a key, "secret" field is used instead. HTML code is now more readable for the View Source crowd. :-) --- diff --git a/admin/register.php b/admin/register.php index ffa882f256..535fdbcc28 100644 --- a/admin/register.php +++ b/admin/register.php @@ -22,6 +22,14 @@ $admin->country = $CFG->country; } + if (!$admin->secret) { // secret field hasn't been set yet + $admin->secret = random_string(15); + + if (!set_field("user", "secret", $admin->secret, "id", $admin->id)) { + error("Could not set admin's secret string!"); + } + } + /// Print headings @@ -37,91 +45,93 @@ print_simple_box($strregistrationinfo, "center", "70%"); echo "
"; + /// Print the form print_simple_box_start("center", "", "$THEME->cellheading"); - echo "
"; + echo "\n"; echo "\n"; - echo ""; - echo ""; - echo ""; - //// The following hidden variables are to help prevent fake entries being sent. - //// Together they form a key. If any of these change between updates then the entry - //// is flagged as a new entry and will be manually checked by the list maintainer - echo "wwwroot\">"; - echo "password\">"; - echo ""; - echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "wwwroot\">\n"; + echo "secret\">\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo ""; - echo ""; - echo ""; - echo "version\">"; - echo "release\">"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "version\">\n"; + echo "release\">\n"; echo "\n"; - echo ""; - echo ""; - echo ""; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo ""; - echo ""; + echo "\n"; + echo "\n"; echo ""; + echo "\n"; echo "\n"; - echo ""; - echo ""; + echo "\n"; + echo "\n"; echo ""; + echo "\n"; echo "\n"; - echo ""; - echo "\n"; + echo "\n"; - echo ""; - echo ""; - echo ""; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo ""; - echo ""; - echo ""; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo ""; - echo ""; - echo "\n"; + echo "\n"; + echo ""; + echo "\n"; echo "\n"; - echo ""; - echo ""; - echo ""; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - echo "

Moodle URL:

$CFG->wwwroot

Moodle URL:

$CFG->wwwroot

".get_string("currentversion").":

$CFG->release ($CFG->version)

".get_string("currentversion").":

$CFG->release ($CFG->version)

".get_string("fullsitename").":

fullname\">

".get_string("fullsitename").":

fullname\">

".get_string("country").":

".get_string("country").":

"; choose_from_menu ($COUNTRIES, "country", $admin->country, get_string("selectacountry")."...", "", ""); - echo "

".get_string("publicdirectory").":

".get_string("publicdirectory").":

"; $options[0] = get_string("publicdirectory0"); $options[1] = get_string("publicdirectory1"); $options[2] = get_string("publicdirectory2"); choose_from_menu ($options, "public", "2", "", "", ""); unset($options); - echo "


"; + echo "

\n"; echo "

".get_string("administrator").":

firstname $admin->lastname\">

".get_string("administrator").":

firstname $admin->lastname\">

".get_string("email").":

email\">

".get_string("email").":

email\">

".get_string("registrationemail").":

"; + echo "

".get_string("registrationemail").":

\n"; $options[0] = get_string("registrationno"); $options[1] = get_string("registrationyes"); choose_from_menu ($options, "mailme", "1", "", "", ""); unset($options); - echo "

 

 

"; + echo "\n"; echo "
\n"; print_simple_box_end(); - echo "
"; + echo "
\n"; print_footer();