1 /* 2 Copyright (C) 2006-2015 Inverse inc. 3 Copyright (C) 2005 SKYRIX Software AG 4 5 This file is part of SOGo. 6 7 SOGo is free software; you can redistribute it and/or modify it under 8 the terms of the GNU Lesser General Public License as published by the 9 Free Software Foundation; either version 2, or (at your option) any 10 later version. 11 12 SOGo is distributed in the hope that it will be useful, but WITHOUT ANY 13 WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 15 License for more details. 16 17 You should have received a copy of the GNU Lesser General Public 18 License along with OGo; see the file COPYING. If not, write to the 19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 20 02111-1307, USA. 21 */ 22 23 #ifndef __SOGoUser_H__ 24 #define __SOGoUser_H__ 25 26 #import <NGObjWeb/SoUser.h> 27 28 /* 29 SOGoUser 30 31 This adds some additional SOGo properties to the SoUser object. The 32 properties are (currently) looked up using the SOGoUserManager. 33 34 You have access to this object from the WOContext: 35 context.activeUser 36 */ 37 38 @class NSArray; 39 @class NSDictionary; 40 @class NSMutableArray; 41 @class NSMutableDictionary; 42 @class NSString; 43 44 @class WOContext; 45 46 @class SOGoAppointmentFolder; 47 @class SOGoAppointmentFolders; 48 @class SOGoContactFolder; 49 @class SOGoDateFormatter; 50 @class SOGoDomainDefaults; 51 @class SOGoUserDefaults; 52 @class SOGoUserFolder; 53 @class SOGoUserProfile; 54 @class SOGoUserSettings; 55 56 @protocol SOGoSource; 57 58 @interface SOGoUser : SoUser 59 { 60 SOGoUserDefaults *_defaults; 61 SOGoDomainDefaults *_domainDefaults; 62 SOGoUserSettings *_settings; 63 SOGoUserFolder *homeFolder; 64 NSString *currentPassword; 65 NSString *loginInDomain; 66 //NSString *language; 67 NSArray *allEmails; 68 NSMutableArray *mailAccounts; 69 NSString *cn; 70 } 71 72 + (SOGoUser *) userWithLogin: (NSString *) newLogin; 73 74 + (SOGoUser *) userWithLogin: (NSString *) login 75 roles: (NSArray *) roles; 76 77 + (SOGoUser *) userWithLogin: (NSString *) login 78 roles: (NSArray *) roles 79 trust: (BOOL) b; 80 81 - (id) initWithLogin: (NSString *) newLogin 82 roles: (NSArray *) newRoles 83 trust: (BOOL) b; 84 85 - (void) setPrimaryRoles: (NSArray *) newRoles; 86 87 - (void) setCurrentPassword: (NSString *) newPassword; 88 - (NSString *) currentPassword; 89 90 - (NSString *) loginInDomain; 91 92 /* properties */ 93 - (NSString *) domain; 94 - (id <SOGoSource>) authenticationSource; 95 96 - (NSArray *) allEmails; 97 - (BOOL) hasEmail: (NSString *) email; 98 - (NSString *) systemEmail; 99 - (NSString *) cn; 100 101 - (SOGoDateFormatter *) dateFormatterInContext: (WOContext *) context; 102 103 /* defaults */ 104 - (SOGoUserDefaults *) userDefaults; 105 - (SOGoDomainDefaults *) domainDefaults; 106 - (SOGoUserSettings *) userSettings; 107 108 - (NSCalendarDate *) firstDayOfWeekForDate: (NSCalendarDate *) date; 109 - (unsigned int) dayOfWeekForDate: (NSCalendarDate *) date; 110 111 - (NSCalendarDate *) firstWeekOfYearForDate: (NSCalendarDate *) date; 112 - (unsigned int) weekNumberForDate: (NSCalendarDate *) date; 113 114 - (NSArray *) mailAccounts; 115 - (NSDictionary *) accountWithName: (NSString *) accountName; 116 - (NSArray *) allIdentities; 117 - (NSDictionary *) primaryIdentity; 118 - (NSMutableDictionary *) defaultIdentity; 119 120 - (BOOL) isSuperUser; 121 - (BOOL) canAuthenticate; 122 123 /* resource */ 124 - (BOOL) isResource; 125 - (int) numberOfSimultaneousBookings; 126 127 /* module access */ 128 - (BOOL) canAccessModule: (NSString *) module; 129 130 /* folders */ 131 - (SOGoUserFolder *) homeFolderInContext: (id) context; 132 - (SOGoAppointmentFolders *) calendarsFolderInContext: (WOContext *) context; 133 - (SOGoAppointmentFolder *) personalCalendarFolderInContext: (WOContext *) context; 134 - (SOGoContactFolder *) personalContactsFolderInContext: (WOContext *) context; 135 136 @end 137 138 #endif /* __SOGoUser_H__ */ 139