+ if (!$_SESSION["wa_current_user"]->can_access_page($page_security))
+ {
+ // 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 "<center><br><br><br><b>";
+ echo _("The security settings on your account do not permit you to access this function");
+ echo "</b>";
+ echo "<br><br><br><br></center>";
+ end_page();
+ //kill_login();
+ exit;
+ }
+}
+
+//-----------------------------------------------------------------------------
+// Removing magic quotes from nested arrays/variables
+//
+function strip_quotes($data)
+{
+ if(get_magic_quotes_gpc()) {
+ if(is_array($data)) {
+ foreach($data as $k => $v) {
+ $data[$k] = strip_quotes($data[$k]);
+ }
+ } else
+ return stripslashes($data);
+ }
+ return $data;
+}
+
+//============================================================================
+//
+//
+function login_timeout()
+{
+ // skip timeout on logout page
+ if ($_SESSION["wa_current_user"]->logged
+ && !strpos($_SERVER['PHP_SELF'], 'logout.php')) {
+ $tout = $_SESSION["wa_current_user"]->timeout;
+ if ($tout && (time() > $_SESSION["wa_current_user"]->last_act + $tout))
+ {
+ $_SESSION["wa_current_user"]->logged = false;
+ }
+ $_SESSION["wa_current_user"]->last_act = time();
+ }
+}
+//============================================================================
+if (!isset($path_to_root))
+{
+ $path_to_root = ".";
+}
+
+// Prevent register_globals vulnerability
+if (isset($_GET['path_to_root']) || isset($_POST['path_to_root']))
+ die("Restricted access");
+
+include_once($path_to_root . "/frontaccounting.php");
+include_once($path_to_root . "/admin/db/security_db.inc");
+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/ui/ui_msgs.inc");