$USER->admin = true;
$USER->teacher["$site->id"] = true;
$USER->newadminuser = true;
- set_user_sesskey(); // for added security, used to check script parameters
+ sesskey(); // for added security, used to check script parameters
redirect("$CFG->wwwroot/user/edit.php?id=$user->id&course=$site->id");
exit;
if(blocks_have_content($pageblocks[BLOCK_POS_CENTERUP]) || $editing) {
blocks_print_group($PAGE, $pageblocks[BLOCK_POS_CENTERUP]);
}
- echo '<div style="padding: 10px; background: gold; text-align: center;">Content Here</div>';
+
+
+ echo '<div style="padding: 10px; background: gold; text-align: center;">';
+ $time = mktime(0, 0, 0, 1, 1, 2005, 0);
+ print_object(oldgetdate($time));
+ print_object(usergetdate($time));
+ echo 'Content Here</div>';
+
echo '<p style="text-align: center; padding: 10px; background: black; color: white;">Center-down position:</p>';
if(blocks_have_content($pageblocks[BLOCK_POS_CENTERDOWN]) || $editing) {
blocks_print_group($PAGE, $pageblocks[BLOCK_POS_CENTERDOWN]);
echo '</tr></table>';
print_footer();
+
+function oldgetdate($date) {
+ $timezone = get_user_timezone(99);
+
+ if (abs($timezone) > 13) {
+ return getdate($date);
+ }
+ //There is no gmgetdate so I have to fake it...
+ $date = $date + (int)($timezone * HOURSECS);
+
+ $getdate['seconds'] = gmstrftime("%S", $date);
+ $getdate['minutes'] = gmstrftime("%M", $date);
+ $getdate['hours'] = gmstrftime("%H", $date);
+ $getdate['mday'] = gmstrftime("%d", $date);
+ $getdate['wday'] = gmstrftime("%u", $date);
+ $getdate['mon'] = gmstrftime("%m", $date);
+ $getdate['year'] = gmstrftime("%Y", $date);
+ $getdate['yday'] = gmstrftime("%j", $date);
+ $getdate['weekday'] = gmstrftime("%A", $date);
+ $getdate['month'] = gmstrftime("%B", $date);
+
+ return $getdate;
+}
+
?>
// Makes sure that $USER->sesskey exists, if $USER itself exists. It sets a new sesskey
// if one does not already exist, but does not overwrite existing sesskeys. Returns the
// sesskey string if $USER exists, or boolean false if not.
-function set_user_sesskey() {
+function sesskey() {
global $USER;
if(!isset($USER)) {
}
// Make sure the USER has a sesskey set up. Used for checking script parameters.
- set_user_sesskey();
+ sesskey();
// Check that the user has agreed to a site policy if there is one
if (!empty($CFG->sitepolicy)) {
}
$USER->loggedin = true;
$USER->site = $CFG->wwwroot; // for added security, store the site in the session
- set_user_sesskey(); // for added security, used to check script parameters
+ sesskey(); // for added security, used to check script parameters
if ($USER->username == "guest") {
$USER->lang = $CFG->lang; // Guest language always same as site