Navigation Menu

Skip to content

Commit

Permalink
Added new configuration setting "country" to set a default country
Browse files Browse the repository at this point in the history
for the site.  If this is set then user menus are pre-selected.
eg when signing up or filling out profile after external authentication.
  • Loading branch information
moodler committed Dec 14, 2002
1 parent b2a2171 commit 778c286
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 6 deletions.
8 changes: 8 additions & 0 deletions admin/config.html
Expand Up @@ -36,6 +36,14 @@
<? print_string("configlocale") ?> <? print_string("configlocale") ?>
</TD> </TD>
</TR> </TR>
<tr valign=top>
<td align=right><P>country:</td>
<td><? choose_from_menu ($COUNTRIES, "country", $config->country, get_string("selectacountry"), "", "") ?>
</td>
<TD>
<? print_string("configcountry") ?>
</TD>
</tr>
<TR VALIGN=TOP> <TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>smtphosts:</TD> <TD ALIGN=RIGHT><P>smtphosts:</TD>
<TD> <TD>
Expand Down
1 change: 1 addition & 0 deletions admin/config.php
Expand Up @@ -2,6 +2,7 @@
// config.php - allows admin to edit all configuration variables // config.php - allows admin to edit all configuration variables


include("../config.php"); include("../config.php");
require("../lib/countries.php");


if (isset($phpinfo)) { // For debugging purposes, protected by password if (isset($phpinfo)) { // For debugging purposes, protected by password
if (md5($phpinfo) == "caf9b6b99962bf5c2264824231d7a40c") { if (md5($phpinfo) == "caf9b6b99962bf5c2264824231d7a40c") {
Expand Down
1 change: 1 addition & 0 deletions lang/en/moodle.php
Expand Up @@ -53,6 +53,7 @@
$string['city'] = "City/town"; $string['city'] = "City/town";
$string['closewindow'] = "Close this window"; $string['closewindow'] = "Close this window";
$string['comparelanguage'] = "Compare and edit current language"; $string['comparelanguage'] = "Compare and edit current language";
$string['configcountry'] = "If you set a country here, then this country will be selected by default on new user accounts. To force users to choose a country, just leave this unset.";
$string['configgdversion'] = "Indicate the version of GD that is installed. The version shown by default is the one that has been auto-detected. Don't change this unless you really know what you're doing."; $string['configgdversion'] = "Indicate the version of GD that is installed. The version shown by default is the one that has been auto-detected. Don't change this unless you really know what you're doing.";
$string['configerrorlevel'] = "Choose the amount of PHP warnings that you want to be displayed. Normal is usually the best choice."; $string['configerrorlevel'] = "Choose the amount of PHP warnings that you want to be displayed. Normal is usually the best choice.";
$string['confightmleditor'] = "Choose whether or not to allow use of the embedded HTML text editor. Even if you choose allow, this editor will only appear when the user is using a compatible browser (IE 5.5 or later). Users can also choose not to use it."; $string['confightmleditor'] = "Choose whether or not to allow use of the embedded HTML text editor. Even if you choose allow, this editor will only appear when the user is using a compatible browser (IE 5.5 or later). Users can also choose not to use it.";
Expand Down
1 change: 1 addition & 0 deletions lang/en_us/moodle.php
Expand Up @@ -53,6 +53,7 @@
$string['closewindow'] = "Close this window"; $string['closewindow'] = "Close this window";
$string['comparelanguage'] = "Compare and edit current language"; $string['comparelanguage'] = "Compare and edit current language";
$string['complete'] = "Complete"; $string['complete'] = "Complete";
$string['configcountry'] = "If you set a country here, then this country will be selected by default on new user accounts. To force users to choose a country, just leave this unset.";
$string['configerrorlevel'] = "Choose the amount of PHP warnings that you want to be displayed. Normal is usually the best choice."; $string['configerrorlevel'] = "Choose the amount of PHP warnings that you want to be displayed. Normal is usually the best choice.";
$string['configgdversion'] = "Indicate the version of GD that is installed. The version shown by default is the one that has been auto-detected. Don't change this unless you really know what you're doing."; $string['configgdversion'] = "Indicate the version of GD that is installed. The version shown by default is the one that has been auto-detected. Don't change this unless you really know what you're doing.";
$string['confightmleditor'] = "Choose whether or not to allow use of the embedded HTML text editor. Even if you choose allow, this editor will only appear when the user is using a compatible browser (IE 5.5 or later). Users can also choose not to use it."; $string['confightmleditor'] = "Choose whether or not to allow use of the embedded HTML text editor. Even if you choose allow, this editor will only appear when the user is using a compatible browser (IE 5.5 or later). Users can also choose not to use it.";
Expand Down
1 change: 1 addition & 0 deletions lib/defaults.php
Expand Up @@ -21,6 +21,7 @@
"proxyhost" => "", "proxyhost" => "",
"proxyport" => "", "proxyport" => "",
"maxeditingtime" => 1800, "maxeditingtime" => 1800,
"country" => "",
"guestloginbutton" => 1 "guestloginbutton" => 1
); );


Expand Down
8 changes: 4 additions & 4 deletions login/index_form.html
Expand Up @@ -3,16 +3,16 @@
<TABLE WIDTH="90%" BORDER="0" CELLSPACING="10" CELLPADDING="5" ALIGN="CENTER"> <TABLE WIDTH="90%" BORDER="0" CELLSPACING="10" CELLPADDING="5" ALIGN="CENTER">
<TR> <TR>
<? if ($show_instructions) { ?> <? if ($show_instructions) { ?>
<TD WIDTH="50%" bgcolor=<?=$THEME->cellheading2?> class="generaltableheader"> <TD WIDTH="50%" bgcolor=<?=$THEME->cellheading2?> class="headingblock">
<P ALIGN="CENTER"><B><FONT SIZE=3><? print_string("returningtosite") ?></FONT></B></P> <P ALIGN="CENTER"><B><FONT SIZE=3><? print_string("returningtosite") ?></FONT></B></P>
</TD> </TD>
<TD WIDTH="50%" bgcolor=<?=$THEME->cellheading2?> class="generaltableheader"> <TD WIDTH="50%" bgcolor=<?=$THEME->cellheading2?> class="headingblock">
<P ALIGN="CENTER"><B><FONT SIZE=3><? print_string("firsttime") ?></FONT></B></P> <P ALIGN="CENTER"><B><FONT SIZE=3><? print_string("firsttime") ?></FONT></B></P>
</TD> </TD>
<? } ?> <? } ?>
</TR> </TR>
<TR> <TR>
<TD WIDTH="50%" VALIGN="TOP" bgcolor="<?=$THEME->cellcontent2?>"> <FONT SIZE=2> <TD WIDTH="50%" VALIGN="TOP" bgcolor="<?=$THEME->cellcontent2?>" class="generalbox"> <FONT SIZE=2>
<P ALIGN="CENTER"><? print_string("loginusing") ?>:<BR> <P ALIGN="CENTER"><? print_string("loginusing") ?>:<BR>
(<? print_string("cookiesenabled") ?>)<BR> (<? print_string("cookiesenabled") ?>)<BR>
<? formerr($errormsg) ?> <? formerr($errormsg) ?>
Expand Down Expand Up @@ -74,7 +74,7 @@
</BLOCKQUOTE> </BLOCKQUOTE>
</FONT> </TD> </FONT> </TD>
<? if ($show_instructions) { ?> <? if ($show_instructions) { ?>
<TD WIDTH="50%" VALIGN="TOP" bgcolor="<?=$THEME->cellcontent2?>"> <TD WIDTH="50%" VALIGN="TOP" bgcolor="<?=$THEME->cellcontent2?>" class="generalbox">
<FONT SIZE=2> <FONT SIZE=2>
<? switch ($CFG->auth) { <? switch ($CFG->auth) {
case "email": ?> case "email": ?>
Expand Down
4 changes: 4 additions & 0 deletions login/signup.php
Expand Up @@ -40,6 +40,10 @@
} }
} }


if (!$user->country and $CFG->country) {
$user->country = $CFG->country;
}

$newaccount = get_string("newaccount"); $newaccount = get_string("newaccount");
$login = get_string("login"); $login = get_string("login");


Expand Down
2 changes: 1 addition & 1 deletion login/signup_form.php
@@ -1,5 +1,5 @@
<CENTER> <CENTER>
<table cellpadding=20> <tr> <td bgcolor="<?=$THEME->cellcontent2 ?>"> <table cellpadding=20> <tr> <td bgcolor="<?=$THEME->cellcontent2 ?>" class="generalbox">


<form name="form" method="post" action="signup.php"> <form name="form" method="post" action="signup.php">
<table> <table>
Expand Down
8 changes: 7 additions & 1 deletion user/edit.html
Expand Up @@ -81,7 +81,13 @@
</tr> </tr>
<tr valign=top> <tr valign=top>
<td><P><? print_string("country") ?>:</td> <td><P><? print_string("country") ?>:</td>
<td><? choose_from_menu ($COUNTRIES, "country", $user->country, get_string("selectacountry")."...", "", "") ?> <td><?

if (!$user->country and $CFG->country) {
$user->country = $CFG->country;
}

choose_from_menu ($COUNTRIES, "country", $user->country, get_string("selectacountry")."...", "", "") ?>
<? formerr($err["country"]) ?> <? formerr($err["country"]) ?>
</td> </td>
</tr> </tr>
Expand Down

0 comments on commit 778c286

Please sign in to comment.