#741 (ok 4.0) Refactoring for user_password.php file

closed-fixed
None
1
2013-05-09
2012-04-07
No

I have done some code refactoring for user_password.php file. not for the whole script, some part has been done refactoring.

Discussion

1 2 > >> (Page 1 of 2)
  • Marc Delisle

    Marc Delisle - 2012-04-07
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2012-04-07

    Before I comment about the code, here is one test I did, that had a problem:

    1. log in as an unprivileged user
    2. click on Change password
    3. the panel opens, I enter a new password twice and click on Go
    4. the message Loading appears and the panel stays there

     
  • Thilina Abeyrathna

    Ok Marc, May be I missed that. I'll look at that error. while I'm reproducing the patch can you give me some feedback about previous refactoring.

     
  • Marc Delisle

    Marc Delisle - 2012-04-09

    In general, I find your refactoring quite good. Suggestions for now:

    - put all functions at the end of script
    - abbreviate less, or at least the same way (instead of Pass use Password)
    - improve naming of functions that do more than one thing, for example PMA_ChangePassUrlParams()

     
  • Thilina Abeyrathna

    Hi Marc,
    Thank you very much for your feedback and suggestions, Next time I'll definitely follow these.

     
  • Marc Delisle

    Marc Delisle - 2012-04-09

    Thilina,
    can I expect another patch with at least the bug fixed?

     
  • Thilina Abeyrathna

    Marc,
    I'm trying to fixed that bug.

     
  • Thilina Abeyrathna

    I have updated the patch.

     
  • Marc Delisle

    Marc Delisle - 2012-04-10

    The bug about the Loading message is fixed.

    I found another one: when the user clicks on "No password", the message about password being empty should not be displayed.

     
  • Thilina Abeyrathna

    Hi Marc,
    I have updated the patch file.

     
  • Marc Delisle

    Marc Delisle - 2012-04-10

    Hi Thilina,
    The bugs are fixed. I see some improvements you could do; do you see them?

    If not, I plan to merge your patch to origin/master (with yourself as the author) and do the improvements myself.

     
  • Thilina Abeyrathna

    Hi Marc,
    I'm looking my code, and try to find improvements, But still I couldn't found one, Is there any improvements in main if condition?

     
  • Marc Delisle

    Marc Delisle - 2012-04-10

    Hi Thilina,
    examples of improvement:
    - Message "The profile has been updated." is twice in a very short span of code
    - $is_error should have a more neutral name because it's not always for an error
    - no need for $no_password because it only depends on one request variable; so verify directly the request variable inside the function
    - variable $succesMessage should be renamed, for example $successMessage

     
  • Thilina Abeyrathna

    Thanks Marc, I'll do these improvements.

     
  • Thilina Abeyrathna

    Hi Marc,
    I have updated the patch. I have implemented what you mentioned earlier.

     
  • Rouslan Placella

    IIRC, some time ago we decided not to use the @uses tags in function comments

     
  • Rouslan Placella

    Also, PMA_changePassDisplayPage() is missing the @param tags and all other @param tags are missing comments

     
  • Thilina Abeyrathna

    Hi,
    I have updated the patch by removing the @uses tags.

     
1 2 > >> (Page 1 of 2)

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

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks