summaryrefslogtreecommitdiffstats
path: root/module/database/AccountDatabase.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-31 18:32:13 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-31 18:32:13 +0200
commit9ea1ab90b4705ef4d5ce37ded36a214f276c0a18 (patch)
tree995539a44a25c54344639d5ade7aa3e48624ed97 /module/database/AccountDatabase.py
parentadded account page (diff)
downloadpyload-9ea1ab90b4705ef4d5ce37ded36a214f276c0a18.tar.xz
add and delete accounts, db will be resetted
Diffstat (limited to 'module/database/AccountDatabase.py')
-rw-r--r--module/database/AccountDatabase.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/module/database/AccountDatabase.py b/module/database/AccountDatabase.py
index 1602451fa..518674951 100644
--- a/module/database/AccountDatabase.py
+++ b/module/database/AccountDatabase.py
@@ -3,8 +3,8 @@
from module.database import queue, async
from module.database import DatabaseBackend
-class AccountMethods:
+class AccountMethods:
@queue
def loadAccounts(db):
db.c.execute('SELECT plugin, loginname, activated, password, options FROM accounts;')
@@ -12,10 +12,14 @@ class AccountMethods:
@async
def saveAccounts(db, data):
- db.c.executemany('INSERT INTO accounts(plugin, loginname, activated, password, options) VALUES(?,?,?,?,?)', data)
+ # TODO: owner, shared
+
+ db.c.executemany(
+ 'INSERT INTO accounts(plugin, loginname, activated, password, options) VALUES(?,?,?,?,?)', data)
@async
def removeAccount(db, plugin, loginname):
db.c.execute('DELETE FROM accounts WHERE plugin=? AND loginname=?', (plugin, loginname))
+
DatabaseBackend.registerSub(AccountMethods) \ No newline at end of file