index.php

Go to the documentation of this file.
00001 <?php
00031 include("include/classes/config.php");
00032 
00033 /* connect to database */
00034 include("include/classes/database.php");
00035 $db = new Database();
00036 if (!$db->isConnected()) {
00037     echo $db->errorMsg();
00038     exit;
00039 }
00040 
00041 /* read system configuration */
00042 $cfg = new Config();
00043 
00045 //include("include/classes/error.php");
00046 //$err = new Error();
00047 
00048 /* start session */
00049 include("include/classes/session.php");
00050 $session = new Session();
00051 
00052 /* create event logging object */
00053 include("include/classes/eventlog.php");
00054 $log = new EventLog();
00055 
00056 /* check logout */
00057 include("include/classes/cmskey.php");
00058 $action = CMSkey::postOrGet("a");
00059 if ($action == "logout") {
00060 //  /* sign off the chatrooms */
00061 //  include_once("include/classes/chat.php");
00062 //  Chat::signOff($session->getValue("uid"));
00063     $log->write("USERLOGOUT");
00064     $session->destroy();
00065     header("Location: " . $cfg->getConfig("DEFAULT_PAGE"));
00066     exit;
00067 }
00068 
00070 include("include/classes/auth.php");
00071 $auth = new Auth();
00072 
00074 //if ($_FILES['userfile'] && ($action == "uploadfile")) {
00075 //  include("include/classes/files.php");
00076 //  Files::upload();
00077 //  if ($action == "uploadfile") {
00078 //      $lp = getDecodedString($_POST['lp']);
00079 //      if ($lp) { $lp = "?" . $lp; }
00080 //      header("Location: " . $cfg->getConfig("DEFAULT_PAGE") . $lp);
00081 //  }
00082 //  exit;
00083 //}
00084 
00088 
00089 /* set language */
00090 include("include/classes/lang.php");
00091 $lang = new Lang();
00092 
00093 /* check if user changed language */
00094 if ($_GET['lang']) {
00095     $lang->setLanguage($_GET['lang']);
00096     header("Location: " . $cfg->getConfig("DEFAULT_PAGE") . CMSkey::getQueryString("lang"));
00097     exit;
00098 }
00099 
00100 /* include all string localizations */
00101 include("include/lang/" . $lang->getCurrentLanguage() . ".php");
00102 
00103 //include("include/fckeditor/fckeditor.php");
00104 
00105 /* create cms */
00106 $cms = new CMSkey();
00107 //if (!$action && $cms->isOutputFile()) {
00108 //  $cms->outputFile();
00109 //  $lp = getDecodedString($_POST['lp']);
00110 //  if ($lp) { $lp = "?" . $lp; }
00111 //  header("Location: " . $cfg->getConfig("DEFAULT_PAGE") . $lp);
00112 //  exit;
00113 //}
00114 
00115 //if ($_GET['rss']) {
00116 //  header("Content-type: application/xml");
00117 //  echo $cms->getRSS();
00118 //  exit;
00119 //}
00120 
00122 //if ($action == "login") {
00123 //  $auth->validateUser();
00124 //  header("Location: " . $cfg->getConfig("DEFAULT_PAGE"));
00125 //  exit;
00126 //}
00127 
00128 if ($action) {
00129     header("Location: " . $cfg->getConfig("DEFAULT_PAGE") . $cms->doAction($action));
00130     exit;
00131 }
00132 // FIXME xml languages should depend on current language (?)
00133 //?>
00134 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
00135        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
00136 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
00137 <head>
00138 <title><?php echo $cms->getPageTitle(); ?></title>
00139 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
00140 <meta name="robots" content="all" />
00141 <meta name="author" content="CMSkey" />
00142 <meta name="keywords" content="" />
00143 <meta name="description" content="" />
00144 <style type="text/css" media="all">@import "css/default.css";></style>
00145 <link rel="alternate" type="application/rss+xml" title="CMSkey RSS 2.0" href="<?php echo $cfg->getBaseURL(); ?>?rss=xml" />
00146 <link rel="icon" href="/images/favicon.ico" type="image/ico" />
00147 </head>
00148 <?php
00149     echo $cms->getHTML();
00150     $db->disconnect();
00151 ?>
00152 </html>

Generated on Fri Feb 22 11:19:48 2008 for CMSkey by  doxygen 1.5.3