| | |
| | | $sql = "DELETE FROM remote_session WHERE tstamp < UNIX_TIMSTAMP()"; |
| | | $app->db->query($sql); |
| | | |
| | | $username = $app->db->quote($username); |
| | | $password = $app->db->quote($password); |
| | | |
| | | if($client_login == true) { |
| | | $sql = "SELECT * FROM sys_user WHERE USERNAME = ?"; |
| | | $user = $app->db->queryOneRecord($sql, $username); |
| | |
| | | return false; |
| | | } |
| | | |
| | | $session_id = $app->db->quote($session_id); |
| | | |
| | | $sql = "DELETE FROM remote_session WHERE remote_session = ?"; |
| | | if($app->db->query($sql, $session_id) != false) { |
| | | return true; |
| | |
| | | $sql = $app->remoting_lib->getSQL($params, 'INSERT', 0); |
| | | |
| | | //* Check if no system user with that username exists |
| | | $username = $app->db->quote($params["username"]); |
| | | $username = $params["username"]; |
| | | $tmp = $app->db->queryOneRecord("SELECT count(userid) as number FROM sys_user WHERE username = ?", $username); |
| | | if($tmp['number'] > 0) $app->remoting_lib->errorMessage .= "Duplicate username<br />"; |
| | | |
| | |
| | | |
| | | //* get old record and merge with params, so only new values have to be set in $params |
| | | $old_rec = $app->remoting_lib->getDataRecord($primary_id); |
| | | |
| | | foreach ($app->remoting_lib->formDef['fields'] as $fieldName => $fieldConf) |
| | | { |
| | | if ($fieldConf['formtype'] === 'PASSWORD' && empty($params[$fieldName])) { |
| | | unset($old_rec[$fieldName]); |
| | | } |
| | | } |
| | | |
| | | $params = $app->functions->array_merge($old_rec,$params); |
| | | |
| | | //* Get the SQL query |
| | | $sql = $app->remoting_lib->getSQL($params, 'UPDATE', $primary_id); |
| | | |
| | | // throw new SoapFault('debug', $sql); |
| | | if($app->remoting_lib->errorMessage != '') { |
| | | throw new SoapFault('data_processing_error', $app->remoting_lib->errorMessage); |
| | |
| | | throw new SoapFault('session_id_empty', 'The SessionID is empty.'); |
| | | return false; |
| | | } |
| | | |
| | | $session_id = $app->db->quote($session_id); |
| | | |
| | | $sql = "SELECT * FROM remote_session WHERE remote_session = ? AND tstamp >= UNIX_TIMSTAMP()"; |
| | | $session = $app->db->queryOneRecord($sql, $session_id); |