1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Turn off auto-complete on admin -> users -> add new

This commit is contained in:
Cameron 2013-04-15 14:06:15 -07:00
parent 96e7f8e777
commit b1b5cf5808
2 changed files with 35 additions and 12 deletions

View File

@ -1207,7 +1207,7 @@ class users_admin_ui extends e_admin_ui
$this->addTitle(LAN_USER_QUICKADD);
$text = "<div>".$frm->open("core-user-adduser-form")."
$text = "<div>".$frm->open("core-user-adduser-form",null,null,'autocomplete=0')."
<fieldset id='core-user-adduser'>
<table class='table adminform'>
<colgroup>

View File

@ -104,18 +104,24 @@ class e_form
$method = "post";
}
$class = "";
$class = "";
$autoComplete = "";
parse_str($options,$options);
$target = str_replace("&", "&amp;", $target);
if(vartrue($options['class']))
{
$class = "class='".$options['class']."'";
}
$text = "\n<form {$class} action='{$target}' id='".$this->name2id($name)."' method = '{$method}'>\n";
if(isset($options['autocomplete'])) // leave as isset()
{
$autoComplete = " autocomplete='".($options['autocomplete'] ? 'on' : 'off')."'";
}
$text = "\n<form {$class} action='{$target}' id='".$this->name2id($name)."' method = '{$method}'{$autoComplete}>\n";
if($method == 'get' && strpos($target,'='))
{
@ -189,6 +195,11 @@ class e_form
parse_str($options,$options);
}
if(!vartrue($options['class']))
{
$options['class'] = "tbox";
}
/*
if(!vartrue($options['class']))
{
@ -1722,18 +1733,30 @@ class e_form
* @param array|string $user_options
* @return array merged options
*/
function format_options($type, $name, $user_options)
function format_options($type, $name, $user_options=null)
{
if(is_string($user_options)) parse_str($user_options, $user_options);
$def_options = $this->_default_options($type);
foreach (array_keys($user_options) as $key)
if(is_string($user_options))
{
if(!isset($def_options[$key]) && substr($key,0,5)!='data-') unset($user_options[$key]); // data-xxxx exempt //remove it?
parse_str($user_options, $user_options);
}
$user_options['name'] = $name; //required for some of the automated tasks
$def_options = $this->_default_options($type);
if(is_array($user_options))
{
$user_options['name'] = $name; //required for some of the automated tasks
foreach (array_keys($user_options) as $key)
{
if(!isset($def_options[$key]) && substr($key,0,5)!='data-') unset($user_options[$key]); // data-xxxx exempt //remove it?
}
}
else
{
$user_options = array('name' => $name); //required for some of the automated tasks
}
return array_merge($def_options, $user_options);
}