BugFix #1046; Whenever the sieve server is unavailable an error message will appear.
parent
31ace947cb
commit
1b9ac03e94
|
@ -248,6 +248,11 @@
|
|||
"Active" = "Active";
|
||||
"Move Up" = "Move Up";
|
||||
"Move Down" = "Move Down";
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
"ConnectionError" = "Connection error";
|
||||
"ServiceTemporarilyUnavailable" = "Service temporarily unavailable";
|
||||
>>>>>>> a005b93... bug 1046 finished, if sieve server is not responding an error message will appear
|
||||
|
||||
/* Filters - UIxFilterEditor */
|
||||
"Filter name:" = "Filter name:";
|
||||
|
|
|
@ -1142,6 +1142,7 @@ static NSArray *reminderValues = nil;
|
|||
id <WOActionResults> results;
|
||||
WORequest *request;
|
||||
SOGoDomainDefaults *dd;
|
||||
<<<<<<< HEAD
|
||||
NSString *method;
|
||||
|
||||
request = [context request];
|
||||
|
@ -1158,6 +1159,23 @@ static NSArray *reminderValues = nil;
|
|||
if ([dd forwardEnabled])
|
||||
[userDefaults setForwardOptions: forwardOptions];
|
||||
|
||||
=======
|
||||
SOGoMailAccount *account;
|
||||
SOGoMailAccounts *folder;
|
||||
WORequest *request;
|
||||
|
||||
request = [context request];
|
||||
if ([[request method] isEqualToString: @"POST"]){
|
||||
dd = [[context activeUser] domainDefaults];
|
||||
if ([dd sieveScriptsEnabled])
|
||||
[userDefaults setSieveFilters: sieveFilters];
|
||||
if ([dd vacationEnabled])
|
||||
[userDefaults setVacationOptions: vacationOptions];
|
||||
if ([dd forwardEnabled])
|
||||
[userDefaults setForwardOptions: forwardOptions];
|
||||
|
||||
if([self isSieveServerAvailable]){
|
||||
>>>>>>> a005b93... bug 1046 finished, if sieve server is not responding an error message will appear
|
||||
[userDefaults synchronize];
|
||||
|
||||
folder = [[self clientObject] mailAccountsFolder: @"Mail"
|
||||
|
@ -1165,6 +1183,7 @@ static NSArray *reminderValues = nil;
|
|||
account = [folder lookupName: @"0" inContext: context acquire: NO];
|
||||
[account updateFilters];
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (hasChanged)
|
||||
method = @"window.location.reload()";
|
||||
else
|
||||
|
@ -1175,6 +1194,23 @@ static NSArray *reminderValues = nil;
|
|||
else
|
||||
results = self;
|
||||
|
||||
=======
|
||||
if([account updateFilters]){
|
||||
results = [self responseWithStatus: 200 andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:hasChanged], @"hasChanged", nil]];
|
||||
}
|
||||
else{
|
||||
results = [self responseWithStatus: 502 andJSONRepresentation:[NSDictionary dictionaryWithObjectsAndKeys: @"ConnectionError", @"textStatus", nil]];
|
||||
}
|
||||
}
|
||||
else{
|
||||
results = [self responseWithStatus: 503 andJSONRepresentation:[NSDictionary dictionaryWithObjectsAndKeys: @"ServiceTemporarilyUnavailable", @"textStatus", nil]];
|
||||
}
|
||||
}
|
||||
else{
|
||||
results = self;
|
||||
}
|
||||
|
||||
>>>>>>> a005b93... bug 1046 finished, if sieve server is not responding an error message will appear
|
||||
return results;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,11 +80,39 @@ function savePreferences(sender) {
|
|||
}
|
||||
|
||||
if (sendForm) {
|
||||
<<<<<<< HEAD
|
||||
saveMailAccounts();
|
||||
$("mainForm").submit();
|
||||
}
|
||||
|
||||
return false;
|
||||
=======
|
||||
saveMailAccounts();
|
||||
|
||||
triggerAjaxRequest($("mainForm").readAttribute("action"), function (http) {
|
||||
if (http.readyState == 4) {
|
||||
var response = http.responseText.evalJSON(true);
|
||||
if (http.status == 503) {
|
||||
showAlertDialog(_(response.textStatus));
|
||||
}
|
||||
else if (http.status == 200) {
|
||||
if (response.hasChanged == 1) {
|
||||
window.opener.location.reload();
|
||||
window.close();}
|
||||
else {
|
||||
window.close();}}
|
||||
else {
|
||||
showAlertDialog(_(response.textStatus));
|
||||
}
|
||||
}
|
||||
},
|
||||
null,
|
||||
Form.serialize($("mainForm")), // excludes the file input
|
||||
{ "Content-type": "application/x-www-form-urlencoded" });
|
||||
}
|
||||
return false;
|
||||
|
||||
>>>>>>> a005b93... bug 1046 finished, if sieve server is not responding an error message will appear
|
||||
}
|
||||
|
||||
function prototypeIfyFilters() {
|
||||
|
|
Loading…
Reference in New Issue