rem: var type = vals[0]; var slot = vals[1];    if (! accountValues[type]) return true;  if (slot == "realHostName") { oldHost = accountValues[type][slot]; newHost = getFormElementValue(pageElements[i]); hIndx = i; 
add: if (vals.length >= 2) { var type = vals[0]; var slot = vals[1];    if (!(type in accountValues) || !accountValues[type]) return true;  if (slot == "realHostName") { oldHost = accountValues[type][slot]; newHost = getFormElementValue(pageElements[i]); hIndx = i; } else if (slot == "realUsername") { oldUser = accountValues[type][slot]; newUser = getFormElementValue(pageElements[i]); uIndx = i; } else if (slot == "type") newType = getFormElementValue(pageElements[i]); 
context: function checkUserServerChanges(showAlert) {  var accountValues = getValueArrayFor(currentServerId);  var pageElements = getPageFormElements();  if (pageElements == null) return true;  // Get the new username, hostname and type from the page  var newUser, newHost, newType, oldUser, oldHost;  var uIndx, hIndx;  for (var i=0; i<pageElements.length; i++) {    if (pageElements[i].id) {      var vals = pageElements[i].id.split(".");      var type = vals[0];      var slot = vals[1];      //dump("In checkUserServerChanges() ***: accountValues[" + type + "][" + slot + "] = " + getFormElementValue(pageElements[i]) + "/" + accountValues[type][slot] + "\n");      // if this type doesn't exist (just removed) then return.      if (! accountValues[type]) return true;      if (slot == "realHostName") {        oldHost = accountValues[type][slot];        newHost = getFormElementValue(pageElements[i]);        hIndx = i;      }      else      if (slot == "realUsername") {        oldUser = accountValues[type][slot];        newUser = getFormElementValue(pageElements[i]);        uIndx = i;      }      else      if (slot == "type")        newType = getFormElementValue(pageElements[i]);    }  }  // There is no username defined for news so reset it.  if (newType == "nntp")    oldUser = newUser = "";  //dump("In checkUserServerChanges() *** Username = " + newUser + "/" + oldUser + "\n");  //dump("In checkUserServerChanges() *** Hostname = " + newHost + "/" + oldHost + "\n");  //dump("In checkUserServerChanges() *** Type     = " + newType + "\n");  // If something is changed then check if the new user/host already exists.  if ( (oldUser != newUser) || (oldHost != newHost) ) {    var newServer = accountManager.findRealServer(newUser, newHost, newType);    if (newServer) {      if (showAlert) {        var alertText = gPrefsBundle.getString("modifiedAccountExists");        window.alert(alertText);      }      // Restore the old values before return      if (newType != "nntp")        setFormElementValue(pageElements[uIndx], oldUser);      setFormElementValue(pageElements[hIndx], oldHost);      return false;    }    //dump("In checkUserServerChanges() Ah, Server not found !!!" + "\n");    // If username is changed remind users to change Your Name and Email Address.    // If serve name is changed and has defined filters then remind users to edit rules.    if (showAlert) {      var account = getAccountFromServerId(currentServerId);      var filterList;      if (account && (newType != "nntp")) {        var server = account.incomingServer;        filterList = server.getFilterList(null);      }      var userChangeText, serverChangeText;      if ( (oldHost != newHost) && (filterList != undefined) && filterList.filterCount )        serverChangeText = gPrefsBundle.getString("serverNameChanged");      if (oldUser != newUser)        userChangeText = gPrefsBundle.getString("userNameChanged");      if ( (serverChangeText != undefined) && (userChangeText != undefined) )        serverChangeText = serverChangeText + "\n\n" + userChangeText;      else      if (userChangeText != undefined)        serverChangeText = userChangeText;      if (serverChangeText != undefined)        window.alert(serverChangeText);    }  }  return true;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/0cd2634928600ba1fd1aa18c4889432a3fb7b444/AccountManager.js/buggy/mailnews/base/prefs/resources/content/AccountManager.js