diff options
Diffstat (limited to 'pyload/database/UserDatabase.py')
-rw-r--r-- | pyload/database/UserDatabase.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pyload/database/UserDatabase.py b/pyload/database/UserDatabase.py index 65f46169e..8846d194d 100644 --- a/pyload/database/UserDatabase.py +++ b/pyload/database/UserDatabase.py @@ -55,7 +55,7 @@ class UserMethods(DatabaseMethods): pass @queue - def getUserData(self, name=None, uid=None): + def getUserData(self, name=None, uid=None, role=None): qry = ('SELECT uid, name, email, role, permission, folder, traffic, dllimit, dlquota, ' 'hddquota, user, template FROM "users" WHERE ') @@ -71,6 +71,12 @@ class UserMethods(DatabaseMethods): if r: return UserData(*r) + elif role is not None: + self.c.execute(qry + "role=?", (role,)) + r = self.c.fetchone() + if r: + return UserData(*r) + return None @queue |