Exemple #1
0
 def get(self):
     o = self.response.out
     common.header(o, 'Ghilbert home')
     userobj = self.userobj
     if userobj is not None:
         template = 'FrontPageLogged'
     else:
         template = 'FrontPage'
     content = gitcontent.get_wiki_html(template)
     if content is None: content = '[wiki template for ' + template + ' is missing]'
     o.write(content)
Exemple #2
0
 def get(self):
     o = self.response.out
     common.header(o, 'Ghilbert home')
     o.write('<div id="text-body">')
     userobj = self.userobj
     if userobj is not None:
         template = 'FrontPageLogged'
     else:
         template = 'FrontPage'
     content = gitcontent.get_wiki_html(template)
     if content is None:
         content = '[wiki template for ' + template + ' is missing]'
     o.write(content)
Exemple #3
0
    def serve_createaccount(self):
        o = self.response.out
        common.header(o, 'Create account')
        invitecode = self.request.get('invite')
        entropy = binascii.b2a_base64(os.urandom(18))
        o.write('''<form method="post" action="/account/create">\n
<div>Username: <input type="text" name="username"></div>
<div>Password: <input type="password" name="password"></div>
<div>Password again: <input type="password" name="password2"></div>
<div>Git identity: <input type="text" name="identity"></div>
<input type="hidden" name="invite" value="%s">
<input type="submit" value="Create">
''' % urllib.quote(invitecode))
        templ = gitcontent.get_wiki_html('CreateAccountTempl')
        if templ is None:
            templ = "[Warning: CreateAccountTempl is missing]"
        o.write(templ.replace('$entropy', entropy))
Exemple #4
0
    def serve_createaccount(self):
        o = self.response.out
        common.header(o, 'Create account')
        invitecode = self.request.get('invite')
        entropy = binascii.b2a_base64(os.urandom(18))
        o.write('''<form method="post" action="/account/create">\n
<div>Username: <input type="text" name="username"></div>
<div>Password: <input type="password" name="password"></div>
<div>Password again: <input type="password" name="password2"></div>
<div>Git identity: <input type="text" name="identity"></div>
<input type="hidden" name="invite" value="%s">
<input type="submit" value="Create">
''' % urllib.quote(invitecode))
        templ = gitcontent.get_wiki_html('CreateAccountTempl')
        if templ is None:
            templ = "[Warning: CreateAccountTempl is missing]"
        o.write(templ.replace('$entropy', entropy))