Friday, August 26, 2022

Turn Off Autocomplete Login Moodle

Turn Off Autocomplete Login Moodle

Bagaimana cara untuk mematikan autocomplete login form di Moodle? Karena tidak ada fitur Administrator untuk mematikannya, terpaksa Anda harus melakukan hard code. Ada 2 file yang perlu Anda rubah.

  1. Buka file di folder \blocks\login\blocks_login.php, kemudian edit file tersebut.
    
    $this->content->text .= '<div class="form-group">';
    $this->content->text .= '<label for="login_username">'.$strusername.'</label>';
    $this->content->text .= '<input type="text" name="username" id="login_username" ';
    $this->content->text .= ' class="form-control" value="'.s($username).'" autocomplete="username"/></div>'; 
     

    menjadi
    
    $this->content->text .= '<div class="form-group">';
    $this->content->text .= '<label for="login_username">'.$strusername.'</label>';
    $this->content->text .= '<input type="text" name="username" id="login_username" ';
    $this->content->text .= ' class="form-control" value="'.s($username).'" autocomplete="off"/></div>'; 
     
  2. Buka file di folder \lib\templates\loginform.mustache, kemudian edit file tersebut.
    
    <input type="text" name="username" id="username" {{!
    !}}class="form-control form-control-lg" {{!
    !}}value="{{username}}" {{!
    !}}placeholder="{{^canloginbyemail}}{{#cleanstr}}username{{/cleanstr}}{{/canloginbyemail}}{{!
    !}}{{#canloginbyemail}}{{#cleanstr}}usernameemail{{/cleanstr}}{{/canloginbyemail}}" {{!
    !}}autocomplete="username">
     

    menjadi
    
    <input type="text" name="username" id="username" {{!
    !}}class="form-control form-control-lg" {{!
    !}}value="{{username}}" {{!
    !}}placeholder="{{^canloginbyemail}}{{#cleanstr}}username{{/cleanstr}}{{/canloginbyemail}}{{!
    !}}{{#canloginbyemail}}{{#cleanstr}}usernameemail{{/cleanstr}}{{/canloginbyemail}}" {{!
    !}}autocomplete="off">
     

Post a Comment