Mercurial > hg > fapweb
diff index.php @ 8:4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 06 Dec 2012 13:30:46 +0200 |
parents | 76c3b89d7b11 |
children | e36c4d2b09c4 |
line wrap: on
line diff
--- a/index.php Wed Dec 05 09:35:30 2012 +0200 +++ b/index.php Thu Dec 06 13:30:46 2012 +0200 @@ -3,6 +3,7 @@ require "msite.inc.php"; require "mcommon.inc.php"; + // Switch to https first, if needed if (!stCheckHTTPS()) { @@ -10,19 +11,25 @@ exit; } +// Check for cache-controlled pages if (isset($_SERVER["REQUEST_URI"]) && array_key_exists($_SERVER["REQUEST_URI"], $securePages)) stSetupCacheControl(); +// Start output printPageHeader($pageTitle, " <meta http-equiv=\"Pragma\" content=\"no-cache\" />"); +// Initiate SQL database connection if (!stConnectSQLDB()) { printPageFooter(); exit; } +// Fetch non-"hardcoded" settings from SQL database +stReloadSettings(); + ?> <div id="headerbox"> <div id="header"> @@ -33,8 +40,10 @@ <a href="news">News</a> <a href="compos">Compos</a> <a href="event">Event</a> - <a href="attendees">Attendees</a> <? +if (stGetSetting("showAttendees", FALSE)) +echo " <a href=\"attendees\">Attendees</a>\n"; + if (stGetSetting("allowVoting", FALSE)) echo " <a href=\"vote\">Vote</a>\n";