Example #1
0
 function process()
 {
     $edit = $_POST['edit'];
     $next = $_POST['next'];
     if (is_null($next)) {
         $next = $_GET['next'];
         if (is_null($next)) {
             $next = queryPickle('home');
         }
     }
     switch ($edit['step']) {
         case 'perform':
             $this->perform($edit);
             local_redirect(queryUnpickle($next));
         default:
             $this->template_name = 'pages/person/waiver.tpl';
             $this->smarty->assign('next_page', $next);
             $this->smarty->assign('waiver_text', $this->waiver_text);
             $rc = true;
     }
     return $rc;
 }
Example #2
0
    //$details = array('header'=>"HTTP/1.0 404 Not Found");
    error_exit("Leaguerunner could not find the requested file");
}
require_once $handler_file;
try {
    $reflector = new ReflectionClass($handler_class);
    $handler = $reflector->newInstanceArgs($handler_args);
} catch (ReflectionException $e) {
    # Internal error
    error_exit("Couldn't construct {$handler_class}:" . $e->getMessage());
}
/*
 * See if something else needs to be processed before this handler
 * (Account revalidation, etc)
 */
$pickledQuery = queryPickle($_GET['q']);
$possibleRedirect = $handler->checkPrereqs($pickledQuery);
if ($possibleRedirect) {
    local_redirect($possibleRedirect);
}
/* Set any necessary options for the handler */
$handler->smarty =& $smarty;
if ($handler->initialize()) {
    /* Ensure we have permission */
    if ($handler->has_permission()) {
        /* Process the action */
        $result = $handler->process();
        if ($result === false) {
            error_exit("Uncaught failure in {$handler_class}");
        }
        /* TODO: This is evil, needs cleanup */