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

« back to all changes in this revision

Viewing changes to lib/common/user.py

  • Committer: mattgiuca
  • Date: 2008-02-25 05:16:32 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:575
common/usr, common/db: Added field to User, "local_password",
    a boolean which is True if the user has a local password.
    db getuser puts this into the user.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
))
33
33
user_fields_list = (
34
34
    "login", "state", "unixid", "email", "nick", "fullname",
35
 
    "role", "studentid", "acct_exp", "pass_exp", "svn_pass"
 
35
    "role", "studentid", "acct_exp", "pass_exp", "svn_pass",
 
36
    "local_password"
36
37
)
37
38
# Fields not included: passhash, last_login
38
39
 
51
52
        # XXX Will ignore unknown fields instead of erroring
52
53
        if "rolenm" in kwargs and "role" not in kwargs:
53
54
            kwargs['role'] = common.caps.Role(kwargs['rolenm'])
54
 
            del kwargs['rolenm']
 
55
        if "passhash" in kwargs and "local_password" not in kwargs:
 
56
            kwargs['local_password'] = kwargs['passhash'] is not None
55
57
        for r in user_fields_list:
56
58
            if r in kwargs:
57
59
                self.__setattr__(r, kwargs[r])