#103 svn - fix login.js

closed-wont-fix
nobody
None
5
2011-05-23
2010-02-17
No

This is a patch to a recent checkout from SVN.

Viewing with Firefox 3.5.7, on submission of the login form, a GET
request was generated for a non-existent document, resulting in a 404
error, between the authentication and submission of the form.

This was caused by setting document.location in submit_form(). The DOM
reference document.login.action was, I presume, intended to refer to the
action property of the document.login element (the form element), but
this form also contains an input element named action. Firefox 3.5.7
returns a reference to the element named action which stringifies to
[object HTMLButtonElement]. This results in the query "GET
/ledgersmb/%5Bobject%20HTMLButtonElement%5D?action=login&company=testcompany1
HTTP/1.1" and a 404 error, followed by submission of the form.

With this change, document.properties is not set and submit_form()
explicitly returns true if there is no authentication error, so the form
submission proceeds.

In case setting document.location is required for some browsers,
commented out code remains which uses
document.login.getAttribute('action') instead of document.login.action,
which should avoid the ambiguity between the property action and the
contained element named action.

Discussion

  • Chris Travers

    Chris Travers - 2011-05-23
    • status: open --> closed-wont-fix
     
  • Chris Travers

    Chris Travers - 2011-05-23

    I am double checking this, but most of the testing was done via Firefox including 3.5.x. The issue might have been something different that was previously corrected in a different way. There was a past issue where we made the decision to throw 404 errors if the company wasn't found. We have since changed that to a different HTTP error code. I am going to close this patch for now as wont-fix because it isn't clear to me if this is still in reference to a valid issue, and it is not one I have seen.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks