Basic support for theming logged-out users

Bug #1001064 reported by Richard Mansfield
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Wishlist
Richard Mansfield

Bug Description

Some custom sites wish to allow logged-out users to be able to change their themes, and have those themes saved during registration. There are a few things that can be done to make this easier:

- let user preferences be saved in the session only, rather than in the database
- add some local hooks for updating themes when a page is initialised
- add local hooks to allow any logged-out user preferences to be saved during registration, while waiting for email confirmation or institution approval.

tags: added: newfeature1.6
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/1223
Committed: http://gitorious.org/mahara/mahara/commit/17f71278297c35596f41db2b6658f0ddef1847df
Submitter: Richard Mansfield (<email address hidden>)
Branch: master

commit 17f71278297c35596f41db2b6658f0ddef1847df
Author: Richard Mansfield <email address hidden>
Date: Fri May 18 13:23:29 2012 +1200

    Preserve registration 'extra' values during approval (bug #1001064)

    When approving registration, there is an option to add institution
    staff permission - this property is saved in the 'extra' column of the
    usr_registration table. But if the local registraion submit hook has
    been used to store other properties in this column, they are removed
    during approval. This change ensures the existing properties are left
    in place.

    Change-Id: Icfa57f446e88ecee5213fb4ce6ff4fdb9f780f6a
    Signed-off-by: Richard Mansfield <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/1222
Committed: http://gitorious.org/mahara/mahara/commit/cec0820fd855e744249ba9bf27c3ead15f4eeb8b
Submitter: Richard Mansfield (<email address hidden>)
Branch: master

commit cec0820fd855e744249ba9bf27c3ead15f4eeb8b
Author: Richard Mansfield <email address hidden>
Date: Fri May 18 13:39:05 2012 +1200

    Don't write logged out user preferences to the db (bug #1001064)

    $USER->set_account_preferences() always saves preferences to the
    usr_account_preference table as well as to $USER. Adding a test for
    the user's id means that this function can be safely called on a
    logged-out user.

    Change-Id: Ieab78c5fbf30647dbb5dce10e960afb260c8dd1f
    Signed-off-by: Richard Mansfield <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/1221
Committed: http://gitorious.org/mahara/mahara/commit/5d737aa59691a4f7328a560f3c6438ba71acc8e5
Submitter: Richard Mansfield (<email address hidden>)
Branch: master

commit 5d737aa59691a4f7328a560f3c6438ba71acc8e5
Author: Richard Mansfield <email address hidden>
Date: Mon Nov 7 14:02:24 2011 +1300

    Add local hooks for registration and user initialisation (bug #1001064)

    Three new hooks are added:

    local_init_user() - called after $USER is initialised. This is useful
    for changing the user's theme before $THEME is initialised.

    local_register_submit() - called when the registration form is
    successfully submitted, but before the submitted values are saved to
    usr_registration. This is useful for remembering the properties or
    preferences of the logged-out user when the form was submitted.

    local_post_register() - called after a user has successfully been
    created and logged in during registration. This is useful when
    properties of the user (which may have been saved to usr_registration
    by local_register_submit()) need to be transferred to the newly
    registered user.

    Change-Id: Ifcb19737bdcecb550185624f2fd78e541690a337
    Signed-off-by: Richard Mansfield <email address hidden>

Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

Kristina, this isn't a feature that users will notice, it's just an aid to developers who wish to extend or customise Mahara, so I'm not sure it should have the newfeature tag.

Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Hi Richard,

I think it's a new feature, but it is one that I'll not document in the manual then.

Revision history for this message
Hugh Davenport (hugh-davenport) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 status fixreleased
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iJwEAQECAAYFAlCbHO8ACgkQuMoJ2LQ3zxH8TAP/YN4BiCJZsn5a899/0UzV31Qg
lM8LXAwZWa6zFv6t0BQUHCqe6eFK9wPp51qgCWWXjUZ3vvvVcsyeWp6626aBFKSU
pCQXI9E7huPw802nJQ9WcZXRBUmgw87ww72Tx4mybnu7SPSrkZgXdnPGSMwDs89N
oWvTpl7Xuac48e6p0lU=
=ouU+
-----END PGP SIGNATURE-----

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.