diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-10-02 16:50:03 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-10-02 16:50:03 +0200 |
commit | eb034e731f610705c10f4b182772183fdefd8e28 (patch) | |
tree | a9e7887df443451bdc133717c225a77a2f0663b8 /module/Api.py | |
parent | purged old plugins (diff) | |
download | pyload-eb034e731f610705c10f4b182772183fdefd8e28.tar.xz |
Diffstat (limited to 'module/Api.py')
-rw-r--r-- | module/Api.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/module/Api.py b/module/Api.py index e3a0dffed..b77cbfb0b 100644 --- a/module/Api.py +++ b/module/Api.py @@ -932,14 +932,23 @@ class Api(Iface): return False + @permission(PERMS.ALL) def getUserData(self, username, password): - """see `checkAuth`""" - return self.checkAuth(username, password) + """similar to `checkAuth` but returns UserData thrift type """ + user = self.checkAuth(username, password) + if user: + return UserData(user["name"], user["email"], user["role"], user["permission"], user["template"]) + else: + return UserData() def getAllUserData(self): """returns all known user and info""" - return self.core.db.getAllUserData() + res = {} + for user, data in self.core.db.getAllUserData().iteritems(): + res[user] = UserData(user, data["email"], data["role"], data["permission"], data["template"]) + + return res @permission(PERMS.STATUS) def getServices(self): |