Skip to content

Commit f18496a

Browse files
committed
formtools/module-submission_accounts#11 enabling encryption of passwords
1 parent 1b7771d commit f18496a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

global/code/field_types/Password.class.php

+12-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,20 @@
77
class Password
88
{
99

10+
private static function getPhpProcessing()
11+
{
12+
$content =<<< END
13+
\$field_name = \$vars["field_info"]["field_name"];
14+
\$password = \$vars["data"][\$field_name];
15+
\$encryptedPassword = \$General.encode(\$password);
16+
return \$encryptedPassword;
17+
END;
18+
return $content;
19+
}
1020
public static function get()
1121
{
1222
$password_edit_field =<<< END
13-
<input type="password" name="{\$NAME}" value="{\$VALUE|escape}" class="cf_password" />
23+
<input type="password" name="{\$NAME}" value="{\$VALUE|escape}" class="cf_password" placeholder="password"/>
1424
{if \$comments}
1525
<div class="cf_field_comments">{\$comments}</div>
1626
{/if}
@@ -33,7 +43,7 @@ public static function get()
3343
"view_field_php_function" => "",
3444
"view_field_smarty_markup" => "",
3545
"edit_field_smarty_markup" => $password_edit_field,
36-
"php_processing" => "",
46+
"php_processing" => getPhpProcessing(),
3747
"resources_css" => "input.cf_password {\r\n width: 120px;\r\n}",
3848
"resources_js" => ""
3949
),

0 commit comments

Comments
 (0)