From 35cc408f854e410452ef637d79fb68157049efdf Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 02 Sep 2010 10:35:07 -0400
Subject: [PATCH] Implemented client template support in remoting API: FS#1308
---
interface/lib/classes/tform.inc.php | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php
index d296943..e9cbc93 100644
--- a/interface/lib/classes/tform.inc.php
+++ b/interface/lib/classes/tform.inc.php
@@ -40,7 +40,7 @@
* - DOUBLE
* - CURRENCY (Formats digits in currency notation)
* - VARCHAR (No format check)
-* - DATE (Date format, converts from and to linux timestamps automatically)
+* - DATE (Date format, converts from and to UNIX timestamps automatically)
*
* Formtype:
* - TEXT (Normal text field)
@@ -362,7 +362,7 @@
// If Datasource is set, get the data from there
if(isset($field['datasource']) && is_array($field['datasource'])) {
if(is_array($field["value"])) {
- $field["value"] = $field["value"] + $this->getDatasourceData($field, $record);
+ $field["value"] = array_merge($field["value"],$this->getDatasourceData($field, $record));
} else {
$field["value"] = $this->getDatasourceData($field, $record);
}
@@ -733,7 +733,7 @@
}
break;
case 'ISEMAIL':
- if(!preg_match("/^\w+[\w.-]*\w{0,}@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) {
+ if(!preg_match("/^\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) {
$errmsg = $validator['errmsg'];
if(isset($this->wordbook[$errmsg])) {
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
@@ -1125,15 +1125,18 @@
}
- function getAuthSQL($perm) {
+ function getAuthSQL($perm, $table = '') {
if($_SESSION["s"]["user"]["typ"] == 'admin') {
return '1';
} else {
+ if ($table != ''){
+ $table = ' ' . $table . '.';
+ }
$groups = ( $_SESSION["s"]["user"]["groups"] ) ? $_SESSION["s"]["user"]["groups"] : 0;
$sql = '(';
- $sql .= "(sys_userid = ".$_SESSION["s"]["user"]["userid"]." AND sys_perm_user like '%$perm%') OR ";
- $sql .= "(sys_groupid IN (".$groups.") AND sys_perm_group like '%$perm%') OR ";
- $sql .= "sys_perm_other like '%$perm%'";
+ $sql .= "(" . $table . "sys_userid = ".$_SESSION["s"]["user"]["userid"]." AND " . $table . "sys_perm_user like '%$perm%') OR ";
+ $sql .= "(" . $table . "sys_groupid IN (".$groups.") AND " . $table ."sys_perm_group like '%$perm%') OR ";
+ $sql .= $table . "sys_perm_other like '%$perm%'";
$sql .= ')';
return $sql;
@@ -1418,4 +1421,4 @@
}
}
-?>
\ No newline at end of file
+?>
--
Gitblit v1.9.1