add:         try { gPrefInt.setBoolPref(gPref_string_desc + ".auth.savePassword", true); } catch (ex) {  }  
context: function onAccept(){  try {    var pref_string_content = "";    var pref_string_title = "";    if (!gPrefInt) {      gPrefInt = Components.classes["@mozilla.org/preferences-service;1"]        .getService(Components.interfaces.nsIPrefBranch);    }    var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"];    ldapUrl = ldapUrl.createInstance().      QueryInterface(Components.interfaces.nsILDAPURL);    var description = document.getElementById("description").value;    var hostname = document.getElementById("hostname").value;    var port = document.getElementById("port").value;    var secure = document.getElementById("secure");    var dn = document.getElementById("login").value;    var results = document.getElementById("results").value;    var errorValue = null;    gPref_string_desc = description;    if ((!gPref_string_desc) || hasOnlyWhitespaces(gPref_string_desc))      errorValue = "invalidName";    else if ((!hostname) || hasOnlyWhitespaces(hostname))      errorValue = "invalidHostname";    // XXX write isValidDn and call it on the dn string here?    else if (port && hasCharacters(port))      errorValue = "invalidPortNumber";    else if (results && hasCharacters(results))      errorValue = "invalidResults";    if (!errorValue) {      pref_string_content = gPref_string_desc;      if (gCurrentDirectory && gCurrentDirectoryString) {        gPref_string_desc = gCurrentDirectoryString;      } else {        createUniqueServername();        gPref_string_desc = gPrefstring + gPref_string_desc;      }      pref_string_title = gPref_string_desc + "." + "description";      var str = Components.classes["@mozilla.org/supports-wstring;1"]        .createInstance(Components.interfaces.nsISupportsWString);      str.data = pref_string_content;      gPrefInt.setComplexValue(pref_string_title,                                Components.interfaces.nsISupportsWString, str);        ldapUrl.host = hostname;      pref_string_content = gLdapService.        UCS2toUTF8(document.getElementById("basedn").value);      ldapUrl.dn = pref_string_content;      pref_string_content = gLdapService.        UCS2toUTF8(document.getElementById("search").value);      ldapUrl.filter = pref_string_content;      if (!port) {        if (secure.checked)          ldapUrl.port = kDefaultSecureLDAPPort;        else          ldapUrl.port = kDefaultLDAPPort;      } else {        ldapUrl.port = port;      }      if (document.getElementById("one").selected) {        ldapUrl.scope = Components.interfaces.nsILDAPURL.SCOPE_ONELEVEL;      } else {        ldapUrl.scope = Components.interfaces.nsILDAPURL.SCOPE_SUBTREE;      }      if (secure.checked)        ldapUrl.options |= ldapUrl.OPT_SECURE;      pref_string_title = gPref_string_desc + ".uri";      var uri = Components.classes["@mozilla.org/supports-wstring;1"]        .createInstance(Components.interfaces.nsISupportsWString);      uri.data = ldapUrl.spec;      gPrefInt.setComplexValue(pref_string_title,                               Components.interfaces.nsISupportsWString, uri);      pref_string_content = results;      pref_string_title = gPref_string_desc + ".maxHits";      if (pref_string_content != kDefaultMaxHits) {        gPrefInt.setIntPref(pref_string_title, pref_string_content);      } else {        try {          gPrefInt.clearUserPref(pref_string_title);        } catch (ex) {        }      }      pref_string_title = gPref_string_desc + ".auth.dn";      var dnWString = Components.classes["@mozilla.org/supports-wstring;1"]        .createInstance(Components.interfaces.nsISupportsWString);      dnWString.data = dn;      gPrefInt.setComplexValue(pref_string_title,                               Components.interfaces.nsISupportsWString,                                dnWString);      window.opener.gNewServer = description;      window.opener.gNewServerString = gPref_string_desc;      // set window.opener.gUpdate to true so that LDAP Directory Servers      // dialog gets updated      window.opener.gUpdate = true;     } else {      var addressBookBundle = document.getElementById("bundle_addressBook");      var errorMsg = addressBookBundle.getString(errorValue);      alert(errorMsg);    }  } catch (outer) {    dump("Internal error in pref-directory-add.js:onAccept() " + outer + "\n");  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/1ff876de9d80c7cf95564ae58faa881b587d3c2f/pref-directory-add.js/clean/mailnews/addrbook/prefs/resources/content/pref-directory-add.js