"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "interface/lib/classes/remoting_lib.inc.php" between
ISPConfig-3.2.6.tar.gz and ISPConfig-3.2.7.tar.gz

About: ISPConfig is an ISP management and Hosting Control Panel (for different Managed Services).

remoting_lib.inc.php  (ISPConfig-3.2.6):remoting_lib.inc.php  (ISPConfig-3.2.7)
skipping to change at line 228 skipping to change at line 228
return $sql; return $sql;
} }
function getDataRecord($primary_id, $client_id = 0) { function getDataRecord($primary_id, $client_id = 0) {
global $app; global $app;
$escape = '`'; $escape = '`';
$this->loadUserProfile($client_id); $this->loadUserProfile($client_id);
if(@is_numeric($primary_id)) { if(@is_numeric($primary_id)) {
if($primary_id > 0) { if($primary_id > 0) {
// Return a single record // Return a single record
return parent::getDataRecord($primary_id); return parent::getDataRecord(intval($primary_id)) ;
} elseif($primary_id == -1) { } elseif($primary_id == -1) {
// Return a array with all records // Return a array with all records
$sql = "SELECT * FROM ??"; $sql = "SELECT * FROM ??";
return $app->db->queryAllRecords($sql, $this->for mDef['db_table']); return $app->db->queryAllRecords($sql, $this->for mDef['db_table']);
} else { } else {
throw new SoapFault('invalid_id', 'The ID has to be > 0 or -1.'); throw new SoapFault('invalid_id', 'The ID has to be > 0 or -1.');
return array(); return array();
} }
} elseif (@is_array($primary_id) || @is_object($primary_id)) { } 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 prot ected properties! if(@is_object($primary_id)) $primary_id = get_object_vars ($primary_id); // do not use cast (array)xxx because it returns private and prot ected properties!
skipping to change at line 251 skipping to change at line 251
$sql_where = ''; $sql_where = '';
$params = array($this->formDef['db_table']); $params = array($this->formDef['db_table']);
foreach($primary_id as $key => $val) { foreach($primary_id as $key => $val) {
if($key == '#OFFSET#') $sql_offset = $app->functi ons->intval($val); if($key == '#OFFSET#') $sql_offset = $app->functi ons->intval($val);
elseif($key == '#LIMIT#') $sql_limit = $app->func tions->intval($val); elseif($key == '#LIMIT#') $sql_limit = $app->func tions->intval($val);
elseif(stristr($val, '%')) { elseif(stristr($val, '%')) {
$sql_where .= "?? like ? AND "; $sql_where .= "?? like ? AND ";
} else { } else {
$sql_where .= "?? = ? AND "; $sql_where .= "?? = ? AND ";
} }
$params[] = $key; $params[] = (string)$key;
$params[] = $val; $params[] = (string)$val;
} }
$sql_where = substr($sql_where, 0, -5); $sql_where = substr($sql_where, 0, -5);
if($sql_where == '') $sql_where = '1'; if($sql_where == '') $sql_where = '1';
$sql = "SELECT * FROM ?? WHERE ".$sql_where. " AND " . $t his->getAuthSQL('r', $this->formDef['db_table']); $sql = "SELECT * FROM ?? WHERE ".$sql_where. " AND " . $t his->getAuthSQL('r', $this->formDef['db_table']);
if($sql_offset >= 0 && $sql_limit > 0) $sql .= ' LIMIT ' . $sql_offset . ',' . $sql_limit; if($sql_offset >= 0 && $sql_limit > 0) $sql .= ' LIMIT ' . $sql_offset . ',' . $sql_limit;
return $app->db->queryAllRecords($sql, true, $params); return $app->db->queryAllRecords($sql, true, $params);
} else { } else {
$this->errorMessage = 'The ID must be either an integer o r an array.'; $this->errorMessage = 'The ID must be either an integer o r an array.';
return array(); return array();
} }
 End of changes. 2 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)