fix for 130761-able to enter smtp server in account creation;r=bhuvan;sr=dbienvenu;a=asa

This commit is contained in:
varada%netscape.com 2002-03-14 20:35:28 +00:00
parent 4a127f8e62
commit 73da3c3144
2 changed files with 18 additions and 16 deletions

View File

@ -184,11 +184,10 @@ function FinishAccount() {
if (!accountData)
{
accountData = new Object;
// Time to set the smtpRequiresUsername attribute
if (!serverIsNntp(pageData))
SetSmtpRequiresUsernameAttribute(accountData);
accountData = new Object;
// Time to set the smtpRequiresUsername attribute
if (!serverIsNntp(pageData))
accountData.smtpRequiresUsername = true;
}
PageDataToAccountData(pageData, accountData);
@ -446,12 +445,16 @@ function finishAccount(account, accountData) {
* default server is returned which is also set to create a new smtp server
* (via GetDefaultServer()) if no default server is found.
*/
if (accountData.smtpCreateNewServer)
smtpServer = smtpService.createSmtpServer();
if (accountData.smtp.hostname != null)
smtpServer = smtpService.createSmtpServer();
else
smtpServer = smtpService.defaultServer;
smtpServer = smtpService.defaultServer;
dump("Copying smtpServer (" + smtpServer + ") to accountData\n");
//set the smtp server to be the default only if it is not a redirectorType
if (accountData.smtp.redirectorType == null)
smtpService.defaultServer = smtpServer;
copyObjectToInterface(smtpServer, accountData.smtp);
// some identities have 'preferred'

View File

@ -130,12 +130,7 @@ function serverPageInit() {
}
gPrefsBundle = document.getElementById("bundle_prefs");
var smtpTextBox = document.getElementById("smtphostname");
var smtpServer = parent.smtpService.defaultServer;
if (smtpTextBox && smtpTextBox.value == "" &&
smtpServer.hostname)
smtpTextBox.value = smtpServer.hostname;
// modify the value in the smtp display if we already have a
// smtp server so that the single string displays the
@ -162,9 +157,13 @@ function hideShowSmtpSettings(smtpServer) {
var boxToHide;
var boxToShow;
if (smtpServer && smtpServer.hostname &&
smtpServer.hostname != "") {
// we have a hostname, so show the static text
if (smtpServer && smtpServer.hostname && smtpServer.redirectorType == null
&& smtpServer.hostname != "") {
// we have a hostname, so show the static text and
// store the value of the default smtp server in the textbox.
var smtpTextBox = document.getElementById("smtphostname");
if (smtpTextBox && smtpTextBox.value == "")
smtpTextBox.value = smtpServer.hostname;
boxToShow = haveSmtpBox;
boxToHide = noSmtpBox;
} else {