Refactor login form elements code duplication

Bug #1023834 reported by Ruslan Kabalin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Ruslan Kabalin

Bug Description

All login form elements along with extra login form elements are declared twice, in auth_get_login_form() and auth_generate_login_form() respectively. The differences are really minor, so I suggest to move login form elements generation to separate function, making it less prone to errors.

auth_get_login_form() - used when logged-off user tries to access something different from main page or session has expired.
auth_generate_login_form() - used in side-block on the main page

The auth_get_login_form() version of login form is missing (see attached diff):

* 'defaultvalue' is missing in 'login_username' - can be used, nothing major
* 'login_password' is not regarded as 'required' field here for some reason...
* Register link is not shown - I do not see a reason why it should not be displayed
* Login container is missing 'login' class - can be added, does not break styles

Tags: auth form login
Revision history for this message
Ruslan Kabalin (rkabalin) wrote :
Changed in mahara:
assignee: nobody → Ruslan Kabalin (rkabalin)
status: New → Confirmed
status: Confirmed → Triaged
importance: Undecided → Medium
milestone: none → 1.6.0
tags: added: form login
tags: added: auth
Revision history for this message
Ruslan Kabalin (rkabalin) wrote :

Discovered while fixing bug #1023791

Revision history for this message
Ruslan Kabalin (rkabalin) wrote :
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/1409
Committed: http://gitorious.org/mahara/mahara/commit/eb6d0ab826a7be0f04e1e708fa5bb129c0fc542c
Submitter: Ruslan Kabalin (<email address hidden>)
Branch: master

commit eb6d0ab826a7be0f04e1e708fa5bb129c0fc542c
Author: Ruslan Kabalin <email address hidden>
Date: Thu Jul 12 11:30:20 2012 +0100

    Refactor login form elements (bug #1023834)

    This patch moves form elements array to the separate function.

    Change-Id: I546017bc59d64716d2498a9263c44188fe1274ee
    Signed-off-by: Ruslan Kabalin <email address hidden>

Melissa Draper (melissa)
Changed in mahara:
milestone: 1.6.0 → 1.7.0
status: Triaged → Fix Committed
Aaron Wells (u-aaronw)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.