2 /*--------------------------------------------------\
4 |---------------------------------------------------|
6 | http://open-accounting.sourceforge.net/ |
7 | by KylieTech Consulting |
8 | http://frontaccounting.com/ |
9 | by Joe Hunt Consulting |
10 \--------------------------------------------------*/
12 if (!isset($path_to_root))
17 include_once($path_to_root . "/includes/current_user.inc");
20 // Make sure this directory exists and is writable!
21 $session_save_path = dirname(__FILE__).'/tmp/';
24 $session_save_path = session_save_path();
25 if (strpos($session_save_path, ";") !== false)
26 $session_save_path = substr($session_save_path, strpos($session_save_path, ";") + 1);
28 if (isset($session_save_path))
30 session_save_path($session_save_path);
31 unset($session_save_path);
33 if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_to_root']))
34 die("Restricted access");
35 include_once($path_to_root . "/config_db.php");
36 include_once($path_to_root . "/includes/lang/language.php");
38 include_once($path_to_root . "/config.php");
40 include_once($path_to_root . "/includes/main.inc");
42 //----------------------------------------------------------------------------------------
50 //----------------------------------------------------------------------------------------
54 echo "<center><br><br><font size='5' color='red'><b>" . _("Incorrect Password") . "<b></font><br><br>";
55 echo "<b>" . _("The user and password combination is not valid for the system.") . "<b><br><br>";
57 echo _("If you are not an authorized user, please contact your system administrator to obtain an account to enable you to use the system.");
58 echo "<br><a href='javascript:history.go(-1)'>" . _("Back") . "</a>";
65 //----------------------------------------------------------------------------------------
67 function check_page_security($page_security)
69 if (!$_SESSION["wa_current_user"]->check_user_access())
71 echo "<br><br><br><center>";
72 echo "<b>" . _("Security settings have not been defined for your user account.");
73 echo "<br>" . _("Please contact your system administrator.") . "</b>";
79 if (!$_SESSION["wa_current_user"]->can_access_page($page_security))
81 page(_("Access denied"));
82 echo "<center><br><br><br><b>";
83 echo _("The security settings on your account do not permit you to access this function");
85 echo "<br><br><a href='javascript:history.go(-1)'>" . _("Back") . "</a>";
86 echo "<br><br><br><br>";
87 //echo '<script type="text/javascript">';
88 //echo 'alert("' . _("The security settings on your account do not permit you to access this function") . '");';
89 //echo 'history.go(-1)';
97 //----------------------------------------------------------------------------------------
98 if (!isset($_SESSION["wa_current_user"]) ||
99 (isset($_SESSION["wa_current_user"]) && !$_SESSION["wa_current_user"]->logged_in()))
102 $_SESSION["wa_current_user"] = new current_user();
105 if (!isset($_POST["user_name_entry_field"]) or $_POST["user_name_entry_field"] == "")
107 include($path_to_root . "/access/login.php");
112 if (isset($_POST["user_name_entry_field"]))
114 $succeed = $_SESSION["wa_current_user"]->login($_POST["company_login_name"],
115 $_POST["user_name_entry_field"],
116 md5($_POST["password"]));
120 // Incorrect password
125 // Run with debugging messages for the system administrator(s) but not anyone else
126 /*if (in_array(15, $security_groups[$_SESSION["AccessLevel"]])) {
132 //----------------------------------------------------------------------------------------
133 check_page_security($page_security);