function showAccessDenied($day, $month, $year, $area) { global $HTTP_REFERER; print_header_mrbs($day, $month, $year, $area); ?> <H1><?php echo get_string('accessdenied', 'block_mrbs'); ?> </H1> <P> <?php echo get_string('norights', 'block_mrbs'); ?> </P> <P> <A HREF="<?php echo $HTTP_REFERER; ?> "><?php echo get_string('returnprev', 'block_mrbs'); ?> </A> </P> </BODY> </HTML> <?php }
# Default parameters: # if (empty($debug_flag)) $debug_flag = 0; //not needed with optional_param initialization if ($month == 0 || $year == 0 || !checkdate(intval($month), 1, intval($year))) { $month = date("m"); $year = date("Y"); } $day = 1; if ($area == 0) { $area = get_default_area(); } if ($room == 0) { $room = get_default_room($area); } # Note $room will be 0 if there are no rooms; this is checked for below. # print the page header print_header_mrbs($day, $month, $year, $area); //I think this was misplaced -ab. # Month view start time. This ignores morningstarts/eveningends because it # doesn't make sense to not show all entries for the day, and it messes # things up when entries cross midnight. $month_start = mktime(0, 0, 0, $month, 1, $year); # What column the month starts in: 0 means $weekstarts weekday. $weekday_start = (date("w", $month_start) - $weekstarts + 7) % 7; $days_in_month = date("t", $month_start); $month_end = mktime(23, 59, 59, $month, $days_in_month, $year); if ($enable_periods) { $resolution = 60; $morningstarts = 12; $eveningends = 12; $eveningends_minutes = count($periods) - 1; }
$month = date("m"); $year = date("Y"); } if (!getAuthorised(2)) { showAccessDenied($day, $month, $year, $area); exit; } // Done changing area or room information? if ($change_done) { if (!empty($room)) { $area = sql_query1("SELECT area_id from {$tbl_room} where id={$room}"); } Header("Location: admin.php?day={$day}&month={$month}&year={$year}&area={$area}"); exit; } print_header_mrbs($day, $month, $year, isset($area) ? $area : ""); ?> <h2><?php echo get_string('editroomarea', 'block_mrbs'); ?> </h2> <table border=1> <?php if ($room > 0) { !isset($room_admin_email) ? $room_admin_email = '' : ''; $emails = explode(',', $room_admin_email); $valid_email = TRUE; foreach ($emails as $email) {
function authGet() { global $PHP_SELF, $QUERY_STRING; print_header_mrbs(0, 0, 0, 0); echo "<p>" . get_string('norights', 'block_mrbs') . "</p>\n"; $TargetURL = basename($PHP_SELF); if (isset($QUERY_STRING)) { $TargetURL = $TargetURL . "?" . $QUERY_STRING; } printLoginForm($TargetURL); exit; }
function fatal_error($need_header, $message) { if ($need_header) { print_header_mrbs(0, 0, 0, 0); } echo $message; include "trailer.php"; exit; }