forked from mviewer/mviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwho
More file actions
executable file
·25 lines (25 loc) · 702 Bytes
/
who
File metadata and controls
executable file
·25 lines (25 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import cgi,os,json
user = ""
email = ""
roles = ""
proxy= "false"
try:
if os.environ['HTTP_SEC_PROXY']:
proxy="true"
try:
if os.environ['HTTP_SEC_USERNAME']:
user=os.environ['HTTP_SEC_USERNAME']
if os.environ['HTTP_SEC_EMAIL']:
email=os.environ['HTTP_SEC_EMAIL']
if os.environ['HTTP_SEC_ROLES']:
roles=os.environ['HTTP_SEC_ROLES']
except KeyError:
pass
except KeyError:
pass
print "Content-type: application/json"
print
response={'proxy':proxy,'user':user,'email':email,'roles':roles}
print(json.JSONEncoder().encode(response))