From 97f28b1115ccfdcbdab8e8709ba706c5aefe5a1c Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Wed, 01 Apr 2015 05:01:23 -0400
Subject: [PATCH] Fixed: FS#3854 - Missing secure and httponly attribute on PHP session cookie

---
 interface/lib/classes/remoting_lib.inc.php |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php
index 5d1b23d..0d89c1f 100644
--- a/interface/lib/classes/remoting_lib.inc.php
+++ b/interface/lib/classes/remoting_lib.inc.php
@@ -186,12 +186,11 @@
 	 /**
 	 * Rewrite the record data to be stored in the database
 	 * and check values with regular expressions.
-	 * dummy parameter is only there for compatibility with params of base class
 	 *
 	 * @param record = Datensatz als Array
 	 * @return record
 	 */
-	function encode($record, $dbencode = true, $dummy = '') {
+	function encode($record, $tab = '', $dbencode = true) {
 		$new_record = $this->_encode($record, '', $dbencode, true);
 		if(isset($record['_ispconfig_pw_crypted'])) $new_record['_ispconfig_pw_crypted'] = $record['_ispconfig_pw_crypted']; // this one is not in form definitions!
 
@@ -233,8 +232,19 @@
 	function getDataRecord($primary_id) {
 		global $app;
 		$escape = '`';
+		$this->loadUserProfile();
 		if(@is_numeric($primary_id)) {
-			return parent::getDataRecord($primary_id);
+			if($primary_id > 0) {
+				// Return a single record
+				return parent::getDataRecord($primary_id);
+			} elseif($primary_id == -1) {
+				// Return a array with all records
+				$sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape;
+				return $app->db->queryAllRecords($sql);
+			} else {
+				throw new SoapFault('invalid_id', 'The ID has to be > 0 or -1.');
+				return array();
+			}
 		} elseif (@is_array($primary_id) || @is_object($primary_id)) {
 			if(@is_object($primary_id)) $primary_id = get_object_vars($primary_id); // do not use cast (array)xxx because it returns private and protected properties!
 			$sql_offset = 0;

--
Gitblit v1.9.1