Index: trunk/src/org/expeditee/settings/UserSettings.java
===================================================================
--- trunk/src/org/expeditee/settings/UserSettings.java	(revision 1212)
+++ trunk/src/org/expeditee/settings/UserSettings.java	(revision 1213)
@@ -23,4 +23,5 @@
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;
@@ -33,4 +34,5 @@
 import org.expeditee.gui.FrameUtils;
 import org.expeditee.gui.MessageBay;
+import org.expeditee.items.Item;
 import org.expeditee.items.Text;
 import org.expeditee.setting.BooleanSetting;
@@ -50,5 +52,5 @@
 public abstract class UserSettings {
 	
-	public final static String DEFAULT_PROFILE_NAME = "default";
+	public static String DEFAULT_PROFILE_NAME = "default";
 	
 	public static final IntegerSetting Gravity = new IntegerSetting("Distance the cursor has to be from a text item to select the text item", 3);
@@ -63,5 +65,6 @@
 		public boolean setSetting(Text text) {
     		if(text.getText().indexOf(':') == -1 || !text.hasLink()) {
-    			text.setLink(FrameIO.LoadProfile(UserSettings.ProfileName.get()).getName());
+    			text.setLink(UserSettings.ProfileName.get() + "1");
+    			//text.setLink(FrameIO.LoadProfile(UserSettings.ProfileName.get()).getName());
     		}
     		String first = FrameUtils.getLink(text, UserSettings.HomeFrame.get());
@@ -99,8 +102,35 @@
 	public static final IntegerSetting TitlePosition = new IntegerSetting("Position of title item in frame (TODO: find whether this is x-offset or y-offset)", 150);
 	
-	public static final StringSetting ProfileName = new StringSetting("Profile name", FrameIO.ConvertToValidFramesetName(System.getProperty("user.name")));
-	
-	public static final StringSetting UserName = new StringSetting("User name", ProfileName.get());
-	
+	public static final StringSetting ProfileName = new StringSetting("Profile name", FrameIO.ConvertToValidFramesetName(System.getProperty("user.name"))) {
+		
+		/** Commit the change to the appropriate frame */
+		public void set(String value) {	
+			super.set(value);
+			commitToSettingsFrameItem(value, "ProfileName:");
+		};
+		
+		/** If authenticated, then resetting ProfileName should not do anything. */
+		public void reset() {
+			if (!Authenticated.get()) {
+				super.reset();
+			}
+		};
+	};
+	
+	public static final StringSetting UserName = new StringSetting("User name", ProfileName.get()) { 
+		/** Commit the change to the appropriate frame */
+		public void set(String value) {	
+			super.set(value);
+			commitToSettingsFrameItem(value, "UserName:");
+		};
+		
+		/** If authenticated, then resetting UserName should not do anything. */
+		public void reset() {
+			if (!Authenticated.get()) {
+				super.reset();
+			}
+		};
+	};
+		
 	public static final BooleanSetting AntiAlias = new BooleanSetting("Whether anti-aliasing should be enabled", false);
 
@@ -112,10 +142,22 @@
 
 	public static final BooleanSetting Threading = new BooleanSetting("Whether threading should be enabled", true);
-	
+
+	public static final BooleanSetting Authenticated = new BooleanSetting("Whether the current user is authenticated", false) {
+		public void set(Boolean value) {
+			super.set(value);
+			commitToSettingsFrameItem(value, "Authenticated:");
+		}
+		
+		// Authenticated must be maintained rather than rely on default value.
+		public void reset() {};
+		
+		public boolean setSetting(Text text) { 
+			return super.setSetting(text);
+		};
+	};
 	
 	/*
 	 * Frames
 	 */
-	
 	public static final StringSetting StatisticsFrameset = new StringSetting("The statistics frameset", null);
 
@@ -247,3 +289,21 @@
 		}
 	}
+	
+	private static void commitToSettingsFrameItem(Object value, String contentMatch) {
+		String profileName = UserSettings.UserName.get();
+		int lastNumber = FrameIO.getLastNumber(profileName);
+		for (int i = 1; i <= lastNumber; i++) {
+			Frame frame = FrameIO.LoadFrame(profileName + i);
+			if (frame != null) {
+	 			Collection<Item> items = frame.getAllItems();
+				boolean found = false;
+				for (Item item: items) {
+					if (item.getText().startsWith(contentMatch)) {
+						item.setText(contentMatch + " " + value);
+					}
+				}
+				if (found) { break; }
+			}
+		}
+	}
 }
