if (usernameField == null) usernameField = "name"; unode.setString (usernameField, uname);
String usernameProp = null; if (usernameField != null) { Relation namerel= userMapping.columnNameToProperty (usernameField); if (namerel != null) usernameProp = namerel.propname; } if (usernameProp == null) usernameProp = "name"; unode.setName (uname); unode.setString (usernameProp, uname);
    public INode registerUser (String uname, String password) {    	// Register a user who already has a user object    	// (i.e. who has been surfing around)	if (uname == null)	    return null;	uname = uname.toLowerCase ().trim ();	if ("".equals (uname))	    return null;	INode unode = null;	try {	    INode users = getUserRoot ();	    unode = users.getNode (uname, false);	    if (unode != null) 	        return null;	    	    unode = new Node (uname);	    String usernameField = userMapping.getNameField ();	    if (usernameField == null)	        usernameField = "name";	    unode.setString (usernameField, uname);	    unode.setString ("password", password);	    unode.setPrototype ("user");	    unode.setDbMapping (userMapping);	    users.setNode (uname, unode);	    return users.getNode (uname, false);		} catch (Exception x) {	    logEvent ("Error registering User: "+x);	    return null;	}    }