mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-20 02:45:25 +00:00
Monotone-Parent: 509b02f4f9f2961c7946b8a808d6fe29000b8cc9
Monotone-Revision: 591189cd04bcdbe3a11183a6aca2bd58edc2ebea Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-11T19:53:02 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -504,4 +504,30 @@
|
||||
return r;
|
||||
}
|
||||
|
||||
- (SOGoWebDAVValue *) davCurrentUserPrincipal
|
||||
{
|
||||
NSDictionary *userHREF;
|
||||
NSString *usersUrl, *login;
|
||||
SOGoUser *activeUser;
|
||||
SOGoWebDAVValue *davCurrentUserPrincipal;
|
||||
|
||||
activeUser = [[self context] activeUser];
|
||||
login = [activeUser login];
|
||||
if ([login isEqualToString: @"anonymous"])
|
||||
davCurrentUserPrincipal = nil;
|
||||
else
|
||||
{
|
||||
usersUrl = [NSString stringWithFormat: @"%@%@/",
|
||||
[self davURLAsString], login];
|
||||
userHREF = davElementWithContent (@"href", XMLNS_WEBDAV, usersUrl);
|
||||
davCurrentUserPrincipal
|
||||
= [davElementWithContent (@"current-user-principal",
|
||||
XMLNS_WEBDAV,
|
||||
userHREF)
|
||||
asWebDAVValue];
|
||||
}
|
||||
|
||||
return davCurrentUserPrincipal;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user