Permalink
Browse files

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.
  • Loading branch information...
1 parent b2a2171 commit 778c28671af6b465e6cefebd5acacbce3367e46c moodler committed Dec 14, 2002
Showing with 28 additions and 6 deletions.
  1. +8 −0 admin/config.html
  2. +1 −0 admin/config.php
  3. +1 −0 lang/en/moodle.php
  4. +1 −0 lang/en_us/moodle.php
  5. +1 −0 lib/defaults.php
  6. +4 −4 login/index_form.html
  7. +4 −0 login/signup.php
  8. +1 −1 login/signup_form.php
  9. +7 −1 user/edit.html
View
@@ -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
@@ -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
@@ -53,6 +53,7 @@
$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.";
@@ -53,6 +53,7 @@
$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
@@ -21,6 +21,7 @@
"proxyhost" => "",
"proxyport" => "",
"maxeditingtime" => 1800,
+ "country" => "",
"guestloginbutton" => 1
);
@@ -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
@@ -40,6 +40,10 @@
}
}
+ if (!$user->country and $CFG->country) {
+ $user->country = $CFG->country;
+ }
+
$newaccount = get_string("newaccount");
$login = get_string("login");
@@ -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
@@ -81,7 +81,13 @@
</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>

0 comments on commit 778c286

Please sign in to comment.