mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-27 13:08:54 +00:00
Merge branch 'master' into feature-5726-gab-autocomplete
This commit is contained in:
commit
60e6bb5b3b
16 files changed
+173
-39
No files matched your search
@@ -2280,12 +2280,14 @@ Defaults to `NO` when unset.
|
||||
|D |SOGoForwardConstraints
|
||||
|Parameter used to set constraints on possible addresses used when
|
||||
automatically forwarding mails. When set to `0` (default), no constraint
|
||||
is enforced. When set to `1`, only internal domains can be used. When
|
||||
set to `2`, only external domains can be used.
|
||||
is enforced. When set to `1`, only internal domains can be used.
|
||||
When set to `2`, only external domains defined in `SOGoForwardConstraintsDomains`
|
||||
can be used. When set to `3`, internal domains and other domains defined
|
||||
in `SOGoForwardConstraintsDomains` can be used.
|
||||
|
||||
|D |SOGoForwardConstraintsDomains
|
||||
|Parameter used to set which domains are allowed as external domains
|
||||
when SOGoForwardConstraints is set to `2`. For example, setting:
|
||||
|Parameter used to set which external domains are allowed
|
||||
when SOGoForwardConstraints is set to `2` or `3`. For example, setting:
|
||||
|
||||
SOGoForwardConstraintsDomains = ("gmail.com", "googlemail.com");
|
||||
|
||||
@@ -3513,13 +3515,12 @@ without activity for specified number of minutes. Those users will have to log i
|
||||
sogo-tool expire-sessions [nbMinutes]
|
||||
|
||||
* *nbMinutes* Integer, number of minutes. All session without activity in these last minutes will be removed.
|
||||
* _*Warning*_ Putting anything other that a number will be count as 0 minutes...
|
||||
|
||||
Example:
|
||||
----
|
||||
sogo-tool expire-sessions #Will print usage.
|
||||
sogo-tool expire-sessions 160 #Will remove session which last activity is older than 160 minutes.
|
||||
sogo-tool expire-sessions --help #Will remove session which last activity is older than 0 minutes.
|
||||
sogo-tool expire-sessions 0 #Will remove session which last activity is older than 0 minutes.
|
||||
----
|
||||
|
||||
sogo-tool manage-acl
|
||||
|
||||
@@ -72,8 +72,14 @@
|
||||
|
||||
- (void) setEndDate: (NSCalendarDate *) newEndDate
|
||||
{
|
||||
CardElement *c;
|
||||
|
||||
[(iCalDateTime *) [self uniqueChildWithTag: @"dtend"]
|
||||
setDateTime: newEndDate];
|
||||
|
||||
c = [self uniqueChildWithTag: @"duration"];
|
||||
if (c)
|
||||
[self removeChild: c];
|
||||
}
|
||||
|
||||
- (NSCalendarDate *) endDate
|
||||
|
||||
@@ -44,10 +44,11 @@
|
||||
{
|
||||
NSMutableArray *ranges;
|
||||
NSArray *byMonth;
|
||||
NSCalendarDate *firStart, *lastDate, *rStart, *rEnd, *until, *referenceDate;
|
||||
NSCalendarDate *firStart, *lastDate, *rStart, *rEnd, *until, *referenceDate, *rTemp;
|
||||
NSInteger *hoursOfOffset;
|
||||
iCalMonthlyRecurrenceCalculator *monthlyCalc;
|
||||
unsigned j, yearIdxInRange, numberOfYearsInRange, count, interval, monthDiff;
|
||||
int diff, repeatCount, currentMonth;
|
||||
int diff, repeatCount, currentMonth, origNbDaysInMonth;
|
||||
|
||||
firStart = [firstRange startDate];
|
||||
rStart = [_r startDate];
|
||||
@@ -186,18 +187,31 @@
|
||||
days: 0];
|
||||
|
||||
|
||||
//Due to the bug with dateByAddingYears, we have to take off one day (see line 133)
|
||||
rStart = [NSCalendarDate dateWithYear: [rStart yearOfCommonEra]
|
||||
month: [rStart monthOfYear]
|
||||
day: 0
|
||||
hour: [rStart hourOfDay]
|
||||
minute: [rStart minuteOfHour]
|
||||
second: 0
|
||||
timeZone: [rStart timeZone]];
|
||||
//Due to the bug with dateByAddingYears, we may take the previous day (see line 133)
|
||||
hoursOfOffset = [rStart hourOfDay];
|
||||
origNbDaysInMonth = [rStart numberOfDaysInMonth];
|
||||
if(hoursOfOffset > 12) {
|
||||
//If rStart is 1st 22:00, we should start at the previous day 22:00
|
||||
rTemp = [NSCalendarDate dateWithYear: [rStart yearOfCommonEra]
|
||||
month: 1+([rStart monthOfYear]-2)%12
|
||||
day: 1
|
||||
hour: [rStart hourOfDay]
|
||||
minute: [rStart minuteOfHour]
|
||||
second: 0
|
||||
timeZone: [rStart timeZone]];
|
||||
rStart = [NSCalendarDate dateWithYear: [rStart yearOfCommonEra]
|
||||
month: 1+([rStart monthOfYear]-2)%12
|
||||
day: [rTemp numberOfDaysInMonth]
|
||||
hour: [rStart hourOfDay]
|
||||
minute: [rStart minuteOfHour]
|
||||
second: 0
|
||||
timeZone: [rStart timeZone]];
|
||||
}
|
||||
|
||||
|
||||
rEnd = [rStart dateByAddingYears: 0
|
||||
months: 0
|
||||
days: [rStart numberOfDaysInMonth]];
|
||||
days: origNbDaysInMonth];
|
||||
|
||||
|
||||
rangeForMonth = [NGCalendarDateRange calendarDateRangeWithStartDate: rStart
|
||||
|
||||
@@ -418,7 +418,7 @@ convention:
|
||||
[self setCategories: [o componentsSeparatedByString: @","]];
|
||||
|
||||
// Photo
|
||||
if ([ldifRecord objectForKey: @"photo"])
|
||||
if ([ldifRecord objectForKey: @"photo"] && [ldifRecord objectForKey: @"photo"] != [NSNull null])
|
||||
[self setPhoto: [[ldifRecord objectForKey: @"photo"] stringByEncodingBase64]];
|
||||
|
||||
[self cleanupEmptyChildren];
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
- (id) objectFromJSONString;
|
||||
|
||||
/* bare email addresses */
|
||||
- (NSString *) mailDomain;
|
||||
- (NSString *) pureEMailAddress;
|
||||
|
||||
- (NSString *) asQPSubjectString: (NSString *) encoding;
|
||||
|
||||
@@ -609,6 +609,18 @@ static int cssEscapingCount;
|
||||
return newString;
|
||||
}
|
||||
|
||||
|
||||
- (NSString *) mailDomain
|
||||
{
|
||||
NSArray *mailSeparated;
|
||||
|
||||
mailSeparated = [self componentsSeparatedByString: @"@"];
|
||||
if([mailSeparated count] == 2)
|
||||
return [mailSeparated objectAtIndex: 1];
|
||||
[self logWithFormat: @"Error while extracting domain from : %@", self];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString *) pureEMailAddress
|
||||
{
|
||||
NSString *pureAddress;
|
||||
|
||||
@@ -123,6 +123,7 @@
|
||||
SOGoTemplatesFolderName = "Templates";
|
||||
SOGoMailComposeMessageType = "html";
|
||||
SOGoMailComposeFontSize = "0";
|
||||
SOGoMailHideInlineAttachments = NO;
|
||||
SOGoMailDisplayRemoteInlineImages = "never";
|
||||
SOGoMailCertificateEnabled = YES;
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
|
||||
v = [self integerForKey: @"SOGoForwardConstraints"];
|
||||
|
||||
return (v > 2 ? 0 : v);
|
||||
return (v > 3 ? 0 : v);
|
||||
}
|
||||
|
||||
- (NSArray *) forwardConstraintsDomains
|
||||
|
||||
@@ -739,7 +739,8 @@ static NSArray *childRecordFields = nil;
|
||||
qualifier = aclQualifier;
|
||||
|
||||
// For Thunderbird, disable contact list
|
||||
if ([[context request] isThunderbird]) {
|
||||
// This will be removed when VCARD will be implemented
|
||||
if ([[context request] isThunderbird] && [self isKindOfClass: NSClassFromString(@"SOGoContactGCSFolder")]) {
|
||||
vlistExclusionQualifier = [EOQualifier qualifierWithQualifierFormat: @"c_component != 'vlist'"];
|
||||
qualifier = [[[EOAndQualifier alloc] initWithQualifiers:
|
||||
vlistExclusionQualifier,
|
||||
@@ -1191,7 +1192,8 @@ static NSArray *childRecordFields = nil;
|
||||
folder = [self ocsFolder];
|
||||
|
||||
// For Thunderbird, disable contact list
|
||||
if ([[context request] isThunderbird]) {
|
||||
// This will be removed when VCARD will be implemented
|
||||
if ([[context request] isThunderbird] && [self isKindOfClass: NSClassFromString(@"SOGoContactGCSFolder")]) {
|
||||
vlistExclusionQualifier = [EOQualifier qualifierWithQualifierFormat: @"c_component != 'vlist'"];
|
||||
qualifier = [[[EOAndQualifier alloc] initWithQualifiers:
|
||||
vlistExclusionQualifier,
|
||||
|
||||
@@ -140,7 +140,12 @@
|
||||
|
||||
NSLog(@"Remove all sessions older than %d min", sessionExpireMinutes);
|
||||
|
||||
if (sessionExpireMinutes >= 0)
|
||||
if (sessionExpireMinutes == 0 && ![[arguments objectAtIndex: 0] isEqualToString:@"0"])
|
||||
{
|
||||
//If the input is not a number intValue return 0 so we check that's really the case
|
||||
[self usage];
|
||||
}
|
||||
else if (sessionExpireMinutes >= 0)
|
||||
{
|
||||
rc = [self expireUserSessionOlderThan: sessionExpireMinutes];
|
||||
}
|
||||
|
||||
@@ -314,24 +314,54 @@
|
||||
return [[[self message] valueForKey:@"uid"] stringValue];
|
||||
}
|
||||
|
||||
- (BOOL) parseParts: (NSArray *) parts hasAttachment:(BOOL) hasAttachment {
|
||||
NSEnumerator *part;
|
||||
NSDictionary *currentPart;
|
||||
SOGoUserDefaults *ud;
|
||||
BOOL isInline;
|
||||
|
||||
ud = [[[self context] activeUser] userDefaults];
|
||||
|
||||
if ([parts count] > 1)
|
||||
{
|
||||
part = [parts objectEnumerator];
|
||||
while (!hasAttachment
|
||||
&& (currentPart = [part nextObject])) {
|
||||
if ([currentPart objectForKey: @"type"] && ![[[currentPart objectForKey: @"type"] uppercaseString] hasPrefix: @"MULTIPART"]) {
|
||||
isInline = currentPart && [currentPart objectForKey:@"disposition"]
|
||||
&& [[currentPart objectForKey:@"disposition"] objectForKey:@"type"]
|
||||
&& [[[[currentPart objectForKey:@"disposition"] objectForKey:@"type"] uppercaseString] isEqualToString:@"INLINE"];
|
||||
if (![ud hideInlineAttachments] || ([ud hideInlineAttachments] && !isInline)) {
|
||||
hasAttachment = (([currentPart objectForKey:@"disposition"]
|
||||
&& [[[currentPart objectForKey:@"disposition"] allKeys] length] > 0)
|
||||
|| ([currentPart objectForKey:@"parameterList"]
|
||||
&& [[currentPart objectForKey:@"parameterList"] objectForKey:@"name"]
|
||||
));
|
||||
}
|
||||
} else if ([currentPart objectForKey:@"parts"]) {
|
||||
hasAttachment = [self parseParts: [currentPart objectForKey:@"parts"] hasAttachment: hasAttachment];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return hasAttachment;
|
||||
}
|
||||
|
||||
- (BOOL) hasMessageAttachment
|
||||
{
|
||||
NSArray *parts;
|
||||
NSEnumerator *dispositions;
|
||||
NSDictionary *currentDisp;
|
||||
BOOL hasAttachment;
|
||||
|
||||
hasAttachment = NO;
|
||||
|
||||
parts = [[message objectForKey: @"bodystructure"] objectForKey: @"parts"];
|
||||
if ([parts count] > 1)
|
||||
{
|
||||
dispositions = [[parts objectsForKey: @"disposition"
|
||||
notFoundMarker: nil] objectEnumerator];
|
||||
while (!hasAttachment
|
||||
&& (currentDisp = [dispositions nextObject]))
|
||||
hasAttachment = ([[currentDisp objectForKey: @"type"] length]);
|
||||
}
|
||||
NS_DURING
|
||||
{
|
||||
hasAttachment = [self parseParts: [[message objectForKey: @"bodystructure"] objectForKey: @"parts"] hasAttachment:hasAttachment];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
[self logWithFormat: @"Error while parsing attachements for rendering bracket"];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
return hasAttachment;
|
||||
}
|
||||
|
||||
@@ -368,6 +368,9 @@ static SoProduct *preferencesProduct = nil;
|
||||
if ([[defaults source] objectForKey: @"SOGoMailAutoMarkAsReadDelay"] == nil)
|
||||
[[defaults source] setObject: [NSNumber numberWithInt: [defaults mailAutoMarkAsReadDelay]] forKey: @"SOGoMailAutoMarkAsReadDelay"];
|
||||
|
||||
if ([[defaults source] objectForKey: @"SOGoMailHideInlineAttachments"] == nil)
|
||||
[[defaults source] setObject: [NSNumber numberWithBool: [defaults hideInlineAttachments]] forKey: @"SOGoMailHideInlineAttachments"];
|
||||
|
||||
if (![[defaults source] objectForKey: @"SOGoMailAutoSave"])
|
||||
[[defaults source] setObject: [defaults mailAutoSave] forKey: @"SOGoMailAutoSave"];
|
||||
|
||||
|
||||
@@ -1532,6 +1532,44 @@ static NSArray *reminderValues = nil;
|
||||
return (forwardEnabled ? @"true" : @"false");
|
||||
}
|
||||
|
||||
- (BOOL) doForwardsMatchTheConstraints: (NSArray *) forwardMails
|
||||
{
|
||||
NSArray *allUserMails, *domainConstraints;
|
||||
NSMutableArray *allUserDomains;
|
||||
NSString *currentMail, *currentDomain, *userMail;
|
||||
SOGoDomainDefaults *dd;
|
||||
int constraint;
|
||||
|
||||
dd = [[context activeUser] domainDefaults];
|
||||
constraint = [dd forwardConstraints];
|
||||
|
||||
if(constraint > 0)
|
||||
{
|
||||
allUserMails = [[user allEmails] uniqueObjects];
|
||||
allUserDomains = [NSMutableArray array];
|
||||
for(userMail in allUserMails)
|
||||
{
|
||||
[allUserDomains push: [userMail mailDomain]];
|
||||
}
|
||||
for(currentMail in forwardMails)
|
||||
{
|
||||
currentDomain = [currentMail mailDomain];
|
||||
domainConstraints = [dd forwardConstraintsDomains];
|
||||
if (constraint == 1 && [allUserDomains indexOfObject: currentDomain] == NSNotFound)
|
||||
return NO;
|
||||
else if (constraint == 2 && [allUserDomains indexOfObject: currentDomain] != NSNotFound)
|
||||
return NO;
|
||||
else if (constraint == 2 && (!domainConstraints || [domainConstraints indexOfObject: currentDomain] == NSNotFound))
|
||||
return NO;
|
||||
else if (constraint == 3 &&
|
||||
[allUserDomains indexOfObject: currentDomain] == NSNotFound &&
|
||||
(!domainConstraints || [domainConstraints indexOfObject: currentDomain] == NSNotFound))
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {post} /so/:username/Preferences/save Save user's defaults and settings
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1561,8 +1599,8 @@ static NSArray *reminderValues = nil;
|
||||
if ((v = [o objectForKey: @"defaults"]))
|
||||
{
|
||||
NSMutableDictionary *sanitizedLabels;
|
||||
NSArray *allKeys, *accounts, *identities;
|
||||
NSDictionary *newLabels;
|
||||
NSArray *allKeys, *accounts, *identities, *forwardMails;
|
||||
NSDictionary *newLabels, *forwardPref;
|
||||
NSString *name;
|
||||
id loginModule;
|
||||
|
||||
@@ -1600,6 +1638,20 @@ static NSArray *reminderValues = nil;
|
||||
[v removeObjectForKey: @"SOGoAlternateAvatar"];
|
||||
[[[user userDefaults] source] removeObjectForKey: @"SOGoAlternateAvatar"];
|
||||
}
|
||||
|
||||
//We check if there are forward constraints
|
||||
forwardPref = [v objectForKey: @"Forward"];
|
||||
if(forwardPref && [forwardPref isKindOfClass: [NSDictionary class]]
|
||||
&& [forwardPref objectForKey: @"enabled"]
|
||||
&& [[forwardPref objectForKey: @"enabled"] boolValue])
|
||||
{
|
||||
BOOL doForward = NO;
|
||||
forwardMails = [forwardPref objectForKey: @"forwardAddress"];
|
||||
if (forwardMails && [forwardMails isKindOfClass: [NSArray class]] && [forwardMails count]>0)
|
||||
doForward = [self doForwardsMatchTheConstraints: [forwardPref objectForKey: @"forwardAddress"]];
|
||||
if(!doForward)
|
||||
[v removeObjectForKey: @"Forward"];
|
||||
}
|
||||
|
||||
if ([self userHasMailAccess])
|
||||
{
|
||||
@@ -1658,7 +1710,7 @@ static NSArray *reminderValues = nil;
|
||||
// - forceDefaultIdentity => SOGoMailForceDefaultIdentity
|
||||
// - receipts.receiptAction => SOGoMailReceiptAllow
|
||||
// - receipts.receiptNonRecipientAction => SOGoMailReceiptNonRecipientAction
|
||||
// - receipts.receiptOutsideDomainAction => SOGoMailReceiptOutsideDomainAction
|
||||
// - receipts.receiptOutsideDomaforwardAddressinAction => SOGoMailReceiptOutsideDomainAction
|
||||
// - receipts.receiptAnyAction => SOGoMailReceiptAnyAction
|
||||
// - security.alwaysSign => SOGoMailCertificateAlwaysSign
|
||||
// - security.alwaysEncrypt => SOGoMailCertificateAlwaysEncrypt
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
!function(){"use strict";function e(e,t){e.state("preferences",{abstract:!0,views:{preferences:{templateUrl:"preferences.html",controller:"PreferencesController",controllerAs:"app"}}}).state("preferences.general",{url:"/general",views:{module:{templateUrl:"generalPreferences.html"}}}).state("preferences.calendars",{url:"/calendars",views:{module:{templateUrl:"calendarsPreferences.html"}}}).state("preferences.addressbooks",{url:"/addressbooks",views:{module:{templateUrl:"addressbooksPreferences.html"}}}).state("preferences.mailer",{url:"/mailer",views:{module:{templateUrl:"mailerPreferences.html"}}}),t.rules.otherwise("/general")}function t(e,t,i,a){e.DebugEnabled||a.defaultErrorHandler(function(){}),i.onError({to:"preferences.**"},function(e){"preferences"==e.to().name||e.ignored()||(t.error("transition error to "+e.to().name+": "+e.error().detail),a.go({state:"preferences"}))})}angular.module("SOGo.PreferencesUI",["ui.router","sgCkeditor","angularFileUpload","SOGo.Common","SOGo.MailerUI","SOGo.ContactsUI","SOGo.Authentication","as.sortable"]).config(e).run(t),e.$inject=["$stateProvider","$urlServiceProvider"],t.$inject=["$window","$log","$transitions","$state"]}(),function(){"use strict";function e(s,e,t,i,r,a,n,o,c,d,f){var u=this,h=e.usesCASAuthentication||e.usesSAML2Authentication;function m(){u.account.security&&u.account.security.hasCertificate&&u.account.$certificate().then(function(e){u.certificate=e},function(){delete u.account.security.hasCertificate})}function p(e){e=0<e.type.indexOf("pkcs12")||/\.(p12|pfx)$/.test(e.name);return u.form.certificateFilename.$setValidity("fileformat",e),e}this.defaultPort=143,this.defaults=n,this.account=o,this.maxSize=f,this.accountId=c,this.hostnameRE=h&&0<c?/^(?!(127\.0\.0\.1|localhost(?:\.localdomain)?)$)/:/./,this.emailRE=String.emailRE,this.addressesSearchText="",this.ckConfig={autoGrow_minHeight:70,removeButtons:"Save,NewPage,Preview,Print,Templates,Cut,Copy,Paste,PasteText,PasteFromWord,Undo,Redo,Find,Replace,SelectAll,Scayt,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,CopyFormatting,RemoveFormat,NumberedList,BulletedList,Outdent,Indent,Blockquote,CreateDiv,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,BidiLtr,BidiRtl,Language,Unlink,Anchor,Flash,Table,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,Styles,Format,Maximize,ShowBlocks,About,Strike,Subscript,Superscript,Underline,Image,Emojipanel,Emoji,",language:n.ckLocaleCode},this.account.encryption?"ssl"==this.account.encryption&&(this.defaultPort=993):this.account.encryption="none",m(),this.uploader=new i({url:[a.activeUser("folderURL")+"Mail",c,"importCertificate"].join("/"),autoUpload:!1,queueLimit:1,filters:[{name:p,fn:p}],onAfterAddingFile:function(e){u.certificateFilename=e.file.name},onSuccessItem:function(e,t,i,a){this.clearQueue(),s(function(){_.assign(u.account,{security:{hasCertificate:!0},$$certificate:t})}),m()},onErrorItem:function(e,t,i,a){r.alert(l("Error"),l("An error occurred while importing the certificate. Verify your password."))}}),this.hasIdentities=function(){return 0<_.filter(this.account.identities,this.isEditableIdentity).length},this.isEditableIdentity=function(e){return!e.isReadOnly},this.selectIdentity=function(e){this.selectedIdentity==e?this.selectedIdentity=null:this.selectedIdentity=e},this.hasDefaultIdentity=function(){return 0<=_.findIndex(this.account.identities,function(e){return!!e.isDefault})},this.setDefaultIdentity=function(e,i){return _.forEach(this.account.identities,function(e,t){t==i?e.isDefault=!e.isDefault:delete e.isDefault}),e.stopPropagation(),!1},this.canRemoveIdentity=function(e){return e==this.selectedIdentity&&this.hasIdentities()},this.removeIdentity=function(e){this.account.identities.splice(e,1),this.selectedIdentity=null},this.addIdentity=function(){var e=_.findIndex(this.account.identities,{isReadOnly:1}),t={};e<0&&(e=this.account.identities.length),this.customFromIsReadonly()&&(t.fullName=this.account.identities[0].fullName),this.account.identities.splice(Math.max(e,0),0,t),this.selectedIdentity=e},this.showCkEditor=function(e){return this.selectedIdentity==e&&"html"==this.defaults.SOGoMailComposeMessageType},this.filterEmailAddresses=function(t){return _.filter(e.defaultEmailAddresses,function(e){return 0<=e.toLowerCase().indexOf(t.toLowerCase())})},this.customFromIsReadonly=function(){return!(0<c||d)},this.importCertificate=function(){this.uploader.queue[0].formData=[{password:this.certificatePassword}],this.uploader.uploadItem(0)},this.onBeforeUploadCertificate=function(e){this.form=e,this.uploader.clearQueue()},this.removeCertificate=function(){this.account.$removeCertificate()},this.cancel=function(){t.cancel()},this.save=function(){JSON.stringify(this.account).length>this.maxSize?r.alert(l("Error"),l("Data too big. Please contact technical support.")):t.hide()}}e.$inject=["$timeout","$window","$mdDialog","FileUploader","Dialog","sgSettings","defaults","account","accountId","mailCustomFromEnabled","maLine truncated
|
||||
!function(){"use strict";function e(e,t){e.state("preferences",{abstract:!0,views:{preferences:{templateUrl:"preferences.html",controller:"PreferencesController",controllerAs:"app"}}}).state("preferences.general",{url:"/general",views:{module:{templateUrl:"generalPreferences.html"}}}).state("preferences.calendars",{url:"/calendars",views:{module:{templateUrl:"calendarsPreferences.html"}}}).state("preferences.addressbooks",{url:"/addressbooks",views:{module:{templateUrl:"addressbooksPreferences.html"}}}).state("preferences.mailer",{url:"/mailer",views:{module:{templateUrl:"mailerPreferences.html"}}}),t.rules.otherwise("/general")}function t(e,t,i,a){e.DebugEnabled||a.defaultErrorHandler(function(){}),i.onError({to:"preferences.**"},function(e){"preferences"==e.to().name||e.ignored()||(t.error("transition error to "+e.to().name+": "+e.error().detail),a.go({state:"preferences"}))})}angular.module("SOGo.PreferencesUI",["ui.router","sgCkeditor","angularFileUpload","SOGo.Common","SOGo.MailerUI","SOGo.ContactsUI","SOGo.Authentication","as.sortable"]).config(e).run(t),e.$inject=["$stateProvider","$urlServiceProvider"],t.$inject=["$window","$log","$transitions","$state"]}(),function(){"use strict";function e(s,e,t,i,r,a,n,o,c,d,f){var u=this,h=e.usesCASAuthentication||e.usesSAML2Authentication;function m(){u.account.security&&u.account.security.hasCertificate&&u.account.$certificate().then(function(e){u.certificate=e},function(){delete u.account.security.hasCertificate})}function p(e){e=0<e.type.indexOf("pkcs12")||/\.(p12|pfx)$/.test(e.name);return u.form.certificateFilename.$setValidity("fileformat",e),e}this.defaultPort=143,this.defaults=n,this.account=o,this.maxSize=f,this.accountId=c,this.hostnameRE=h&&0<c?/^(?!(127\.0\.0\.1|localhost(?:\.localdomain)?)$)/:/./,this.emailRE=String.emailRE,this.addressesSearchText="",this.ckConfig={autoGrow_minHeight:70,removeButtons:"Save,NewPage,Preview,Print,Templates,Cut,Copy,Paste,PasteText,PasteFromWord,Undo,Redo,Find,Replace,SelectAll,Scayt,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,CopyFormatting,RemoveFormat,NumberedList,BulletedList,Outdent,Indent,Blockquote,CreateDiv,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,BidiLtr,BidiRtl,Language,Unlink,Anchor,Flash,Table,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,Styles,Format,Maximize,ShowBlocks,About,Strike,Subscript,Superscript,Underline,Image,Emojipanel,Emoji,",language:n.ckLocaleCode},this.account.encryption?"ssl"==this.account.encryption&&(this.defaultPort=993):this.account.encryption="none",m(),this.uploader=new i({url:[a.activeUser("folderURL")+"Mail",c,"importCertificate"].join("/"),autoUpload:!1,queueLimit:1,filters:[{name:p,fn:p}],onAfterAddingFile:function(e){u.certificateFilename=e.file.name},onSuccessItem:function(e,t,i,a){this.clearQueue(),s(function(){_.assign(u.account,{security:{hasCertificate:!0},$$certificate:t})}),m()},onErrorItem:function(e,t,i,a){r.alert(l("Error"),l("An error occurred while importing the certificate. Verify your password."))}}),this.hasIdentities=function(){return 0<_.filter(this.account.identities,this.isEditableIdentity).length},this.isEditableIdentity=function(e){return!e.isReadOnly},this.selectIdentity=function(e){this.selectedIdentity==e?this.selectedIdentity=null:this.selectedIdentity=e},this.hasDefaultIdentity=function(){return 0<=_.findIndex(this.account.identities,function(e){return!!e.isDefault})},this.setDefaultIdentity=function(e,i){return _.forEach(this.account.identities,function(e,t){t==i?e.isDefault=!e.isDefault:delete e.isDefault}),e.stopPropagation(),!1},this.canRemoveIdentity=function(e){return e==this.selectedIdentity&&this.hasIdentities()},this.removeIdentity=function(e){this.account.identities.splice(e,1),this.selectedIdentity=null},this.addIdentity=function(){var e=_.findIndex(this.account.identities,{isReadOnly:1}),t={};e<0&&(e=this.account.identities.length),this.customFromIsReadonly()&&(t.fullName=this.account.identities[0].fullName),this.account.identities.splice(Math.max(e,0),0,t),this.selectedIdentity=e},this.showCkEditor=function(e){return this.selectedIdentity==e&&"html"==this.defaults.SOGoMailComposeMessageType},this.filterEmailAddresses=function(t){return _.filter(e.defaultEmailAddresses,function(e){return 0<=e.toLowerCase().indexOf(t.toLowerCase())})},this.customFromIsReadonly=function(){return!(0<c||d)},this.importCertificate=function(){this.uploader.queue[0].formData=[{password:this.certificatePassword}],this.uploader.uploadItem(0)},this.onBeforeUploadCertificate=function(e){this.form=e,this.uploader.clearQueue()},this.removeCertificate=function(){this.account.$removeCertificate()},this.cancel=function(){t.cancel()},this.save=function(){JSON.stringify(this.account).length>this.maxSize?r.alert(l("Error"),l("Data too big. Please contact technical support.")):t.hide()}}e.$inject=["$timeout","$window","$mdDialog","FileUploader","Dialog","sgSettings","defaults","account","accountId","mailCustomFromEnabled","maLine truncated
|
||||
//# sourceMappingURL=Preferences.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"Preferences.js","sources":["Preferences/Preferences.app.js","Preferences/AccountDialogController.js","Preferences/FiltersDialogController.js","Preferences/PreferencesController.js"],"names":["configure","$stateProvider","$urlServiceProvider","state","abstract","views","preferences","templateUrl","controller","controllerAs","url","module","rules","otherwise","runBlock","$window","$log","$transitions","$state","DebugEnabled","defaultErrorHandler","onError","to","transition","name","ignored","error","detail","go","angular","config","run","$inject","AccountDialogController","$timeout","$mdDialog","FileUploader","Dialog","Settings","defaults","account","accountId","mailCustomFromEnabled","maxSize","vm","this","usesSSO","usesCASAuthentication","usesSAML2Authentication","_loadCertificate","security","hasCertificate","$certificate","then","crt","certificate","filterByExtension","item","isP12File","type","indexOf","test","form","certificateFilename","$setValidity","defaultPort","hostnameRE","emailRE","String","addressesSearchText","ckConfig","autoGrow_minHeight","removeButtons","language","ckLocaleCode","encryption","uploader","activeUser","join","autoUpload","queueLimit","filters","fn","onAfterAddingFile","file","onSuccessItem","response","status","headers","clearQueue","_","assign","$$certificate","onErrorItem","alert","l","hasIdentities","filter","identities","isEditableIdentity","length","identity","isReadOnly","selectIdentity","index","selectedIdentity","hasDefaultIdentity","findIndex","isDefault","setDefaultIdentity","$event","$index","forEach","i","stopPropagation","canRemoveIdentity","removeIdentity","splice","addIdentity","firstReadonlyIndex","customFromIsReadonly","fullName","Math","max","showCkEditor","SOGoMailComposeMessageType","filterEmailAddresses","$query","defaultEmailAddresses","address","toLowerCase","importCertificate","queue","formData","password","certificatePassword","uploadItem","onBeforeUploadCertificate","removeCertificate","$removeCertificate","cancel","save","JSON","stringify","hide","FiltersDialogController","$scope","mailboxes","labels","validateForwardAddress","Preferences","sieveCapabilities","forwardEnabled","notificationEnabled","vacationEnabled","fieldLabels","subject","from","cc","to_or_cc","size","header","body","methodLabels","discard","keep","stop","redirect","notify","reject","fileinto","addflag","methods","intersection","keys","numberOperatorLabels","under","over","textOperatorLabels","is","is_not","contains","contains_not","matches","matches_not","regex","regex_not","hasRulesAndActions","requirements","actions","match","push","every","a","invalid","method","action","argument","err","message","addMailFilterRule","event","field","operator","removeMailFilterRule","addMailFilterAction","removeMailFilterAction","PreferencesController","$q","$mdMedia","$mdSidenav","$mdToast","sgSettings","focus","User","Account","Authentication","AddressBook","Date","beginOfDay","_loadAllMailboxes","mail","id","$getMailboxes","allMailboxes","$flattenMailboxes","all","domain","domains","forwardConstraints","defaultAddresses","adr","split","Error","forwardConstraintsDomains","$onInit","passwords","newPassword","newPasswordConfirmation","oldPassword","timeZonesList","timeZonesSearchText","autocomplete","forward","notification","mailLabelKeyRE","RegExp","emailSeparatorKeys","Notification","notificationMessage","notificationTranslated","SOGoMailAutoMarkAsReadMode","mailAutoMarkAsReadDelay","SOGoMailAutoMarkAsReadDelay","SOGoAlternateAvatar","$alternateAvatar","sieveVariablesCapability","hasActiveExternalSieveScripts","updateVacationDates","$valid","close","onLanguageChange","confirm","ok","quick","location","reload","onDesktopNotificationsChange","SOGoDesktopNotifications","authorizeNotifications","resetContactsCategories","SOGoContactsCategories","defaultContactsCategories","$setDirty","resetCalendarCategories","SOGoCalendarCategories","defaultCalendarCategories","SOGoCalendarCategoriesColorsValues","values","addCalendarCategory","resetCalendarCategoryValidity","removeCalendarCategory","addContactCategory","removeContactCategory","onMailAutoMarkAsReadDelay","addMailAccount","ev","AuxiliaryMailAccounts","isNew","email","receipts","receiptAction","receiptNonRecipientAction","receiptOutsideDomainAction","receiptAnyAction","show","targetEvent","locals","CDefaultsSize","isArray","settings","Mail","ExpandedFolders","$omit","editMailAccount","data","cloneDeep","catch","noop","removeMailAccount","resetMailLabelValidity","addMailLabel","guid","SOGoMailLabelsColorsKeys","SOGoMailLabelsColorsValues","removeMailLabel","addMailFilter","active","SOGoMailLabelsColors","SOGoSieveFilters","editMailFilter","copy","removeMailFilter","onFiltersOrderChanged","_onFiltersOrderChanged","difference","Vacation","autoReplyEmailAddresses","addDefaultEmailAddresses","v","isDefined","union","userFilter","search","excludedUsers","minimumSearchLength","$filter","users","user","$$image","image","avatar","c_emailLine truncated
|
||||
{"version":3,"file":"Preferences.js","sources":["Preferences/Preferences.app.js","Preferences/AccountDialogController.js","Preferences/FiltersDialogController.js","Preferences/PreferencesController.js"],"names":["configure","$stateProvider","$urlServiceProvider","state","abstract","views","preferences","templateUrl","controller","controllerAs","url","module","rules","otherwise","runBlock","$window","$log","$transitions","$state","DebugEnabled","defaultErrorHandler","onError","to","transition","name","ignored","error","detail","go","angular","config","run","$inject","AccountDialogController","$timeout","$mdDialog","FileUploader","Dialog","Settings","defaults","account","accountId","mailCustomFromEnabled","maxSize","vm","this","usesSSO","usesCASAuthentication","usesSAML2Authentication","_loadCertificate","security","hasCertificate","$certificate","then","crt","certificate","filterByExtension","item","isP12File","type","indexOf","test","form","certificateFilename","$setValidity","defaultPort","hostnameRE","emailRE","String","addressesSearchText","ckConfig","autoGrow_minHeight","removeButtons","language","ckLocaleCode","encryption","uploader","activeUser","join","autoUpload","queueLimit","filters","fn","onAfterAddingFile","file","onSuccessItem","response","status","headers","clearQueue","_","assign","$$certificate","onErrorItem","alert","l","hasIdentities","filter","identities","isEditableIdentity","length","identity","isReadOnly","selectIdentity","index","selectedIdentity","hasDefaultIdentity","findIndex","isDefault","setDefaultIdentity","$event","$index","forEach","i","stopPropagation","canRemoveIdentity","removeIdentity","splice","addIdentity","firstReadonlyIndex","customFromIsReadonly","fullName","Math","max","showCkEditor","SOGoMailComposeMessageType","filterEmailAddresses","$query","defaultEmailAddresses","address","toLowerCase","importCertificate","queue","formData","password","certificatePassword","uploadItem","onBeforeUploadCertificate","removeCertificate","$removeCertificate","cancel","save","JSON","stringify","hide","FiltersDialogController","$scope","mailboxes","labels","validateForwardAddress","Preferences","sieveCapabilities","forwardEnabled","notificationEnabled","vacationEnabled","fieldLabels","subject","from","cc","to_or_cc","size","header","body","methodLabels","discard","keep","stop","redirect","notify","reject","fileinto","addflag","methods","intersection","keys","numberOperatorLabels","under","over","textOperatorLabels","is","is_not","contains","contains_not","matches","matches_not","regex","regex_not","hasRulesAndActions","requirements","actions","match","push","every","a","invalid","method","action","argument","err","message","addMailFilterRule","event","field","operator","removeMailFilterRule","addMailFilterAction","removeMailFilterAction","PreferencesController","$q","$mdMedia","$mdSidenav","$mdToast","sgSettings","focus","User","Account","Authentication","AddressBook","Date","beginOfDay","_loadAllMailboxes","mail","id","$getMailboxes","allMailboxes","$flattenMailboxes","all","domain","domains","forwardConstraints","defaultAddresses","adr","split","Error","forwardConstraintsDomains","$onInit","passwords","newPassword","newPasswordConfirmation","oldPassword","timeZonesList","timeZonesSearchText","autocomplete","forward","notification","mailLabelKeyRE","RegExp","emailSeparatorKeys","Notification","notificationMessage","notificationTranslated","SOGoMailAutoMarkAsReadMode","mailAutoMarkAsReadDelay","SOGoMailAutoMarkAsReadDelay","SOGoAlternateAvatar","$alternateAvatar","sieveVariablesCapability","hasActiveExternalSieveScripts","updateVacationDates","$valid","close","onLanguageChange","confirm","ok","quick","location","reload","onDesktopNotificationsChange","SOGoDesktopNotifications","authorizeNotifications","resetContactsCategories","SOGoContactsCategories","defaultContactsCategories","$setDirty","resetCalendarCategories","SOGoCalendarCategories","defaultCalendarCategories","SOGoCalendarCategoriesColorsValues","values","addCalendarCategory","resetCalendarCategoryValidity","removeCalendarCategory","addContactCategory","removeContactCategory","onMailAutoMarkAsReadDelay","addMailAccount","ev","AuxiliaryMailAccounts","isNew","email","receipts","receiptAction","receiptNonRecipientAction","receiptOutsideDomainAction","receiptAnyAction","show","targetEvent","locals","CDefaultsSize","isArray","settings","Mail","ExpandedFolders","$omit","editMailAccount","data","cloneDeep","catch","noop","removeMailAccount","resetMailLabelValidity","addMailLabel","guid","SOGoMailLabelsColorsKeys","SOGoMailLabelsColorsValues","removeMailLabel","addMailFilter","active","SOGoMailLabelsColors","SOGoSieveFilters","editMailFilter","copy","removeMailFilter","onFiltersOrderChanged","_onFiltersOrderChanged","difference","Vacation","autoReplyEmailAddresses","addDefaultEmailAddresses","v","isDefined","union","userFilter","search","excludedUsers","minimumSearchLength","$filter","users","user","$$image","image","avatar","c_emailLine truncated
|
||||
@@ -394,6 +394,13 @@
|
||||
$window.forwardConstraintsDomains.indexOf(domain) < 0) {
|
||||
throw new Error(l("You are not allowed to forward your messages to this domain:") + " " + domain);
|
||||
}
|
||||
else if ($window.forwardConstraints == 3 &&
|
||||
domains.indexOf(domain) < 0 &&
|
||||
($window.forwardConstraintsDomains.length > 0 &&
|
||||
$window.forwardConstraintsDomains.indexOf(domain) < 0)) {
|
||||
// If constraints mode is 3 and the domain is not an internal nor in forwardConstraintsDomains list, throw an error
|
||||
throw new Error(l("You are not allowed to forward your messages to this domain:")+ " " + domain);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user