>You could probably hack around it by using one of the many hooks in the
>page rendering stack to add the JS module on the pages where it's not
>already there, but before doing so it's worth thinking about the reason why
>it was removed in the first place.

Thank you HM. In our case, we are using a script for several purposes (in a 
private wiki behind a firewall):

* Automatically check the "keep me logged in for 30 days" checkbox.

* Remove any trailing "@companyname.com" from the username. Users in our 
company are accustomed to logging in this way on their Windows boxes, and we'd 
get several support calls per week from people who "can't log into the wiki" 
because they were adding @companyname.com onto their wiki usernames.

I wound up using the hook UserLoginForm to inject the JavaScript we need, via 
$wgOut->addScriptFile. The JS is:

  $('#userloginForm form')
    .submit(function(e){
      var
        $input = $('#wpName1', this);
      $input.val($input.val().replace(/@.*$/, ''));
    })
    .find('#wpRemember')
      .attr('checked', 'checked')
      .end()
    .find('#wpName1:not([value]), #wpPassword1')
      .eq(0)
        .focus();

Is there a more secure way to do what we need on the login page (without 
modifying core code)?

Thanks,
DanB

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to