Skip to content

Commit

Permalink
feat(core): Add mobile provisioning download for Apple's devices. Fix…
Browse files Browse the repository at this point in the history
… nil port when using standard http configuration (port 80 and 443)
  • Loading branch information
WoodySlum committed Dec 4, 2023
1 parent da24c0d commit cd50ee0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion SoObjects/SOGo/SOGoMobileProvision.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ + (NSString *)_plistWithContext:(WOContext *)context andPath:(NSString *)path an
NSDictionary *provisioning;
NSError *error;
NSString *payloadType, *prefix, *type;
NSNumber *port;

activeUser = [context activeUser];
serverURL = [context serverURL];
Expand All @@ -57,11 +58,20 @@ + (NSString *)_plistWithContext:(WOContext *)context andPath:(NSString *)path an
break;
}

port = [serverURL port];
if (!port) {
if ([[serverURL scheme] isEqualToString:@"https"]) {
port = [NSNumber numberWithInt: 443];
} else {
port = [NSNumber numberWithInt: 80];
}
}

provisioning = [NSDictionary dictionaryWithObjectsAndKeys:
[NSArray arrayWithObject: [NSDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithFormat:@"%@ %@", type, name], [NSString stringWithFormat:@"%@%@", prefix, @"AccountDescription"],
[serverURL host], [NSString stringWithFormat:@"%@%@", prefix, @"HostName"],
[serverURL port], [NSString stringWithFormat:@"%@%@", prefix, @"Port"],
port, [NSString stringWithFormat:@"%@%@", prefix, @"Port"],
path, [NSString stringWithFormat:@"%@%@", prefix, @"PrincipalURL"],
[NSNumber numberWithBool:[[serverURL scheme] isEqualToString:@"https"]], [NSString stringWithFormat:@"%@%@", prefix, @"UseSSL"],
[activeUser login], [NSString stringWithFormat:@"%@%@", prefix, @"Username"],
Expand Down

0 comments on commit cd50ee0

Please sign in to comment.