diff options
Diffstat (limited to 'pyload/api')
-rw-r--r-- | pyload/api/DownloadPreparingApi.py | 4 | ||||
-rw-r--r-- | pyload/api/UserApi.py | 41 | ||||
-rw-r--r-- | pyload/api/__init__.py | 2 |
3 files changed, 44 insertions, 3 deletions
diff --git a/pyload/api/DownloadPreparingApi.py b/pyload/api/DownloadPreparingApi.py index 131f73b1d..a7e32c4eb 100644 --- a/pyload/api/DownloadPreparingApi.py +++ b/pyload/api/DownloadPreparingApi.py @@ -44,9 +44,9 @@ class DownloadPreparingApi(ApiComponent): #: TODO: withhold crypter, derypt or add later # initial result does not contain the crypter links - tmp = [(url, LinkStatus(url, url, -1, DS.Queued, pluginname)) for url, pluginname in hoster + crypter] + tmp = [(url, LinkStatus(url, url, -1, DS.Queued, pluginname)) for url, pluginname in hoster] data = parseNames(tmp) - rid = self.core.threadManager.createResultThread(self.primaryUID, data) + rid = self.core.threadManager.createResultThread(self.primaryUID, hoster + crypter) return OnlineCheck(rid, data) diff --git a/pyload/api/UserApi.py b/pyload/api/UserApi.py new file mode 100644 index 000000000..d6fbb2646 --- /dev/null +++ b/pyload/api/UserApi.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from pyload.Api import Api, RequirePerm, Permission + +from ApiComponent import ApiComponent + +class UserApi(ApiComponent): + """ Api methods to retrieve user profile and manage users. """ + + @RequirePerm(Permission.All) + def getUserData(self): + """ Retrieves :class:`UserData` for the currently logged in user. """ + + @RequirePerm(Permission.All) + def setPassword(self, username, old_password, new_password): + """ Changes password for specific user. User can only change their password. + Admins can change every password! """ + + def getAllUserData(self): + """ Retrieves :class:`UserData` of all exisitng users.""" + + def addUser(self, username, password): + """ Adds an user to the db. + + :param username: desired username + :param password: password for authentication + """ + + def updateUserData(self, data): + """ Change parameters of user account. """ + + def removeUser(self, uid): + """ Removes user from the db. + + :param uid: users uid + """ + + +if Api.extend(UserApi): + del UserApi
\ No newline at end of file diff --git a/pyload/api/__init__.py b/pyload/api/__init__.py index bea46011d..a2b292a27 100644 --- a/pyload/api/__init__.py +++ b/pyload/api/__init__.py @@ -1,5 +1,5 @@ __all__ = ["CoreApi", "ConfigApi", "DownloadApi", "DownloadPreparingApi", "FileApi", - "UserInteractionApi", "AccountApi", "AddonApi"] + "UserInteractionApi", "AccountApi", "AddonApi", "UserApi"] # Import all components # from .import * |