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");
19 include_once($path_to_root . "/config.php");
21 include_once($path_to_root . "/includes/main.inc");
23 //----------------------------------------------------------------------------------------
31 //----------------------------------------------------------------------------------------
35 echo "<center><br><br><font size='5' color='red'><b>" . _("Incorrect Password") . "<b></font><br><br>";
36 echo "<b>" . _("The user and password combination is not valid for the system.") . "<b><br><br>";
38 echo _("If you are not an authorized user, please contact your system administrator to obtain an account to enable you to use the system.");
39 echo "<br><a href='javascript:history.go(-1)'>" . _("Back") . "</a>";
46 //----------------------------------------------------------------------------------------
48 function check_page_security($page_security)
50 if (!$_SESSION["wa_current_user"]->check_user_access())
52 echo "<br><br><br><center>";
53 echo "<b>" . _("Security settings have not been defined for your user account.");
54 echo "<br>" . _("Please contact your system administrator.") . "</b>";
60 if (!$_SESSION["wa_current_user"]->can_access_page($page_security))
62 page(_("Access denied"));
63 echo "<center><br><br><br><b>";
64 echo _("The security settings on your account do not permit you to access this function");
66 echo "<br><br><a href='javascript:history.go(-1)'>" . _("Back") . "</a>";
67 echo "<br><br><br><br>";
68 //echo '<script type="text/javascript">';
69 //echo 'alert("' . _("The security settings on your account do not permit you to access this function") . '");';
70 //echo 'history.go(-1)';
78 //----------------------------------------------------------------------------------------
79 if (!isset($_SESSION["wa_current_user"]) ||
80 (isset($_SESSION["wa_current_user"]) && !$_SESSION["wa_current_user"]->logged_in()))
83 $_SESSION["wa_current_user"] = new current_user();
86 if (!isset($_POST["user_name_entry_field"]) or $_POST["user_name_entry_field"] == "")
88 include($path_to_root . "/access/login.php");
93 if (isset($_POST["user_name_entry_field"]))
95 $succeed = $_SESSION["wa_current_user"]->login($_POST["company_login_name"],
96 $_POST["user_name_entry_field"],
97 md5($_POST["password"]));
101 // Incorrect password
106 global $js_lib, $js_static, $js_path;
107 $js_path = $path_to_root.'/js/';
108 // standard external js scripts included in all files
109 $js_static = array('behaviour.js');
110 // additional js source included in header
113 add_js_user_num(); // add user native numeric input functions
115 // Run with debugging messages for the system administrator(s) but not anyone else
116 /*if (in_array(15, $security_groups[$_SESSION["AccessLevel"]])) {
122 //----------------------------------------------------------------------------------------
123 check_page_security($page_security);