Skip to content
Snippets Groups Projects
Commit cedad166 authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'master' into 'master'

fixes for the SOAP interface

correcting a typo and the backticks of columns in queries

See merge request !233
parents 9f557ddc 6fe4103f
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,7 @@ class remoting { ...@@ -90,7 +90,7 @@ class remoting {
} }
//* Delete old remoting sessions //* Delete old remoting sessions
$sql = "DELETE FROM remote_session WHERE tstamp < UNIX_TIMSTAMP()"; $sql = "DELETE FROM remote_session WHERE tstamp < UNIX_TIMESTAMP()";
$app->db->query($sql); $app->db->query($sql);
if($client_login == true) { if($client_login == true) {
...@@ -231,7 +231,7 @@ class remoting { ...@@ -231,7 +231,7 @@ class remoting {
/* copied from the client_edit php */ /* copied from the client_edit php */
exec('ssh-keygen -t rsa -C '.$username.'-rsa-key-'.time().' -f /tmp/id_rsa -N ""'); exec('ssh-keygen -t rsa -C '.$username.'-rsa-key-'.time().' -f /tmp/id_rsa -N ""');
$app->db->query("UPDATE client SET created_at = UNIX_TIMSTAMP(), id_rsa = ?, ssh_rsa = ? WHERE client_id = ?", @file_get_contents('/tmp/id_rsa'), @file_get_contents('/tmp/id_rsa.pub'), $this->id); $app->db->query("UPDATE client SET created_at = UNIX_TIMESTAMP(), id_rsa = ?, ssh_rsa = ? WHERE client_id = ?", @file_get_contents('/tmp/id_rsa'), @file_get_contents('/tmp/id_rsa.pub'), $this->id);
exec('rm -f /tmp/id_rsa /tmp/id_rsa.pub'); exec('rm -f /tmp/id_rsa /tmp/id_rsa.pub');
...@@ -475,7 +475,7 @@ class remoting { ...@@ -475,7 +475,7 @@ class remoting {
return false; return false;
} }
$sql = "SELECT * FROM remote_session WHERE remote_session = ? AND tstamp >= UNIX_TIMSTAMP()"; $sql = "SELECT * FROM remote_session WHERE remote_session = ? AND tstamp >= UNIX_TIMESTAMP()";
$session = $app->db->queryOneRecord($sql, $session_id); $session = $app->db->queryOneRecord($sql, $session_id);
if($session['remote_userid'] > 0) { if($session['remote_userid'] > 0) {
return $session; return $session;
......
...@@ -243,9 +243,9 @@ class remoting_lib extends tform_base { ...@@ -243,9 +243,9 @@ class remoting_lib extends tform_base {
if($key == '#OFFSET#') $sql_offset = $app->functions->intval($val); if($key == '#OFFSET#') $sql_offset = $app->functions->intval($val);
elseif($key == '#LIMIT#') $sql_limit = $app->functions->intval($val); elseif($key == '#LIMIT#') $sql_limit = $app->functions->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[] = $key;
$params[] = $val; $params[] = $val;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment