X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fsession.inc;h=d53e9b63e660cd154fd9fcdc5c49f40fb45a53eb;hb=f018643dc04ce130f1729e16a65458af443308a0;hp=a6662a7ee0988c58ae3bce3a44a5cb359a4f1303;hpb=4cf1c3dbb9ae74e0c47dda456f7ac97c7659b3fa;p=fa-stable.git
diff --git a/includes/session.inc b/includes/session.inc
index a6662a7e..d53e9b63 100644
--- a/includes/session.inc
+++ b/includes/session.inc
@@ -61,7 +61,11 @@ function check_page_security($page_security)
if (!$_SESSION["wa_current_user"]->can_access_page($page_security))
{
- page(_("Access denied"));
+ // no_menu parameter guess here is ugly hack, but works for now.
+ // Better solution is to use global switch for menu, set before
+ // session.inc inclusion.
+ page(_("Access denied"), strpos($_SERVER['PHP_SELF'], '/view/'));
+
echo "
";
echo _("The security settings on your account do not permit you to access this function");
echo "";
@@ -103,7 +107,6 @@ include_once($path_to_root . "/includes/current_user.inc");
include_once($path_to_root . "/includes/lang/language.php");
include_once($path_to_root . "/config_db.php");
include_once($path_to_root . "/includes/ajax.inc");
-include_once($path_to_root . "/includes/main.inc");
include_once($path_to_root . "/includes/ui/ui_msgs.inc");
/*
@@ -126,16 +129,25 @@ if (!isset($_SESSION['languages']))
language::set_language($_SESSION['language']->code);
+// include $Hooks object if locale file exists
+if(@include_once($path_to_root . "/lang/".$_SESSION['language']->code."/locale.inc"))
+{
+ $Hooks = new Hooks();
+}
+
include_once($path_to_root . "/config.php");
+include_once($path_to_root . "/includes/main.inc");
+// Ajax communication object
$Ajax =& new Ajax();
-//include_once($path_to_root . "/includes/main.inc");
-
-//include_once($path_to_root . "/includes/ui/ui_msgs.inc");
+// js/php validation rules container
+$Validate = array();
+// bindings for editors
+$Editors = array();
// intercept all output to destroy it in case of ajax call
-register_shutdown_function('ob_end_flush');
+register_shutdown_function('end_flush');
ob_start('output_html',0);
// colect all error msgs