summaryrefslogtreecommitdiffstats
path: root/pyload/database/UserDatabase.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2014-04-19 15:31:18 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2014-04-19 15:31:41 +0200
commit313bad0316684fed4d1e347ebbb4e42e4e6e49dd (patch)
tree7f215acaa2a70eb36abee66979fe5fbb70592930 /pyload/database/UserDatabase.py
parentUpdated translations (diff)
downloadpyload-313bad0316684fed4d1e347ebbb4e42e4e6e49dd.tar.xz
major bugfix for link and packing adding
Diffstat (limited to 'pyload/database/UserDatabase.py')
-rw-r--r--pyload/database/UserDatabase.py8
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