diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php index e54c5235b29cf9d57108861c64ed40431ceda460..bd6877578be57069212585772a547e8590990d7a 100644 --- a/interface/lib/classes/remoting.inc.php +++ b/interface/lib/classes/remoting.inc.php @@ -2430,6 +2430,7 @@ class remoting { //* Get the SQL query $sql = $app->remoting_lib->getSQL($params,'UPDATE',$primary_id); + // $this->server->fault('debug', $sql); if($app->remoting_lib->errorMessage != '') { $this->server->fault('data_processing_error', $app->remoting_lib->errorMessage); return false; diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php index f9b6e72e512c3d72aaf28336e2fce21a9664564d..d100f150c2838adda028200420d29761bacf9aeb 100644 --- a/interface/lib/classes/remoting_lib.inc.php +++ b/interface/lib/classes/remoting_lib.inc.php @@ -608,17 +608,19 @@ class remoting_lib { $sql_insert_val .= "'".$record[$key]."', "; } } else { + if($field['formtype'] == 'PASSWORD') { - if($field['encryption'] == 'CRYPT') { + if(isset($field['encryption']) && $field['encryption'] == 'CRYPT') { $record[$key] = $app->auth->crypt_password(stripslashes($record[$key])); - } elseif ($field['encryption'] == 'MYSQL') { - $sql_insert_val .= "PASSWORD('".$app->db->quote($record[$key])."'), "; - } elseif ($field['encryption'] == 'CLEARTEXT') { - $sql_insert_val .= "'".$app->db->quote($record[$key])."', "; + $sql_update .= "`$key` = '".$app->db->quote($record[$key])."', "; + } elseif (isset($field['encryption']) && $field['encryption'] == 'MYSQL') { + $sql_update .= "`$key` = PASSWORD('".$app->db->quote($record[$key])."'), "; + } elseif (isset($field['encryption']) && $field['encryption'] == 'CLEARTEXT') { + $sql_update .= "`$key` = '".$app->db->quote($record[$key])."', "; } else { - $record[$key] = md5($record[$key]); + $record[$key] = md5(stripslashes($record[$key])); + $sql_update .= "`$key` = '".$app->db->quote($record[$key])."', "; } - $sql_update .= "`$key` = '".$record[$key]."', "; } elseif ($field['formtype'] == 'CHECKBOX') { if($record[$key] == '') { // if a checkbox is not set, we set it to the unchecked value