Added new configuration setting "country" to set a default country

for the site.  If this is set then user menus are pre-selected.
eg when signing up or filling out profile after external authentication.
This commit is contained in:
moodler 2002-12-14 08:18:18 +00:00
parent b2a2171f22
commit 778c28671a
9 changed files with 28 additions and 6 deletions

View file

@ -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>

View file

@ -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") {

View file

@ -53,6 +53,7 @@ $string['chooseuser'] = "Choose a user";
$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.";

View file

@ -53,6 +53,7 @@ $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['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.";

View file

@ -21,6 +21,7 @@
"proxyhost" => "", "proxyhost" => "",
"proxyport" => "", "proxyport" => "",
"maxeditingtime" => 1800, "maxeditingtime" => 1800,
"country" => "",
"guestloginbutton" => 1 "guestloginbutton" => 1
); );

View file

@ -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) ?>
@ -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": ?>

View file

@ -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");

View file

@ -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>

View file

@ -81,7 +81,13 @@ if (isadmin()) {
</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>