* 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:09:58 +00:00
parent 7099d009f4
commit 00a29c8f13

View File

@ -1272,6 +1272,8 @@ class etemplate extends boetemplate
case 'hidden':
case 'passwd':
case 'text': // size: [length][,maxLength[,preg[,html5type]]]
$autocompletion_off='';
if ($type == 'passwd') $autocompletion_off='autocomplete="off"';
$cell_opts = $c = self::csv_split($cell_options); // allows to enclose preg in quote to allow comma
// fix preg, in case it contains a comma (html5type is only letters and always last option!)
if (count($cell_opts) > 3 && ($cell_opts2 = explode(',',$cell_options)) && $cell_opts2[2][0] != '"')
@ -1293,7 +1295,7 @@ class etemplate extends boetemplate
{
if ($cell_opts[0] < 0) $cell_opts[0] = abs($cell_opts[0]);
$html .= html::input($form_name,$value,$type == 'passwd' ? 'password' : ($type == 'hidden' ? 'hidden' : $cell_opts[3]),
$options.html::formatOptions($cell_opts,'SIZE,MAXLENGTH').($cell['needed']?' required="required"':''));
$options.html::formatOptions($cell_opts,'SIZE,MAXLENGTH').($cell['needed']?' required="required"':'').($autocompletion_off?' '.$autocompletion_off:''));
if (!$readonly)
{