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

« back to all changes in this revision

Viewing changes to lib/common/db.py

  • Committer: mattgiuca
  • Date: 2008-02-06 03:02:11 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:428
common.db: Added get_users function to get all users.
listusers.py: New script to print out all user details on the system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
        # Return as a dictionary
150
150
        return result.dictresult()[0]
151
151
 
 
152
    def get_users(self, dry=False):
 
153
        """Returns a list of all users. The list elements are a dictionary of
 
154
        the user's DB fields, excluding the passhash field.
 
155
        """
 
156
        query = ("SELECT login, unixid, nick, fullname, rolenm, studentid "
 
157
            "FROM login")
 
158
        if dry: return query
 
159
        return self.db.query(query).dictresult()
 
160
 
152
161
    def user_authenticate(self, login, password, dry=False):
153
162
        """Performs a password authentication on a user. Returns True if
154
163
        "password" is the correct password for the given login, False