]> git.mjollnir.org Git - moodle.git/commitdiff
Added new configuration setting "country" to set a default country
authormoodler <moodler>
Sat, 14 Dec 2002 08:18:18 +0000 (08:18 +0000)
committermoodler <moodler>
Sat, 14 Dec 2002 08:18:18 +0000 (08:18 +0000)
for the site.  If this is set then user menus are pre-selected.
eg when signing up or filling out profile after external authentication.

admin/config.html
admin/config.php
lang/en/moodle.php
lang/en_us/moodle.php
lib/defaults.php
login/index_form.html
login/signup.php
login/signup_form.php
user/edit.html

index 4a4dfd5f158dfee9762794930ff0b4973caa7f6e..6403cbba018be32e790ef86df59a31353b2fe2ce 100644 (file)
     <? 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>
index b6673fe27a5ba00661874e52963534f8c3876c12..592bfdd1a803845d59e59d7e13193839008ac2bf 100644 (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") {
index 11caf07e0092435a154ede5b351db113fd0139de..6ba911c13faee29ebc914a3f0b7c9397916b64b3 100644 (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.";
index 2c834e9678e02e8e3101e4380c86e3e13ceabc31..0f69d8964ca1fcbbdc9396d7119ecac006a520fb 100644 (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.";
index 24f3e48e8e7954c0c8fea333bd87e871cf87e9df..b91dccbeabae76602cb56d3e70885e3977302a38 100644 (file)
@@ -21,6 +21,7 @@
        "proxyhost"        => "",
        "proxyport"        => "",
        "maxeditingtime"   =>  1800,
+       "country"          => "",
        "guestloginbutton" =>  1
     );
 
index 41ff81378ec5dc7ddb4160aa121f21d9a20da244..927bb5255795f1e77fd1bc3355fe6d1cced6bdfb 100644 (file)
@@ -3,16 +3,16 @@
 <TABLE WIDTH="90%" BORDER="0" CELLSPACING="10" CELLPADDING="5" ALIGN="CENTER">\r
   <TR>\r
     <? if ($show_instructions) { ?>\r
-        <TD WIDTH="50%" bgcolor=<?=$THEME->cellheading2?> class="generaltableheader">\r
+        <TD WIDTH="50%" bgcolor=<?=$THEME->cellheading2?> class="headingblock">\r
           <P ALIGN="CENTER"><B><FONT SIZE=3><? print_string("returningtosite") ?></FONT></B></P>\r
         </TD>\r
-        <TD WIDTH="50%" bgcolor=<?=$THEME->cellheading2?> class="generaltableheader">\r
+        <TD WIDTH="50%" bgcolor=<?=$THEME->cellheading2?> class="headingblock">\r
           <P ALIGN="CENTER"><B><FONT SIZE=3><? print_string("firsttime") ?></FONT></B></P>\r
         </TD>\r
     <? } ?>\r
   </TR>\r
   <TR>\r
-    <TD WIDTH="50%" VALIGN="TOP" bgcolor="<?=$THEME->cellcontent2?>"> <FONT SIZE=2> \r
+    <TD WIDTH="50%" VALIGN="TOP" bgcolor="<?=$THEME->cellcontent2?>" class="generalbox"> <FONT SIZE=2> \r
       <P ALIGN="CENTER"><? print_string("loginusing") ?>:<BR>\r
       (<? print_string("cookiesenabled") ?>)<BR>\r
          <? formerr($errormsg) ?>\r
@@ -74,7 +74,7 @@
         </BLOCKQUOTE>\r
       </FONT> </TD>\r
     <? if ($show_instructions) { ?>\r
-        <TD WIDTH="50%" VALIGN="TOP" bgcolor="<?=$THEME->cellcontent2?>">\r
+        <TD WIDTH="50%" VALIGN="TOP" bgcolor="<?=$THEME->cellcontent2?>" class="generalbox">\r
           <FONT SIZE=2>\r
           <? switch ($CFG->auth) {\r
                case "email":             ?>\r
index 28a4683db28b1332690f0f32389fa3e7173d63d0..d53f59ef75105b81e34b225e267229ff919aab22 100644 (file)
                }
        }
 
+    if (!$user->country and $CFG->country) {
+        $user->country = $CFG->country;
+    }
+
     $newaccount = get_string("newaccount");
     $login = get_string("login");
 
index ac50411200e509ebafd68267e71cf0bda2e52072..f37d41f0e293fe48a54f3cc70a373bbcce2b75d9 100644 (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>
index 45c1a4125660ab0f70f1bef138ed0a1c300db160..6ff8f01cfa7259b0ee692ae7ee4336bbde520b98 100644 (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>