summaryrefslogtreecommitdiffstats
path: root/pyload/setup/Setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/setup/Setup.py')
-rw-r--r--pyload/setup/Setup.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pyload/setup/Setup.py b/pyload/setup/Setup.py
index 63d28852d..1af9f0d1d 100644
--- a/pyload/setup/Setup.py
+++ b/pyload/setup/Setup.py
@@ -27,6 +27,7 @@ from time import time
from sys import exit
+from pyload.Api import Role
from pyload.utils.fs import abspath, dirname, exists, join, makedirs
from pyload.utils import get_console_encoding
from pyload.web.ServerThread import WebServer
@@ -264,7 +265,9 @@ class Setup():
print ""
username = self.ask(_("Username"), "User")
password = self.ask("", "", password=True)
- self.db.addUser(username, password)
+ admin = self.ask("Admin?", self.yes, bool=True)
+
+ self.db.addUser(username, password, Role.Admin if admin else Role.User, 0b1111111)
elif action == "2":
print ""
print _("Users")
@@ -285,10 +288,10 @@ class Setup():
finally:
self.closeDB()
- def addUser(self, username, password):
+ def addUser(self, username, password, role=Role.Admin):
self.openDB()
try:
- self.db.addUser(username, password)
+ self.db.addUser(username, password, role, 0b1111111)
finally:
self.closeDB()