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") ?>
</TD>
</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>
<TD ALIGN=RIGHT><P>smtphosts:</TD>
<TD>

View File

@ -2,6 +2,7 @@
// config.php - allows admin to edit all configuration variables
include("../config.php");
require("../lib/countries.php");
if (isset($phpinfo)) { // For debugging purposes, protected by password
if (md5($phpinfo) == "caf9b6b99962bf5c2264824231d7a40c") {

View File

@ -53,6 +53,7 @@ $string['chooseuser'] = "Choose a user";
$string['city'] = "City/town";
$string['closewindow'] = "Close this window";
$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['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.";

View File

@ -53,6 +53,7 @@ $string['city'] = "City/town";
$string['closewindow'] = "Close this window";
$string['comparelanguage'] = "Compare and edit current language";
$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['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.";

View File

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

View File

@ -3,16 +3,16 @@
<TABLE WIDTH="90%" BORDER="0" CELLSPACING="10" CELLPADDING="5" ALIGN="CENTER">
<TR>
<? 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>
</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>
</TD>
<? } ?>
</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>
(<? print_string("cookiesenabled") ?>)<BR>
<? formerr($errormsg) ?>
@ -74,7 +74,7 @@
</BLOCKQUOTE>
</FONT> </TD>
<? if ($show_instructions) { ?>
<TD WIDTH="50%" VALIGN="TOP" bgcolor="<?=$THEME->cellcontent2?>">
<TD WIDTH="50%" VALIGN="TOP" bgcolor="<?=$THEME->cellcontent2?>" class="generalbox">
<FONT SIZE=2>
<? switch ($CFG->auth) {
case "email": ?>

View File

@ -40,6 +40,10 @@
}
}
if (!$user->country and $CFG->country) {
$user->country = $CFG->country;
}
$newaccount = get_string("newaccount");
$login = get_string("login");

View File

@ -1,5 +1,5 @@
<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">
<table>

View File

@ -81,7 +81,13 @@ if (isadmin()) {
</tr>
<tr valign=top>
<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"]) ?>
</td>
</tr>