2003-11-22 09:00:15 +00:00
|
|
|
<?php // $Id$
|
|
|
|
|
2006-03-07 09:01:49 +00:00
|
|
|
require_once('../config.php');
|
|
|
|
|
2008-05-15 21:40:00 +00:00
|
|
|
$zone = optional_param('zone', '', PARAM_RAW);
|
|
|
|
|
|
|
|
if (!is_numeric($zone)) {
|
|
|
|
//not a path, but it looks like it anyway
|
|
|
|
$zone = clean_param($zone, PARAM_PATH);
|
|
|
|
}
|
2003-11-22 09:00:15 +00:00
|
|
|
|
|
|
|
require_login();
|
|
|
|
|
2008-05-02 04:37:02 +00:00
|
|
|
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
2003-11-22 09:00:15 +00:00
|
|
|
|
|
|
|
$strtimezone = get_string("timezone");
|
|
|
|
$strsavechanges = get_string("savechanges");
|
|
|
|
$strusers = get_string("users");
|
|
|
|
$strall = get_string("all");
|
|
|
|
|
2007-08-17 07:25:47 +00:00
|
|
|
print_header($strtimezone, $strtimezone, build_navigation(array(array('name' => $strtimezone, 'link' => null, 'type' => 'misc'))));
|
2003-11-22 09:00:15 +00:00
|
|
|
|
|
|
|
print_heading("");
|
|
|
|
|
2008-05-15 21:40:00 +00:00
|
|
|
if (data_submitted() and !empty($zone) and confirm_sesskey()) {
|
2003-11-22 09:00:15 +00:00
|
|
|
echo "<center>";
|
2008-05-15 21:40:00 +00:00
|
|
|
$DB->execute("UPDATE {user} SET timezone = ?", array($zone));
|
2003-11-22 09:00:15 +00:00
|
|
|
echo "</center>";
|
|
|
|
|
|
|
|
$USER->timezone = $zone;
|
2008-05-15 21:40:00 +00:00
|
|
|
$current = $zone;
|
|
|
|
notify('Timezone of all users changed', 'notifysuccess');
|
|
|
|
} else {
|
|
|
|
$current = 99;
|
2003-11-22 09:00:15 +00:00
|
|
|
}
|
|
|
|
|
2006-03-07 09:01:49 +00:00
|
|
|
require_once($CFG->dirroot.'/calendar/lib.php');
|
|
|
|
$timezones = get_list_of_timezones();
|
2003-11-22 09:00:15 +00:00
|
|
|
|
2008-05-15 21:40:00 +00:00
|
|
|
echo '<center><form action="timezone.php" method="post">';
|
2003-11-22 09:00:15 +00:00
|
|
|
echo "$strusers ($strall): ";
|
2008-05-15 21:40:00 +00:00
|
|
|
choose_from_menu ($timezones, "zone", $current, get_string("serverlocaltime"), "", "99");
|
2007-01-03 01:53:52 +00:00
|
|
|
echo "<input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />";
|
2008-05-15 21:40:00 +00:00
|
|
|
echo '<input type="submit" value="'.s($strsavechanges).'" />';
|
2004-10-04 13:50:37 +00:00
|
|
|
echo "</form></center>";
|
2003-11-22 09:00:15 +00:00
|
|
|
|
|
|
|
print_footer();
|
|
|
|
|
|
|
|
?>
|