mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-16 04:05:55 +00:00
We can now show links to the address book
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* UIxContactFoldersView.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2006-2013 Inverse inc.
|
||||
* Copyright (C) 2006-2014 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -38,6 +38,7 @@
|
||||
#import <GDLContentStore/GCSFolderManager.h>
|
||||
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoSystemDefaults.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <SOGo/SOGoUserManager.h>
|
||||
@@ -418,4 +419,10 @@ Class SOGoContactSourceFolderK, SOGoGCSFolderK;
|
||||
return [super defaultAction];
|
||||
}
|
||||
|
||||
- (BOOL) isPublicAccessEnabled
|
||||
{
|
||||
// NOTE: This method is the same found in Common/UIxAclEditor.m
|
||||
return [[SOGoSystemDefaults sharedSystemDefaults] enablePublicAccess];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2006-2012 Inverse inc.
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
Copyright (C) 2006-2014 Inverse inc.
|
||||
|
||||
This file is part of SOGo.
|
||||
|
||||
@@ -24,6 +23,7 @@
|
||||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSString+Utilities.h>
|
||||
#import <SoObjects/SOGo/SOGoSystemDefaults.h>
|
||||
|
||||
#import <NGObjWeb/NSException+HTTP.h>
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
@@ -179,6 +179,8 @@
|
||||
data = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[[self clientObject] nameInContainer], @"id",
|
||||
newContactsList, @"cards",
|
||||
[self cardDavURL], @"cardDavURL",
|
||||
[self publicCardDavURL], @"publicCardDavURL",
|
||||
nil];
|
||||
|
||||
result = [self responseWithStatus: 200
|
||||
@@ -255,4 +257,40 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
- (NSString *) cardDavURL
|
||||
{
|
||||
NSString *davURL, *baseCardDAVURL;
|
||||
|
||||
davURL = @"";
|
||||
|
||||
if ([[self clientObject] respondsToSelector: @selector(realDavURL)])
|
||||
davURL = [[[self clientObject] realDavURL] absoluteString];
|
||||
|
||||
if ([davURL hasSuffix: @"/"])
|
||||
baseCardDAVURL = [davURL substringToIndex: [davURL length] - 1];
|
||||
else
|
||||
baseCardDAVURL = davURL;
|
||||
|
||||
return [NSString stringWithFormat: @"%@/", baseCardDAVURL];
|
||||
}
|
||||
|
||||
- (NSString *) publicCardDavURL
|
||||
{
|
||||
if ([[self clientObject] respondsToSelector: @selector(publicDavURL)] &&
|
||||
[[SOGoSystemDefaults sharedSystemDefaults] enablePublicAccess])
|
||||
{
|
||||
NSString *davURL, *basePublicCardDAVURL;
|
||||
|
||||
davURL = [[[self clientObject] publicDavURL] absoluteString];
|
||||
if ([davURL hasSuffix: @"/"])
|
||||
basePublicCardDAVURL = [davURL substringToIndex: [davURL length] - 1];
|
||||
else
|
||||
basePublicCardDAVURL = davURL;
|
||||
|
||||
return [NSString stringWithFormat: @"%@/", basePublicCardDAVURL];
|
||||
}
|
||||
|
||||
return @"";
|
||||
}
|
||||
|
||||
@end /* UIxContactsListActions */
|
||||
|
||||
Reference in New Issue
Block a user