* Api: use autocomplete=off on all etemplate password fields (not all browsers support that), to avoid filling in wrong passwords while administering

This commit is contained in:
Klaus Leithoff 2012-06-06 15:13:19 +00:00
parent 4b6f5093ab
commit bc0f8b2c57

View File

@ -1214,6 +1214,8 @@ class etemplate extends boetemplate
// fall-through // fall-through
case 'passwd' : case 'passwd' :
case 'text': // size: [length][,maxLength[,preg]] case 'text': // size: [length][,maxLength[,preg]]
$autocompletion_off='';
if ($type == 'passwd') $autocompletion_off='autocomplete="off"';
$cell_opts = explode(',',$cell_options,3); $cell_opts = explode(',',$cell_options,3);
if ($readonly && (int)$cell_opts[0] >= 0) if ($readonly && (int)$cell_opts[0] >= 0)
{ {
@ -1223,7 +1225,7 @@ class etemplate extends boetemplate
{ {
if ($cell_opts[0] < 0) $cell_opts[0] = abs($cell_opts[0]); if ($cell_opts[0] < 0) $cell_opts[0] = abs($cell_opts[0]);
$html .= html::input($form_name,$value,$type == 'passwd' ? 'password' : '', $html .= html::input($form_name,$value,$type == 'passwd' ? 'password' : '',
$options.html::formatOptions($cell_opts,'SIZE,MAXLENGTH')); $options.html::formatOptions($cell_opts,'SIZE,MAXLENGTH').($autocompletion_off?' '.$autocompletion_off:''));
if (!$readonly) if (!$readonly)
{ {