Monday, November 08, 2010 at 12:02 AM.

system.verbs.apps.xmlStorageSystem.register

on register (email, password, name, adrgreeting = nil, adrdata = @xmlStorageSystem.data, adrresponse = nil) {
	<<Changes
		<<4/2/01; 7:58:22 AM by DW
			<<Created. Send a registerUser message to the cloud, returning true if the user is registered, false if there was a failure.
			<<email is an email address, it could be fictitious, it identifies the user. 
			<<We send an MD5 hash of the password to the server.
			<<The user's name is displayed in various lists, it's nice to know people's real name. You may lie if you want.
			<<adrgreeting points to a string that will receive the English-language message from the server, but it's optional. 
		<<7/23/01; 9:45:30 PM by JES
			<<The data table now supports both xmlRpcPath, and the more general rpcPath, used for both XML-RPC and for SOAP. This is for support for SOAP-based xmlStorageSystem implementations which have a request URI which is different from the value of the SOAPAction header.
		<<10/6/01; 1:55:51 AM by JES
			<<Send the serial number as a parameter in the RPC request.
			<<New optional parameter, adrresponse. If not nil, the entire response struct will be copied to adrresponse. This is required in order to get usernums back from an xmlStorageSystem server.
		<<10/6/01; 2:10:07 AM by JES
			<<Commented out debugging code.
	local (useragent);
	bundle { //set useragent
		if system.environment.isPike {
			useragent = "Radio UserLand"}
		else {
			useragent = "UserLand Frontier"};
		useragent = useragent + " v" + Frontier.version () + ", " + system.environment.osFullNameForDisplay + " " + system.environment.osVersionString};
	local (params = {"email":email, "name":name, "password":string.hashmd5 (password), "clientPort":user.inetd.config.http.port, "userAgent":useragent});
	if defined (adrdata^.serialNumber) {
		params = params + {"serialNumber":user.prefs.serialNumber}};
	local (rpcPath);
	if defined (adrdata^.xmlRpcPath) {
		rpcPath = adrdata^.xmlRpcPath};
	if defined (adrdata^.rpcPath) {
		rpcPath = adrdata^.rpcPath};
	with adrdata^ {
		local (result);
		result = xml.rpc (server, port, "xmlStorageSystem.registerUser", @params, rpcPath:rpcPath, fldebug:fldebug, protocol:protocol, soapAction:soapAction);
		if adrgreeting != nil {
			adrgreeting^ = result.message};
		if adrresponse != nil {
			adrresponse^ = result};
		return (not result.flerror)}}
<<bundle //test code
	<<local (greeting)
	<<local (data); new (tableType, @data)
	<<bundle //init data table
		<<data.fldebug = false
		<<data.port = 80
		<<data.protocol = "xml-rpc"
		<<data.server = "xmlstoragesystem.com"
		<<data.xmlRpcPath = "/RPC2"
		<<data.soapAction = "/xmlStorageSystem"
		<<data.serialNumber = user.prefs.serialNumber
	<<xmlStorageSystem.init ()
	<<with user.xmlStorageSystem
		<<register (email, password, name, @greeting, @data)
	<<dialog.alert (greeting)



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.