Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / admin / timezone.php
blob3c27e2f0847314709700ae92e5b03c7b23a0771d
1 <?php // $Id$
3 require_once('../config.php');
5 $zone = optional_param('zone', '', PARAM_PATH); //not a path, but it looks like it anyway
7 require_login();
9 require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
11 $strtimezone = get_string("timezone");
12 $strsavechanges = get_string("savechanges");
13 $strusers = get_string("users");
14 $strall = get_string("all");
16 print_header($strtimezone, $strtimezone, $strtimezone);
18 print_heading("");
20 if (!empty($zone) and confirm_sesskey()) {
21 $db->debug = true;
22 echo "<center>";
23 execute_sql("UPDATE {$CFG->prefix}user SET timezone = '$zone'");
24 $db->debug = false;
25 echo "</center>";
27 $USER->timezone = $zone;
30 require_once($CFG->dirroot.'/calendar/lib.php');
31 $timezones = get_list_of_timezones();
33 echo '<center><form action="timezone.php" method="get">';
34 echo "$strusers ($strall): ";
35 choose_from_menu ($timezones, "zone", 99, get_string("serverlocaltime"), "", "99");
36 echo "<input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />";
37 echo "<input type=\"submit\" value=\"$strsavechanges\" />";
38 echo "</form></center>";
40 print_footer();