# HG changeset patch # User Nathan Phillip Brink # Date 2011-01-01 02:15:45 # Node ID 830e818d262529a27b19d5d9a82aa49f57634f90 # Parent 250c30fbed1a866da91433996bcef0f33f9c7885 Support rehashing stuffage through the web interface. Only per-school rehashing is tested so far. diff --git a/admin.php b/admin.php --- a/admin.php +++ b/admin.php @@ -18,7 +18,9 @@ * along with SlatePermutate. If not, see . */ - include_once 'inc/class.page.php'; +require_once('inc/class.page.php'); +require_once('inc/admin.inc'); + $scripts = array('jQuery','jQueryUI'); $adminpage = new page('Administration',$scripts,FALSE); @@ -79,7 +81,17 @@ $result = ''; if(isset($_GET['rehash'])) { // Run the rehash - $result = 'Rehash Complete'; + + $crawl_schools = NULL; + if (isset($_REQUEST['rehash_school'])) + $crawl_schools = array($_REQUEST['rehash_school']); + + if (school_cache_recreate($crawl_schools)) + $result = 'Rehash Failed'; + else + $result = 'Rehash Successful'; + if ($crawl_schools !== NULL) + $result .= ': ' . implode(', ', $crawl_schools); } else if(isset($_GET['purgetodate'])) { // Purge saved schedule cache up to date @@ -102,28 +114,15 @@ return date("F j, Y, g:i a", $stats[9]); } - function getSchools() { - if(!stat("cache/schools")){ - return false; - } - $schoolsArr = unserialize(file_get_contents("cache/schools")); - return $schoolsArr; - } - - function schoolsDropList(){ - $schools = getSchools(); - echo ''; + foreach($school_ids as $school_id) + { + $school = school_load($school_id); + echo ' ' . "\n"; } - } echo ""; } @@ -158,12 +157,19 @@ } ?>

Purge

-

The cache currently contains schedules.

+

The saved schedule fs-db currently contains schedules.