From 233f0374fb69c5d6867398e0c87c5ecb5b9e28ac Mon Sep 17 00:00:00 2001 From: Antoine Millet Date: Mon, 27 Dec 2010 11:54:17 +0100 Subject: [PATCH] Added account management methods to the client handler. --- ccserver/handlers.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/ccserver/handlers.py b/ccserver/handlers.py index f284f56..b6203d4 100644 --- a/ccserver/handlers.py +++ b/ccserver/handlers.py @@ -170,7 +170,43 @@ class ClientHandler(OnlineCCHandler): @pure @listed + def account_setpassword(self, login, password, method='ssha'): + ''' + Define a new password for specified user. + ''' + self._server.conf.set_password(login, password, method) + @pure + @listed + def account_create(self, login, password, role): + ''' + Create a new account with specified login. + ''' + self._server.conf.create_account(login, password, role) + + @pure + @listed + def account_addtag(self, login, tag): + ''' + Add a tag to the account with specified login. + ''' + self._server.conf.add_tag(login, tag) + + @pure + @listed + def account_removetag(self, login, tag): + ''' + Remove a tag of the account with specified login. + ''' + self._server.conf.remove_tag(login, tag) + + @pure + @listed + def account_delete(self, login): + ''' + Delete the account with specified login. + ''' + self._server.conf.remove_account(login) class AuthenticationError(Exception): pass -- GitLab