Skip to content

Commit 841c6b5

Browse files
committedOct 2, 2019
formtools/module-submission_accounts#11 hiding password value in user frontend
1 parent f18496a commit 841c6b5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed
 

‎global/smarty_plugins/function.edit_custom_field.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ function smarty_function_edit_custom_field($params, &$smarty)
3939

4040
// TODO make sense of this. Both are required in different contexts
4141
// - in form builder, review page - the latter is needed.
42-
if (isset($field_info["submission_value"]) || is_null($field_info["submission_value"])) {
42+
43+
// hide password
44+
if($field_type_info["field_type_identifier"] == "password")
45+
echo "********";
46+
else if (isset($field_info["submission_value"]) || is_null($field_info["submission_value"])) {
4347
echo $field_info["submission_value"];
4448
} else {
4549
echo $field_info["submission_info"]["value"];
@@ -51,14 +55,17 @@ function smarty_function_edit_custom_field($params, &$smarty)
5155
}
5256

5357
// now construct all available placeholders
58+
// note that we don't send the encrypted value of password, instead "********" is sent
5459
$placeholders = array(
5560
"FORM_ID" => $form_id,
5661
"VIEW_ID" => $field_info["view_id"],
5762
"SUBMISSION_ID" => $submission_id,
5863
"FIELD_ID" => $field_info["field_id"],
5964
"NAME" => $field_info["field_name"],
6065
"COLNAME" => $field_info["col_name"],
61-
"VALUE" => isset($field_info["submission_value"]) ? $field_info["submission_value"] : "",
66+
"VALUE" => $curr_field_type["field_type_identifier"] != "password" ?
67+
(isset($field_info["submission_value"]) ? $field_info["submission_value"] : "")
68+
: "********",
6269
"SETTINGS" => $settings,
6370
"CONTEXTPAGE" => "edit_submission",
6471
"ACCOUNT_INFO" => Sessions::getWithFallback("account", array()),

0 commit comments

Comments
 (0)