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

system.verbs.apps.Manila.windowTypes.setUsernameAndPassword

on setUsernameAndPassword (adrinfo, username, password) {
	<<Set the username and password for a site. If the user does not wish password info to be saved for this site, store it in the temp table, so it disappears at the end of the current session. Always save passwords coerced to a binary.
		<<Wed, Aug 23, 2000 at 2:45:38 PM by PBS
	<<Changes:
		<<12/26/00; 12:11:02 PM by JES
			<<Store the username as plain text.
	
	local (flSave = adrinfo^.flSavePassword);
	
	if flSave {
		adrinfo^.username = username;
		adrinfo^.password = binary (password)}
	else { //store in the temp table, so it disappears at end of session
		bundle { //init temp.manila.data.sites
			if not defined (system.temp.manila) {
				new (tableType, @system.temp.manila)};
			if not defined (system.temp.manila.data) {
				new (tableType, @system.temp.manila.data)};
			if not defined (system.temp.manila.data.sites) {
				new (tableType, @system.temp.manila.data.sites)}};
		local (tableName = nameOf (adrinfo^));
		local (adrtempinfo = @system.temp.manila.data.sites.[tableName]);
		if not defined (adrtempinfo^) {
			new (tableType, adrtempinfo)};
		adrtempinfo^.username = username;
		adrtempinfo^.password = binary (password);
		
		<<Make sure username and password are not saved in the user table.
		adrinfo^.username = "";
		adrinfo^.password = ""};
	
	return (true)}



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.