summaryrefslogtreecommitdiffstats
path: root/lavalab-gen.py
diff options
context:
space:
mode:
authorkhilman <khilman@users.noreply.github.com>2018-01-25 11:52:03 -0800
committerGitHub <noreply@github.com>2018-01-25 11:52:03 -0800
commit3177c39ace236c22bf7d29ebac13e0b73f4ae39f (patch)
tree8ba7d5048778d8335c4444584d68ca96e352266a /lavalab-gen.py
parentf14d69b382978069321acdec9a434ca85ac137da (diff)
parent01f55d2fd3ea0e9620bb631dd91e475444393099 (diff)
Merge pull request #14 from montjoie/stafftokens
Permit to create staff/superuser users
Diffstat (limited to 'lavalab-gen.py')
-rwxr-xr-xlavalab-gen.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py
index 64a4b0b..e5f5db0 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -120,7 +120,16 @@ def main(args):
ftok.write("TOKEN=" + token + "\n")
if user.has_key("password"):
password = user["password"]
- ftok.write("PASSWORD=" + password)
+ ftok.write("PASSWORD=" + password + "\n")
+ # libyaml convert yes/no to true/false...
+ if user.has_key("staff"):
+ value = user["staff"]
+ if value is True:
+ ftok.write("STAFF=1\n")
+ if user.has_key("superuser"):
+ value = user["superuser"]
+ if value is True:
+ ftok.write("SUPERUSER=1\n")
ftok.close()
if section_name == "callback_tokens":
for token in section: