def session(self): try: conn = get_xmlrpc_connection() except: webinfo.response.status = "302 Found" webinfo.response.headers['location'] = 'login' return '' return Template('application').render(webinfo=webinfo, conn=conn)
def list(self): try: conn = get_xmlrpc_connection() except: webinfo.response.status = "302 Found" webinfo.response.headers['location'] = '/user/login' return '' return Template('akill-list').render(webinfo=webinfo, conn=conn)
def write(self, to=''): try: conn = get_xmlrpc_connection() except: webinfo.response.status = "302 Found" webinfo.response.headers['location'] = '/user/login' return '' return Template('memowrite').render(webinfo=webinfo, conn=conn, to=to)
def ignore_add(self): try: conn = get_xmlrpc_connection() except: webinfo.response.status = "302 Found" webinfo.response.headers['location'] = '/user/login' return '' return Template('memoignoreadd').render(webinfo=webinfo, conn=conn)
def forward_commit(self, to, message_id): try: conn = get_xmlrpc_connection() except: webinfo.response.status = "302 Found" webinfo.response.headers['location'] = '/user/login' return '' conn.memoserv.forward(to, message_id) return Template('memosent').render(webinfo=webinfo, conn=conn, to=to)
def settings(self, channel): try: conn = get_xmlrpc_connection() except: webinfo.response.status = "302 Found" webinfo.response.headers['location'] = '/user/login' return '' return Template('channeleditsettings').render(webinfo=webinfo, conn=conn, channel=channel)
def forward(self, id, to=''): try: conn = get_xmlrpc_connection() except: webinfo.response.status = "302 Found" webinfo.response.headers['location'] = '/user/login' return '' return Template('memoforward').render(webinfo=webinfo, conn=conn, message_id=id, to=to)
def delete_confirm(self, id): try: conn = get_xmlrpc_connection() except: webinfo.response.status = "302 Found" webinfo.response.headers['location'] = '/user/login' return '' conn.memoserv.delete(id) return Template('memodeleted').render(webinfo=webinfo, conn=conn, id=id)
def request_vhost(self, vhost): try: conn = get_xmlrpc_connection() except: webinfo.response.status = "302 Found" webinfo.response.headers['location'] = 'login' return '' conn.hostserv.request(vhost) webinfo.response.headers['refresh'] = '5; URL=account' return Template('genericmessage').render( webinfo=webinfo, conn=conn, message='Your vHost %s has been requested' % vhost)
def update_email(self, new_email): try: conn = get_xmlrpc_connection() except: webinfo.response.status = "302 Found" webinfo.response.headers['location'] = 'login' return '' conn.nickserv.set_email(new_email) webinfo.response.headers['refresh'] = '5; URL=account' return Template('genericmessage').render( webinfo=webinfo, conn=conn, message='Your e-mail has been set to %s' % new_email)
def process_registration(self, nickname, password, email): message = '' conn = AthemeXMLConnection(XMLRPC_PATH) message = conn.register(nickname, password, email) # try: # except: # webinfo.response.status = "302 Found" # webinfo.response.headers['location'] = 'register' # return '' webinfo.response.headers['location'] = 'account' return Template('regmessage').render(webinfo=webinfo, conn=conn, message=message)
def register(self): return Template('userreg').render()
def login(self): return Template('userlogin').render()