init_pagehead(); session_start(); if((x($_SESSION,'authenticated')) || (x($_POST['auth-params']))) require("auth.php"); if($install) $a->module = 'install'; else check_config($a); if(strlen($a->module)) { if(file_exists("mod/{$a->module}.php")) { include("mod/{$a->module}.php"); $a->module_loaded = true; } else { header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found')); notice( t('Page not found.' ) . EOL); } } if($a->module_loaded) { $a->page['page_title'] = $a->module; if(function_exists($a->module . '_init')) { $func = $a->module . '_init'; $func($a); } if(($_SERVER['REQUEST_METHOD'] == 'POST') && (! $a->error) && (function_exists($a->module . '_post')) && (! x($_POST,'auth-params'))) { $func = $a->module . '_post'; $func($a); } if((! $a->error) && (function_exists($a->module . '_afterpost'))) { $func = $a->module . '_afterpost'; $func($a); } if((! $a->error) && (function_exists($a->module . '_content'))) { $func = $a->module . '_content'; $a->page['content'] .= $func($a); } } if(stristr($_SESSION['sysmsg'], t('Permission denied'))) { header($_SERVER["SERVER_PROTOCOL"] . ' 403 ' . t('Permission denied.')); } // report anything important happening if(x($_SESSION,'sysmsg')) { $a->page['content'] = "
\r\n" . $a->page['content']; unset($_SESSION['sysmsg']); } // Feel free to comment out this line on production sites. $a->page['content'] .= $debug_text; $a->page['content'] .= '