示例#1
0
def get_xmlrpc_connection():
    sessiondata = webinfo.environ['paste.session.factory']()
    conn = AthemeXMLConnection(XMLRPC_PATH, webinfo.environ['REMOTE_ADDR'])
    conn.username = sessiondata['conn.username']
    conn.authcookie = sessiondata['conn.authcookie']

    return conn
示例#2
0
def get_xmlrpc_connection():
	sessiondata = webinfo.environ['paste.session.factory']()
	conn = AthemeXMLConnection(XMLRPC_PATH, webinfo.environ['REMOTE_ADDR'])
	conn.username = sessiondata['conn.username']
	conn.authcookie = sessiondata['conn.authcookie']

	return conn
示例#3
0
    def process_login(self, nickname, password):
        webinfo.response.status = "302 Found"
        try:
            conn = AthemeXMLConnection(XMLRPC_PATH)
            conn.login(nickname, password)
        except:
            webinfo.response.headers['location'] = 'login'
            return ''

        webinfo.response.headers['location'] = 'session'
        sessiondata = webinfo.environ['paste.session.factory']()
        sessiondata['conn.username'] = conn.username
        sessiondata['conn.authcookie'] = conn.authcookie
        return ''
示例#4
0
	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)
示例#5
0
	def process_login(self, nickname, password):
		webinfo.response.status = "302 Found"
		try:
			conn = AthemeXMLConnection(XMLRPC_PATH)
			conn.login(nickname, password)
		except:
			webinfo.response.headers['location'] = 'login'
			return ''

		webinfo.response.headers['location'] = 'session'
		sessiondata = webinfo.environ['paste.session.factory']()
		sessiondata['conn.username'] = conn.username
		sessiondata['conn.authcookie'] = conn.authcookie
		return ''
示例#6
0
    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)
示例#7
0
from athemeweb.config import XMLRPC_PATH
from athemeweb.athemeconnection import AthemeXMLConnection
import code

x = AthemeXMLConnection(XMLRPC_PATH)
print "XMLRPC connection is declared as 'x'."
code.InteractiveConsole({'x': x}).interact()