session_set_cookie_params(86400*30); ini_set('session.gc_maxlifetime', 86400*30); session_start(); include_once("/myApps/zoomfood/functions.inc.php"); $defaultDbLink = new DbConnection(); $user = addslashes(trim($_POST['user'])); $pass = addslashes(trim($_POST['pass'])); $sysarea = addslashes(trim($_POST['sysarea'])); if ($_GET['function'] == "logout") { session_destroy(); header("Location: ./"); exit; } else if ($_SESSION['login_eid'] > 0) { doFramework("user"); } else if ($user && $pass) { $sql = "SELECT * FROM employees WHERE username = '" . $user . "' AND password = '" . $pass . "' LIMIT 1"; #print $sql; #exit; $row = getDbRow($sql); if ($row['access'] == "admin" || $row['access'] == "super") { $empRow = getEmployeeRow($row['employee_id']); $_SESSION['login_eid'] = $row['employee_id']; $_SESSION['parentCompanyId'] = $empRow['company_parent_id']; if (!$_SESSION["companyId"]) $_SESSION["companyId"] = pGetFirstCompany($empRow['company_parent_id']); else if (!pIsCompanyPartOfParrent($_SESSION["companyId"], $empRow['company_parent_id'])) $_SESSION["companyId"] = pGetFirstCompany($empRow['company_parent_id']); //$_SESSION['menu'] = $row['menu']; //$_SESSION['startpage'] = $row['startpage']; doFramework($sysarea); } } function doFramework($sysarea) { print '