if (!preg_match('/^[a-zA-Z2-9_-]*$/', $strAction)) { throw new Exception(ERRORMSG_INVALID); } $objTemplate = new clsTemplate('default'); $objTemplate->setText('SCRIPT', clsDB::initializeJS()); $objTemplate->setText('TITLE', "OSPAP2"); /* Inline CSS for advanced. */ $objTemplate->setText('HEAD', clsUser::getAdvancedStyle($objUser)); if (isset($_REQUEST['error']) && isset($arrMessages[$_REQUEST['error']])) { $objTemplate->setText('ERROR', $arrMessages[$_REQUEST['error']]); } else { if (isset($_REQUEST['message']) && isset($arrMessages[$_REQUEST['message']])) { $objTemplate->setText('MESSAGE', $arrMessages[$_REQUEST['message']]); } } $objTemplate->setScript('MENU', 'menu'); $objTemplate->setScript('LOGO', 'logo'); $objTemplate->setText('COPYRIGHT', "Written by <a href='mailto:ronospap@skullsecurity.org'>Ron</a>. This page and code are public domain. Code is available upon request. No warranty or promises of any kind."); switch ($strAction) { case '': $objTemplate->setScript('CONTENT', 'news'); break; case 'login': $objTemplate->setScript('CONTENT', 'login'); break; case 'logout': $objTemplate->setScript('CONTENT', 'logout'); break; case 'upload': $objTemplate->setScript('CONTENT', 'upload'); break;