diff options
Diffstat (limited to 'module/AccountManager.py')
-rw-r--r-- | module/AccountManager.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/module/AccountManager.py b/module/AccountManager.py index 5c3c99276..0122b0223 100644 --- a/module/AccountManager.py +++ b/module/AccountManager.py @@ -126,3 +126,30 @@ class AccountManager(): for name in self.core.pluginManager.getAccountPlugins(): self.accounts[name] = {} + #---------------------------------------------------------------------- + def updateAccount(self, plugin , user, password, options): + """add or update account""" + + if self.accounts.has_key(plugin): + p = self.getAccountPlugin(plugin) + p.updateAccounts(user, password, options) + + if self.accounts[plugin].has_key(user): + self.accounts[plugin][user]["password"] = password + self.accounts[plugin][user]["options"] = options + else: + self.accounts[plugin][user] = {"password": password, "options": options} + + self.saveAccounts() + + #---------------------------------------------------------------------- + def removeAccount(self, plugin, user): + """remove account""" + if self.accounts.has_key(plugin): + p = self.getAccountPlugin(plugin) + p.removeAccount(user) + + if self.accounts.has_key(user): + del self.accounts[user] + + self.saveAccounts() |