. */ require_once('inc/class.page.php'); require_once('inc/admin.inc'); $scripts = array('jQuery','jQueryUI'); $adminpage = new page('Administration',$scripts,FALSE); $datepicker = '$(function() { $( "#datepicker" ).datepicker(); $( "#datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd" ); });'; $adminpage->headcode_add('datePicker', $adminpage->script_wrap($datepicker), TRUE); $adminpage->head(); if(!isset($admin_pass) || !isset($admin_enable) || $admin_enable !== true) { echo "
The administration interface is not enabled or is improperly configured. See config.inc for more information.
"; $adminpage->foot(); exit; } // Force authentication else if (!isset($_SERVER['PHP_AUTH_USER']) || (!isset($_SERVER['PHP_AUTH_PW'])) || $_SERVER['PHP_AUTH_PW'] != $admin_pass) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); echo 'You must authenticate to access the administration interface.
'; $adminpage->foot(); exit; } function isBeforeDate($toCheck, $reference) { $formatted = date("Y-m-d", $toCheck); $refUnix = strtotime($reference); if($toCheck < $refUnix) { return true; } return false; } function checkAction() { $result = ''; if(isset($_GET['rehash'])) { // Run the rehash $crawl_schools = NULL; if (isset($_REQUEST['rehash_school'])) $crawl_schools = array($_REQUEST['rehash_school']); ob_start(); if (school_cache_recreate($crawl_schools)) $result = 'Rehash Failed'; else $result = 'Rehash Successful'; $hashresult = htmlentities(ob_get_contents()); ob_end_clean(); if ($crawl_schools !== NULL) $result .= ': ' . implode(', ', $crawl_schools); // Prepend rehash output $result = nl2br($hashresult) . 'You are currently running version . The latest available release is VERSION.
This installation has not been rehashed. Please rehash now to download school scheduling metadata.
"; } ?>