~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/user.py

  • Committer: Matt Giuca
  • Date: 2009-12-01 04:27:58 UTC
  • mfrom: (1164.2.46 sphinx-docs)
  • Revision ID: matt.giuca@gmail.com-20091201042758-wuxd9bdec00c283i
Merged sphinx-docs branch. This adds Sphinx documentation for the entire IVLE system (for system administrators and developers), and removes all of our random old document files (all either irrelevant, or moved into the Sphinx docs nicely). Currently incomplete, but ready to merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
# (as returned by the get_user action)
29
29
user_fields_list = (
30
30
    "login", "state", "unixid", "email", "nick", "fullname",
31
 
    "rolenm", "studentid", "acct_exp", "pass_exp", "last_login",
 
31
    "admin", "studentid", "acct_exp", "pass_exp", "last_login",
32
32
    "svn_pass"
33
33
)
34
34
 
54
54
        user['local_password'] = self.context.passhash is not None
55
55
        return user
56
56
 
57
 
    @require_permission('edit')
58
 
    def PATCH(self, req, data):
59
 
        # XXX Admins can set extra fields
60
 
        # Note: Cannot change password here (use change_password named op)
61
 
 
62
 
        for f in user_fields_list:
63
 
            try:
64
 
                field = data[f]
65
 
                if isinstance(field, str):
66
 
                    field = unicode(field)
67
 
                setattr(self.context, f, field)
68
 
            except KeyError:
69
 
                continue
70
 
 
71
57
class UserSettingsView(XHTMLView):
72
 
    template = 'user-settings.html'
73
 
    appname = 'settings'
 
58
    template = 'templates/user-settings.html'
 
59
    tab = 'settings'
74
60
    permission = 'edit'
75
61
 
76
62
    def __init__(self, req, login):
80
66
 
81
67
    def populate(self, req, ctx):
82
68
        self.plugin_scripts[Plugin] = ['settings.js']
83
 
        req.scripts_init = ['revert_settings']
 
69
        self.scripts_init = ['revert_settings']
84
70
 
85
71
        ctx['login'] = self.context.login
86
72