From 37b29231e47a0c4458dc1c15d98588f16f07e1e2 Mon Sep 17 00:00:00 2001 From: Marius Cramer Date: Thu, 6 Aug 2015 09:18:44 +0200 Subject: [PATCH] - don't set password via remoting if field is empty --- interface/lib/classes/remoting.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php index 204aebb15c..da02e7a191 100644 --- a/interface/lib/classes/remoting.inc.php +++ b/interface/lib/classes/remoting.inc.php @@ -336,6 +336,14 @@ class remoting { //* 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 -- GitLab