Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
R
redeleitsystem
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
redl
redeleitsystem
Commits
e90f4fe1
Commit
e90f4fe1
authored
Nov 07, 2015
by
Hinrikus Wolf
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.fsmpi.rwth-aachen.de:redl/redeleitsystem
parents
c87c4925
e9d8166d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
server.py
server.py
+3
-10
No files found.
server.py
View file @
e90f4fe1
...
@@ -40,7 +40,7 @@ def addadmin():
...
@@ -40,7 +40,7 @@ def addadmin():
admin_hashed_pw
=
pbkdf2_sha256
.
encrypt
(
admin_pass
,
rounds
=
200000
,
salt_size
=
16
)
admin_hashed_pw
=
pbkdf2_sha256
.
encrypt
(
admin_pass
,
rounds
=
200000
,
salt_size
=
16
)
u
=
User
(
admin_real_name
,
admin_login
,
admin_hashed_pw
,
[
"admin"
,
"user"
])
u
=
User
(
admin_real_name
,
admin_login
,
admin_hashed_pw
,
[
"admin"
,
"user"
])
db
.
session
.
add
(
u
)
db
.
session
.
add
(
u
)
db
.
session
.
commit
(
u
)
db
.
session
.
commit
()
else
:
else
:
print
(
"The provided data was invalid."
)
print
(
"The provided data was invalid."
)
...
@@ -55,19 +55,12 @@ def adduser():
...
@@ -55,19 +55,12 @@ def adduser():
admin_hashed_pw
=
pbkdf2_sha256
.
encrypt
(
admin_pass
,
rounds
=
200000
,
salt_size
=
16
)
admin_hashed_pw
=
pbkdf2_sha256
.
encrypt
(
admin_pass
,
rounds
=
200000
,
salt_size
=
16
)
u
=
User
(
admin_real_name
,
admin_login
,
admin_hashed_pw
,
[
"user"
])
u
=
User
(
admin_real_name
,
admin_login
,
admin_hashed_pw
,
[
"user"
])
db
.
session
.
add
(
u
)
db
.
session
.
add
(
u
)
db
.
session
.
commit
(
u
)
db
.
session
.
commit
()
else
:
else
:
print
(
"The provided data was invalid."
)
print
(
"The provided data was invalid."
)
@
app
.
route
(
"/"
)
@
app
.
route
(
"/"
)
def
index
():
def
index
():
if
not
len
(
db
.
session
.
query
(
User
).
all
())
>
0
:
fullname
=
input
(
"Fullname for admin user:"
)
username
=
input
(
"Username for admin user:"
)
password
=
pbkdf2_sha256
.
encrypt
(
input
(
"Password for admin user:"
),
rounds
=
200000
,
salt_size
=
16
)
user
=
User
(
fullname
,
username
,
password
,
[
"admin"
,
"user"
])
db
.
session
.
add
(
user
)
db
.
session
.
commit
()
topics
=
Topic
.
query
.
all
()
topics
=
Topic
.
query
.
all
()
meta
=
[]
meta
=
[]
for
topic
in
topics
:
for
topic
in
topics
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment