SetTracker($oErr); } // Assign Table $oTable = new DBTableDef(); $oTable->GetTableDef($oDB, TABLE_NAME); /*++++++++++++++++++++++++++++++++ START PROGRAM ++++++++++++++++++++++++++++++++*/ $sAct = $_REQUEST['act']; $oLogin = new LoginManager(); if ($sAct == 'login') { $sUser = $_POST['user']; $sPass = $_POST['pass']; $oLogin->SetDBConnection($oDB); if (!$oLogin->Login($sUser, $sPass)) { $msg = 'Login incorrect, please try again.'; } elseif ($oLogin->IsAdmin()) { DoRedirect($oLogin->SelectPage()); exit(); } else { DoRedirect($oLogin->SelectPage()); exit(); } } elseif ($sAct == 'logout') { if (sizeof($_SESSION) > 0) { foreach ($_SESSION as $sKey => $sVal) { if (substr($sKey, 0, 3) == 'au_') { session_unregister($sKey); } } } } else { $msg = ''; } $tp = new template(LIST_PAGE); $tp->Display(); /*++++++++++++++++++++++++++++++++ END PROGRAM ++++++++++++++++++++++++++++++++*/ // Close DB conection & show tracker message if ($bDebug) { echo($oErr->GetAll()); } $oDB->Close(); ?>