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

« back to all changes in this revision

Viewing changes to lib/common/user.py

  • Committer: dcoles
  • Date: 2008-02-29 02:11:58 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:624
forum: Removed the subsilver2 style and phpBB installer
Modified prosilver theme to be more IVLE integrated
Added db dumps for setup

setup.py: Added config.php generator code

doc/setup/install_proc.txt: New setup/install details

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
# user. Objects of this class are expected to be stored in the request
24
24
# session.
25
25
 
26
 
import db
27
 
import time
28
26
import common.caps
29
27
 
30
28
# Similar to db.login_fields_list but contains a different set of fields.
34
32
))
35
33
user_fields_list = (
36
34
    "login", "state", "unixid", "email", "nick", "fullname",
37
 
    "role", "studentid", "acct_exp", "pass_exp", "last_login",
38
 
    "svn_pass", "local_password",
 
35
    "role", "studentid", "acct_exp", "pass_exp", "svn_pass",
 
36
    "local_password"
39
37
)
40
 
timestamp_fields = frozenset((
41
 
    "acct_exp", "pass_exp", "last_login",
42
 
))
43
38
# Fields not included: passhash, last_login
44
39
 
45
40
class UserException(Exception):
75
70
                            "'fullname' missing")
76
71
                else:
77
72
                    self.__setattr__(r, None)
78
 
        for field in timestamp_fields:
79
 
            # Convert all timestamp fields from strings to Timestamp objects
80
 
            if hasattr(self, field):
81
 
                val = self.__getattribute__(field)
82
 
                if val is not None:
83
 
                    val = time.strptime(val, db.TIMESTAMP_FORMAT)
84
 
                    self.__setattr__(field, val)
85
 
 
86
73
    def __repr__(self):
87
74
        items = ["%s=%s" % (r, repr(self.__getattribute__(r)))
88
75
            for r in user_fields_list]