diff --git a/webgui/include/ajax/functions/WiSPUsers.php b/webgui/include/ajax/functions/WiSPUsers.php index cac8ea8a206521e9e52f43bf8ccd7a6ab0239a30..d1935b239d898464d34009ad091a3996b510bf5e 100644 --- a/webgui/include/ajax/functions/WiSPUsers.php +++ b/webgui/include/ajax/functions/WiSPUsers.php @@ -363,7 +363,11 @@ function createWiSPUser($params) { foreach ($params[0]['Attributes'] as $attr) { # We only want to add attributes with all values - if (isset($attr['Name']) && isset($attr['Operator']) && isset($attr['Value'])) { + $boolName = (isset($attr['Name']) && $attr['Name'] != ""); + $boolOperator = (isset($attr['Operator']) && $attr['Operator'] != ""); + $boolValue = (isset($attr['Value']) && $attr['Value'] != ""); + if (($boolName && $boolOperator && $boolValue) == TRUE) { + # Default value without modifier $attrValue = $attr['Value']; @@ -498,7 +502,11 @@ function createWiSPUser($params) { if ($res !== FALSE && count($params[0]['Attributes']) > 0) { foreach ($params[0]['Attributes'] as $attr) { - if (isset($attr['Name']) && isset($attr['Operator']) && isset($attr['Value'])) { + # We only want to add attributes with all values + $boolName = (isset($attr['Name']) && $attr['Name'] != ""); + $boolOperator = (isset($attr['Operator']) && $attr['Operator'] != ""); + $boolValue = (isset($attr['Value']) && $attr['Value'] != ""); + if (($boolName && $boolOperator && $boolValue) == TRUE) { # Default value without modifier $attrValue = $attr['Value']; @@ -707,7 +715,11 @@ function updateWiSPUser($params) { if ($res !== FALSE && count($params[0]['Attributes']) > 0) { foreach ($params[0]['Attributes'] as $attr) { - if (isset($attr['ID']) && isset($attr['Name']) && isset($attr['Operator']) && isset($attr['Value'])) { + # We only want to add attributes with all values + $boolName = (isset($attr['Name']) && $attr['Name'] != ""); + $boolOperator = (isset($attr['Operator']) && $attr['Operator'] != ""); + $boolValue = (isset($attr['Value']) && $attr['Value'] != ""); + if (($boolName && $boolOperator && $boolValue) == TRUE) { # Default value without modifier $attrValue = $attr['Value'];