-
Notifications
You must be signed in to change notification settings - Fork 4
/
blcreate.py
44 lines (37 loc) · 1.68 KB
/
blcreate.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/python
import os
import cgi
import cgitb
cgitb.enable()
user=os.environ.get("HTTP_COOKIE")
if user:
print "Content-type: text/html\n\n"
print "<html>"
print "<head>"
print "<title>SRMS Cloud Services</title>"
print "<script type='text/javascript'>"
print "window.history.forward(1);"
print "function noBack(){ window.history.forward();}"
print "</script>"
print "</head>"
print "<body onload='noBack();' onpageshow='if (event.persisted)noBack();' onunload=''>"
print "<div id='header' style='height:75px; background-color:orange;'>"
print "<span style='font-size:30px;'><center>SRMS CLOUD SERVICES</center></span><span style='margin-left:700px;margin-top:-1px'>"+user+" <a href='logout.py'>Logout</a></span>"
print "</div>"
print "<div id='body'>"
print "<div id='body1'>"
print "<h2><center>BLOCK STORAGE AS A SERVICE</center></h2><br/>"
print "<h3><center>Create Drive</center></h3>"
print "<p id='Storage Flavours'><center>Your Available Storage Flavours</center></p><br/><br/>"
print "<form id='block' method='post' action='/cgi-bin/blserver.py'><center>"
print "<input type='radio' id='block' name='block' value='flavour1'>Flavour 1: 3 GiB Storage Space</input><br/><br/>"
print "<input type='radio' id='block' name='block' value='flavour2'>Flavour 2: 5 GiB Storage Space</input><br/><br/>"
print "<input type='radio' id='block' name='block' value='flavour3'>Flavour 3: 8 GiB Storage Space</input><br/><br/>"
print "<input type='submit' name='Submit' value='Submit' /></input><br/><br/>"
print "</center></form>"
print "</body>"
print "</html>"
else :
print "Status: 303 See other"
print "Location: http://192.168.0.100"
print ""