Menu

#3 Adjust to new login procedure of MW 1.15.3

open
nobody
None
5
2010-05-05
2010-05-05
vochl
No

Version 1.15.3 needs addition confirmation for login by resubmitting token received.
See http://www.mediawiki.org/wiki/API:Login

Else login is not possible for this and higher versions.

Discussion

  • vochl

    vochl - 2010-05-09

    I did a patch. No warranty that it does work neither that it may break anything else. ;)

     
  • Zephaniah E. Loss-Cutler-Hull

    Can you please do a unified diff for this?

    I'd like to try and get a new release rolled in the next week or so, but by brain doesn't read that diff format very well and patch refuses to even try.

     
  • vochl

    vochl - 2010-05-12

    patch for login

     
  • vochl

    vochl - 2010-05-12

    Sure. Sorry, I didn't know which to do, so I just took the default one.

    New release sounds great. :)

    The patch is working for me. But at least the follow redirect part really needs an enhancement.

     
  • Zephaniah E. Loss-Cutler-Hull

    This is failing for older versions of mediawiki.

    Do you have a 1.15.3 wiki install that I could get an account on for testing purposes?
    (I'd rather not just bang at wikipedia for example.)

     
  • Zephaniah E. Loss-Cutler-Hull

    This has been fixed in SVN.

    Thank you for the patch, I had to make some changes to allow things to function properly on older versions of MediaWiki, but it seems to work on both old and new versions now.

    Please test current SVN trunk.

     
  • vochl

    vochl - 2010-05-13

    I'm testing in the sandbox of a productive wiki, which is probably not the best idea to do.

    It's working on the new one, good job done! :)

    Still I have one request: If it doesn't break the old login please move the
    line 59 self.login_page += "&action=submit"
    further down somewhere between line 111 and 121

    The action is not needed imho for getting the token at that stage. Only later on for the real submit.
    The script was doing fine, but when I logged my browser communication it was taking me to the edit of the main page, which is a bit scary to me. :)

     
  • vochl

    vochl - 2010-05-13

    I just found something that I accidentally left in my patch (localized version of wpLoginattempt). I changed that back and moved the action. See file below. Please test the login on an old version again.

     
  • vochl

    vochl - 2010-05-13

    some minor changes

     
  • Zephaniah E. Loss-Cutler-Hull

    What is the reason for the change to wpLoginattempt in your most recent patch? The old value appears to work for both new and old versions of the Wiki.

    I will commit the comment change, and a slightly different handling of the action=submit case, we can't do a += to the actual variable in getCookieString since getCookieString may be called multiple times for the same object.

     
  • vochl

    vochl - 2010-05-25

    I just wanted to change it back, because it was left from a test unintentional in the first patch. It's more consistent (and maybe safer) to use the English version, although it shouldn't make any difference.

    You are right with the login_page string, I overlooked that. If I see it right, it's not used anywhere else yet. In that case I would suggest to leave the action out of that variable and add it to the string later in place, either just once or as own variable.

    Best

     

Log in to post a comment.