Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
0237cd61
Commit
0237cd61
authored
Oct 29, 2013
by
Jean Michel Rouly
Browse files
Added application page.
parent
7384b89b
Changes
1
Hide whitespace changes
Inline
Side-by-side
wsgi/apply.py
0 → 100644
View file @
0237cd61
import
ldap
import
site
site
.
addsitedir
(
'/srv/http/go/wsgi'
)
import
library
import
goconfig
def
application
(
environ
,
start_response
):
# Construct the default body, along with its header/footer wrapper.
body
=
[]
f
=
open
(
goconfig
.
doc_root
+
"/site_data/top.part"
,
"r"
)
top_part
=
f
.
read
()
f
.
close
()
f
=
open
(
goconfig
.
doc_root
+
"/site_data/bottom.part"
,
"r"
)
bottom_part
=
f
.
read
()
f
.
close
()
apply_form
=
"""
<form action="" method="post">
<p>This form allows you to apply for registered access to the George
Mason Student-Run Computing and Technology's Go URL shortening
service. Access to this computing resource is governed by the <a
href="http://srct.gmu.edu/usage-policy">SRCT Usage Policy</a>.
Submitting an application indicates implicit acceptance of these
terms. Misuse of this service will be handled strictly.</p>
<br />
<label for="usr">username</label>
<br /><br />
<input type="text" id="usr" name="usr" value="" />
<br /><br />
<label for="pass">password</label>
<br /><br />
<input type="password" id="pass" name="pass" value="" />
<br /><br />
<input type="submit" name="submit" value="LOGIN" />
<br /><br />
</form>
"""
body
.
append
(
apply_form
)
body
=
''
.
join
(
body
)
response
=
top_part
+
body
+
bottom_part
status
=
'200 OK'
response_headers
=
[(
'Content-type'
,
'text/html'
),
(
'Content-Length'
,
str
(
len
(
response
)))]
start_response
(
status
,
response_headers
)
return
[
response
]
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