mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
add allowed users setting for current students, replace all user stuff with user dict, add beginning of vnc cleanup
This commit is contained in:
parent
6d71f49a7a
commit
7aadd423e7
10 changed files with 195 additions and 97 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import string
|
||||
import random
|
||||
from proxstar.db import *
|
||||
|
||||
|
||||
def gen_password(
|
||||
|
|
@ -8,3 +9,11 @@ def gen_password(
|
|||
):
|
||||
# use secrets module once this works in python 3.6
|
||||
return ''.join(random.choice(charset) for x in range(length))
|
||||
|
||||
|
||||
def build_user_dict(session, db):
|
||||
user_dict = dict()
|
||||
user_dict['username'] = session['userinfo']['preferred_username']
|
||||
user_dict['active'] = 'active' in session['userinfo']['groups'] or user_dict['username'] in get_allowed_users(db)
|
||||
user_dict['rtp'] = 'rtp' in session['userinfo']['groups']
|
||||
return user_dict
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue