#Get Error Messages $errMsg = $formGen->getErrorMsg("The following errors occured", "style2"); #Get Posted Values $postedVals = $formGen->getPostedElementValues(); if (count($postedVals)) { include "dbaccess.class.php"; //Create Instance $mySqlObj = new dBAccess(_DBHOST, _DBUSERNAME, _DBPASSWORD); //MySQL Database Instance $mySqlObj->selectDB(_DBNAME); $resLogin = $mySqlObj->authenticateLogin($postedVals["usName"], $postedVals["psWord"], true); if (count($resLogin)) { loginUser(_APPNAME, $resLogin[0]["userId"], $resLogin[0]["lastLogin"]); redirectPage("index.php"); } else { $errMsg = $_appLang["errorLogin"]; } } $contVal[0][0] = array("value" => "Username"); $contVal[0][1] = array("value" => $disElementHTML["usName"]); $contVal[1][0] = array("value" => "Password"); $contVal[1][1] = array("value" => $disElementHTML["psWord"]); $contVal[2][1] = array("value" => $disForm["submit"]); $contTable = genHTMLTable(3, 2, $contVal, "100%", "", 4); $contVal2[0][0] = array("value" => "Login", "style" => "titletext"); $contVal2[1][0] = array("value" => $errMsg, "style" => "tinyredtext"); $contVal2[2][0] = array("value" => $disForm["form"]["start"] . $contTable . $disForm["form"]["end"]); $contTable2 = genHTMLTable(3, 1, $contVal2, "220"); showHeaderHTML("Management Console", "appstyle.css", "", ""); echo useTemplate("mainlayout", "Management Console", "", "", $contTable2); showFooterHTML();
session_start(); error_reporting(E_ALL); ini_set("display_errors", "on"); include "settings.inc.php"; include "lang/en.inc.php"; include "function.php"; include _LIBPATH . "functions.custom.inc.php"; include "dbaccess.class.php"; ini_set('memory_limit', "32M"); logoutUser(_APPNAME); //Logout user if request to logout if (!isLoggedIn(_APPNAME)) { redirectPage("login.php"); } //Create DBAccess Instance $mySqlObj = new dBAccess(_DBHOST, _DBUSERNAME, _DBPASSWORD); //MySQL Database Instance $mySqlObj->selectDB(_DBNAME); //$mySqlObj -> enableDebugMode(); $pageJS = ""; /*initAJAX(_APPNAME, _USEAJAX); if(getAJAXState(_APPNAME)){ $pageJS = getAjaxJS(); }*/ $incRPC = true; include "rpc.php"; $disPageCont = "<div id=\"content\">" . $_disContentBody . "</div>"; include "nav.php"; showHeaderHTML("Management Console", "appstyle.css", $pageJS); echo useTemplate("mainlayout", "Management Console", "Welcome " . $mySqlObj->getResourceName(getUserId(_APPNAME)) . "!", $_navLinkList, $disPageCont); showFooterHTML();
echo '</a>'; } echo '</li>' . "\n"; } if (!isset($site)) { require_once 'CMS/siteinfo.php'; $site = new siteinfo(); } function useTemplate($file) { echo $file; echo ' use!'; } // use the template // we're done if a template is used $stylePath = dirname(dirname(__FILE__)) . '/themes/' . $site->getStyle(); if (file_exists($stylePath . $site->base_name())) { useTemplate($stylePath . $site->base_name()); die; } elseif (file_exists($stylePath . '/html.template')) { useTemplate($stylePath . '/html.template'); die; } elseif (file_exists($stylePath . '/php.template')) { // a theme specific template does exist // directly execute a template written in PHP include $stylePath . '/php.template'; } else { // a generic template is required // directly execute a template written in PHP include dirname($stylePath) . '/php.template'; }