/
account.py
36 lines (31 loc) · 923 Bytes
/
account.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
from twisted.web import resource
import settings
import sessions
import header
import footer
import usersModule
class Main(resource.Resource):
isLeaf = True
def render(self, request):
activeUser = sessions.manager.getUserId(request)
html = ''
html += '<html>'
html += '<body>'
html += '<center>'
html += header.Main(request)
if activeUser == 0:
html += '<table>'
html += '<tr>'
html += '<td bgcolor="#FF0000">'
html += 'User only area'
html += '</td>'
html += '</tr>'
html += '</table>'
else:
user = usersModule.getInfo(activeUser)
html += 'Registration date: %s' % settings.convertTimestamp(float(user[3]))
html += footer.Main()
html += '</center>'
html += '</body>'
html += '</html>'
return html