+ } else {
+
+ cfgfile->Read(wxT("accountdir"), &AccDir);
+ accountaddressvalid = cfgfile->Read(wxT("address"), &AccAdr);
+ accountportvalid = cfgfile->Read(wxT("port"), &AccPort);
+ accountsslvalid = cfgfile->Read(wxT("ssl"), &AccSSLInc);
+ if (AccSSLInc == wxT("true")){
+ AccSSL = TRUE;
+ }
+ else {
+ AccSSL = FALSE;
+ }
+ accountusernamevalid = cfgfile->Read(wxT("username"), &AccUsr);
+ accountpasswordvalid = cfgfile->Read(wxT("password"), &AccPass);
+ accountdirprefixvalid = cfgfile->Read(wxT("prefix"), &AccPrefix);
+ accountrefreshvalid = cfgfile->Read(wxT("refresh"), &AccRef);
+
+ if (AccDir.Len() > 4){
+
+ accountdirvalid = TRUE;
+
+ }
+
+ // Make sure it is not bigger than 65535 or less than 1.
+ // If so, default to port 8008.
+
+ if (accountport < 1 || accountport > 65535){
+ accountport = 8008;
+ accountportvalid = TRUE;
+ }
+
+ accounts.AddAccount(accountname, EntryValue, AccAdr, AccPort,
+ AccSSL, AccUsr, AccPass,
+ AccPrefix, AccDir, AccRef);
+