From 06339e0c8ac8fdbbf5d2784df8019704da9bd6eb Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Tue, 13 Jan 2015 12:28:33 -0500
Subject: [PATCH] - fixed javascript call in json file

---
 interface/lib/classes/tform_base.inc.php |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/interface/lib/classes/tform_base.inc.php b/interface/lib/classes/tform_base.inc.php
index 65f10c5..e27940d 100644
--- a/interface/lib/classes/tform_base.inc.php
+++ b/interface/lib/classes/tform_base.inc.php
@@ -270,7 +270,7 @@
 			unset($tmp_recordid);
 
 			$querystring = str_replace("{AUTHSQL}", $this->getAuthSQL('r'), $querystring);
-			$querystring = preg_replace_callback('@{AUTHSQL::(.+?)}@', "self::table_auth_sql", $querystring);
+			$querystring = preg_replace_callback('@{AUTHSQL::(.+?)}@', create_function('$matches','global $app; $tmp = $app->tform->getAuthSQL("r", $matches[1]); return $tmp;'), $querystring);
 
 			// Getting the records
 			$tmp_records = $app->db->queryAllRecords($querystring);
@@ -312,7 +312,12 @@
 
 	}
 
-
+	/*
+	function table_auth_sql($matches){
+		return $this->getAuthSQL('r', $matches[1]);
+	}
+	*/
+	
 	/**
 	 * Get the key => value array of a form filled from a datasource definitiom
 	 *
@@ -1367,7 +1372,7 @@
 	}
 
 	function getAuthSQL($perm, $table = '') {
-		if($_SESSION["s"]["user"]["typ"] == 'admin') {
+		if($_SESSION["s"]["user"]["typ"] == 'admin' || $_SESSION['s']['user']['mailuser_id'] > 0) {
 			return '1';
 		} else {
 			if ($table != ''){

--
Gitblit v1.9.1