Monotone-Parent: ac5956502faf7c4b91df6d48458fad8d43190b66
Monotone-Revision: 4aaa3d89a907d67df8c23bdce5f9fb5be71e663d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-04-12T00:34:43 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
5be8b033ce
commit
4063ec97a6
|
@ -18,7 +18,7 @@
|
|||
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA.
|
||||
*/
|
||||
// $Id: SOGoFreeBusyObject.m 1011 2007-01-13 00:07:16Z wolfgang $
|
||||
// $Id: SOGoFreeBusyObject.m 1045 2007-04-11 20:13:07Z wolfgang $
|
||||
|
||||
#import <NGCards/iCalCalendar.h>
|
||||
#import <NGCards/iCalFreeBusy.h>
|
||||
|
|
|
@ -218,28 +218,28 @@
|
|||
return [contactFolders allValues];
|
||||
}
|
||||
|
||||
- (NSString *) roleOfUser: (NSString *) uid
|
||||
{
|
||||
NSArray *roles, *traversalPath;
|
||||
NSString *objectName, *role;
|
||||
// - (NSString *) roleOfUser: (NSString *) uid
|
||||
// {
|
||||
// NSArray *roles, *traversalPath;
|
||||
// NSString *objectName, *role;
|
||||
|
||||
role = nil;
|
||||
traversalPath = [context objectForKey: @"SoRequestTraversalPath"];
|
||||
if ([traversalPath count] > 2)
|
||||
{
|
||||
objectName = [traversalPath objectAtIndex: 2];
|
||||
roles = [[context activeUser]
|
||||
rolesForObject: [self lookupName: objectName
|
||||
inContext: context
|
||||
acquire: NO]
|
||||
inContext: context];
|
||||
if ([roles containsObject: SOGoRole_Assistant]
|
||||
|| [roles containsObject: SOGoRole_Delegate])
|
||||
role = SOGoRole_Assistant;
|
||||
}
|
||||
// role = nil;
|
||||
// traversalPath = [context objectForKey: @"SoRequestTraversalPath"];
|
||||
// if ([traversalPath count] > 2)
|
||||
// {
|
||||
// objectName = [traversalPath objectAtIndex: 2];
|
||||
// roles = [[context activeUser]
|
||||
// rolesForObject: [self lookupName: objectName
|
||||
// inContext: context
|
||||
// acquire: NO]
|
||||
// inContext: context];
|
||||
// if ([roles containsObject: SOGoRole_Assistant]
|
||||
// || [roles containsObject: SOGoRole_Delegate])
|
||||
// role = SOGoRole_Assistant;
|
||||
// }
|
||||
|
||||
return role;
|
||||
}
|
||||
// return role;
|
||||
// }
|
||||
|
||||
- (BOOL) davIsCollection
|
||||
{
|
||||
|
|
|
@ -37,17 +37,16 @@ static NSString *AgenorShareLoginMarker = @".-.";
|
|||
|
||||
/* listing the available mailboxes */
|
||||
|
||||
- (BOOL)isInHomeFolderBranchOfLoggedInAccount:(id)_ctx {
|
||||
id user;
|
||||
|
||||
user = [_ctx activeUser];
|
||||
return [[[self container] nameInContainer] isEqualToString:[user login]];
|
||||
- (BOOL) isInHomeFolderBranchOfLoggedInAccount: (NSString *) userLogin
|
||||
{
|
||||
return [[[self container] nameInContainer] isEqualToString: userLogin];
|
||||
}
|
||||
|
||||
- (NSArray *)toManyRelationshipKeys {
|
||||
id user;
|
||||
SOGoUser *user;
|
||||
id account;
|
||||
NSArray *shares;
|
||||
NSString *userLogin;
|
||||
|
||||
/*
|
||||
Note: this is not strictly correct. The accounts being retrieved should be
|
||||
|
@ -60,15 +59,16 @@ static NSString *AgenorShareLoginMarker = @".-.";
|
|||
=> TODO
|
||||
*/
|
||||
user = [context activeUser];
|
||||
userLogin = [user login];
|
||||
|
||||
/* for now: return nothing if the home-folder does not belong to the login */
|
||||
if (![self isInHomeFolderBranchOfLoggedInAccount: context]) {
|
||||
if (![self isInHomeFolderBranchOfLoggedInAccount: userLogin]) {
|
||||
[self warnWithFormat:@"User %@ tried to access mail hierarchy of %@",
|
||||
[user login], [[self container] nameInContainer]];
|
||||
return nil;
|
||||
}
|
||||
|
||||
account = [user valueForKey:@"primaryIMAP4AccountString"];
|
||||
account = [user primaryIMAP4AccountString];
|
||||
if ([account isNotNull]) account = [NSArray arrayWithObject:account];
|
||||
|
||||
if ([self isInternetRequest]) /* only show primary mailbox in Internet */
|
||||
|
@ -141,16 +141,20 @@ static NSString *AgenorShareLoginMarker = @".-.";
|
|||
return [ct autorelease];
|
||||
}
|
||||
|
||||
- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
|
||||
- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag
|
||||
{
|
||||
id obj;
|
||||
NSString *userLogin;
|
||||
|
||||
userLogin = [[context activeUser] login];
|
||||
|
||||
/* first check attributes directly bound to the application */
|
||||
if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]))
|
||||
return obj;
|
||||
|
||||
if (![self isInHomeFolderBranchOfLoggedInAccount:_ctx]) {
|
||||
if (![self isInHomeFolderBranchOfLoggedInAccount: userLogin]) {
|
||||
[self warnWithFormat:@"User %@ tried to access mail hierarchy of %@",
|
||||
[[_ctx activeUser] login], [[self container] nameInContainer]];
|
||||
userLogin, [[self container] nameInContainer]];
|
||||
|
||||
return [NSException exceptionWithHTTPStatus:403 /* Forbidden */
|
||||
reason:@"Tried to access the mail of another user"];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// $Id: UIxAppointmentView.h 768 2005-07-15 00:13:01Z helge $
|
||||
// $Id: UIxAppointmentView.h 1045 2007-04-11 20:13:07Z wolfgang $
|
||||
|
||||
#ifndef __SOGo_UIxAppointmentView_H__
|
||||
#define __SOGo_UIxAppointmentView_H__
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// $Id: UIxCalView.h 1040 2007-04-02 21:29:40Z wolfgang $
|
||||
// $Id: UIxCalView.h 1045 2007-04-11 20:13:07Z wolfgang $
|
||||
|
||||
#ifndef __SOGo_UIxCalView_H__
|
||||
#define __SOGo_UIxCalView_H__
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// $Id: UIxCalView.m 1040 2007-04-02 21:29:40Z wolfgang $
|
||||
// $Id: UIxCalView.m 1045 2007-04-11 20:13:07Z wolfgang $
|
||||
|
||||
#import "common.h"
|
||||
//#import <OGoContentStore/OCSFolder.h>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA.
|
||||
*/
|
||||
// $Id: UIxTimeDateControl.m 1033 2007-03-22 19:04:08Z wolfgang $
|
||||
// $Id: UIxTimeDateControl.m 1045 2007-04-11 20:13:07Z wolfgang $
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
|
Loading…
Reference in New Issue