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


on validatePassword (username, password) {
		<<8/16/10; 7:30:31 AM by DW
			<<If the callbacks table is empty, the password is invalid.
		<<7/19/10; 9:44:14 AM by DW
	local (adrdata = realtime.init (), adrscript);
	local (adrcallbacks = @adrdata^.server.callbacks.validatePassword);
	if sizeof (adrcallbacks^) == 0 {
		scripterror ("Can't validate the username and password because of a configuration error.")};
	for adrscript in adrcallbacks {
		while typeof (adrscript^) == addresstype {
			adrscript = adrscript^};
		adrscript^ (username, password)}}; //scripterror if invalid combo
bundle { //test code
	validatePassword ("davewinerx", "hello")}

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.