"""
This is a simple plugin, that adds a "UserPreferences" action.
This action will display the UserPreferences page (or appropriate
page in the reader's language), so that the user can login, or
change his/her preferences.

However, as it is an action, the page that is displayed is not 
changed. After submitting the form, the user is presented the
same page he/she was seeing before, and the trail is not modified.

To install this plugin, copy it into <data_dir>/data/plugin/action/
dicrectory, where <data_dir> is the same as you set as data_dir in
your wiki configuration.

This code is public domain.
"""

from MoinMoin import wikiutil

def execute(pagename, request):
    page = wikiutil.getSysPage(request, 'UserPreferences')
    request.http_headers()
    page.send_page(request)
