Ignore:
Timestamp:
Dec 1, 2010 6:20:43 AM (2 years ago)
Author:
alec
Message:
  • Allow setting autocomplete attribute for all inputs separately (#1487313)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_template.php

    r4257 r4296  
    10461046    { 
    10471047        $default_host = $this->config['default_host']; 
    1048         $attrib['autocomplete'] = $this->config['login_autocomplete'] ? null : 'off'; 
     1048        $autocomplete = (int) $this->config['login_autocomplete']; 
    10491049 
    10501050        $_SESSION['temp'] = true; 
     
    10551055            $url = $_SERVER['QUERY_STRING']; 
    10561056 
    1057         $input_user   = new html_inputfield(array('name' => '_user', 'id' => 'rcmloginuser') + $attrib); 
    1058         $input_pass   = new html_passwordfield(array('name' => '_pass', 'id' => 'rcmloginpwd') + $attrib); 
     1057        // set atocomplete attribute 
     1058        $user_attrib = $autocomplete > 0 ? array() : array('autocomplete' => 'off'); 
     1059        $host_attrib = $autocomplete > 0 ? array() : array('autocomplete' => 'off'); 
     1060        $pass_attrib = $autocomplete > 1 ? array() : array('autocomplete' => 'off'); 
     1061 
    10591062        $input_action = new html_hiddenfield(array('name' => '_action', 'value' => 'login')); 
    10601063        $input_tzone  = new html_hiddenfield(array('name' => '_timezone', 'id' => 'rcmlogintz', 'value' => '_default_')); 
    10611064        $input_url    = new html_hiddenfield(array('name' => '_url', 'id' => 'rcmloginurl', 'value' => $url)); 
     1065        $input_user   = new html_inputfield(array('name' => '_user', 'id' => 'rcmloginuser') 
     1066            + $attrib + $user_attrib); 
     1067        $input_pass   = new html_passwordfield(array('name' => '_pass', 'id' => 'rcmloginpwd') 
     1068            + $attrib + $pass_attrib); 
    10621069        $input_host   = null; 
    10631070 
     
    10811088        } 
    10821089        else if (empty($default_host)) { 
    1083             $input_host = new html_inputfield(array('name' => '_host', 'id' => 'rcmloginhost') + $attrib); 
     1090            $input_host = new html_inputfield(array('name' => '_host', 'id' => 'rcmloginhost') 
     1091                + $attrib + $host_attrib); 
    10841092        } 
    10851093 
Note: See TracChangeset for help on using the changeset viewer.