From 341ef7175af7c8f21d27262b58da8f5bc2c06ef0 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Tue, 08 Jul 2014 08:44:59 -0400
Subject: [PATCH] Merge branch 'master_fixes' into 'master'

---
 interface/lib/classes/tform_base.inc.php |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/interface/lib/classes/tform_base.inc.php b/interface/lib/classes/tform_base.inc.php
index 6cfdfe0..329f1ef 100644
--- a/interface/lib/classes/tform_base.inc.php
+++ b/interface/lib/classes/tform_base.inc.php
@@ -270,6 +270,7 @@
 			unset($tmp_recordid);
 
 			$querystring = str_replace("{AUTHSQL}", $this->getAuthSQL('r'), $querystring);
+			$querystring = preg_replace_callback('@{AUTHSQL::(.+?)}@', array($this, 'table_auth_sql'), $querystring);
 
 			// Getting the records
 			$tmp_records = $app->db->queryAllRecords($querystring);
@@ -311,6 +312,9 @@
 
 	}
 
+	function table_auth_sql($matches){
+		return $this->getAuthSQL('r', $matches[1]);
+	}
 
 	/**
 	 * Get the key => value array of a form filled from a datasource definitiom
@@ -1366,7 +1370,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