All Classes Namespaces Files Functions Variables Groups
Session.idl
Go to the documentation of this file.
1 /**
2  * @file Session.idl
3  * @brief Currently logged user manager
4  *
5  * @author Frantisek Boranek, Dusan Juhas
6  *
7  * @copyright Copyright © 2017 Kerio Technologies s.r.o.
8  *
9  * @defgroup Server
10  * @{
11  */
12 
13 #import <Structures.idl>
14 #import <common.idl>
15 #import <MobileCommon.idl>
16 
17 module kerio {
18 module jsonapi {
19 module webmail {
20 module session {
21 
22 /**
23  * Details of the logged user into the webmail.
24  */
25 struct UserInfo {
26  kerio::web::KId id; ///< [READ-ONLY] global id of user
27  string loginName; ///< [READ-ONLY] loginName name, also primary email address
28  string fullName; ///< [READ-ONLY] full name
29  kerio::web::StringList emails; ///< [READ-ONLY]
30  string preferredAddress; ///< preferred address
31  string replyToAddress; ///< address for reply
32 };
33 
35  boolean isEnabled;
36  string text;
37  boolean isTimeRangeEnabled;
38  UtcDateTime timeRangeStart;
39  UtcDateTime timeRangeEnd;
40 };
41 
42 struct SpamSettings {
43  boolean isEnabled; // If enabled then spam is moved to the Junk E-mail folder
44  boolean whiteListContacts; // Also trust senders from Contacts folder
45  boolean autoupdateWhiteList; // If enable e-mail address of original sender will be added into white list while sending reply
46  kerio::web::StringList whiteList; // Trust to these senders
47 };
48 
49 /**
50  * Stores user's quota info
51  */
52 struct QuotaInfo {
53  long messagesLimit; ///< Maximum number of messages that current user is allowed to have, value 0 means user has no limit
54  long messagesUsed; ///< Number of messages that curent user has
55  longlong spaceLimit; ///< Maximum amount of space [Bytes] reserved for current user, value 0 means user has no limit
56  longlong spaceUsed; ///< Amount of space [Bytes] consumed by current user
57  long percentLimitForWarning; ///< Value in percent that user has to exceed to be warned
58 };
59 
60 /**
61  * If this policy is enabled, passwords must meet the following minimum requirements when they are changed or created:
62  *
63  * - Passwords must not contain the user's entire and checks are not case sensitive
64  * - Passwords must contain characters from three of the following five categories:
65  * - Uppercase characters of European languages (A through Z, with diacritic marks, Greek and Cyrillic characters)
66  * - Lowercase characters of European languages (a through z, sharp-s, with diacritic marks, Greek and Cyrillic characters)
67  * - Base 10 digits (0 through 9)
68  * - Nonalphanumeric characters: ~!@#$%^&*_-+=`|\(){}[]:;"'<>,.?/
69  * - Any Unicode character that is categorized as an alphabetic character but is not uppercase or lowercase. This includes Unicode characters from Asian languages.
70  */
72  boolean isEnabled;
73  long minLength;
74 };
75 
76 /**
77  * Currently logged user manager
78  */
79 interface Session {
80 
81  /*
82  * Verify whether is user eligible to change his/her password.
83  *
84  * @param isEligible - is set to true as long as user is eligible
85  * to change his/her password.
86  */
87  void canUserChangePassword(out boolean isEligible);
88 
89  /**
90  * Get list of all available time zones.
91  *
92  * @param zones - list of time zones
93  */
94  void getAvailableTimeZones(out kerio::web::StringList zones);
95 
96  /**
97  * Get list of all languages supported by server.
98  *
99  * @param settings - details
100  */
101  void getAvailableLanguages(out LangDescriptionList languages);
102 
103  /**
104  * Obtain the Auto Reply settings
105  *
106  * @param settings - details
107  */
108  void getOutOfOffice(out OutOfOfficeSettings settings);
109 
110  /**
111  * Obtain iformations about quota of current user.
112  */
113  void getQuotaInformation(out QuotaInfo quotaInfo);
114 
115  /**
116  * Obtain currently logged user's settings.
117  *
118  * @param settings - WAM settings
119  */
120  void getSettings(out jsonstring settings, in SettingQuery query);
121 
122  /**
123  * Obtain the spam settings
124  *
125  * @param settings - details
126  */
127  void getSpamSettings(out SpamSettings settings);
128 
129  /**
130  * Obtain URL for users' access to UserVoice
131  *
132  * @param accessUrl - URL for access to UserVoice
133  */
134  void getUserVoiceUrl(out string accessUrl);
135 
136  /**
137  * Log in given user.
138  *
139  * @param token
140  * @param userName
141  * @param password
142  * @param application - application descriminator, note that with session to admin you cannot log in webmail
143  */
144  [KLoginMethod]
145  void login(out string token, in string userName, in string password, in kerio::web::ApiApplication application);
146 
147  /**
148  * Logout callee.
149  */
150  [KLogoutMethod]
151  void logout(out string redirectUrl);
152 
153  /**
154  * Set the Auto Reply settings
155  *
156  * @param settings - details
157  */
158  void setOutOfOffice(in OutOfOfficeSettings settings);
159 
160  /**
161  * Change password of current user.
162  *
163  * @param currentPassword - current users' password
164  * @param newPassword - new users' password
165  */
166  void setPassword(in string currentPassword, in string newPassword);
167 
168  /**
169  * Set settings of the currently logged user.
170  *
171  * @param settings - WAM settings
172  */
173  void setSettings(in jsonstring settings);
174 
175  /**
176  * Set the spam settings
177  *
178  * @param settings - details
179  */
180  void setSpamSettings(in SpamSettings settings);
181 
182  /**
183  * Set user details.
184  *
185  * @param userDetails - details about the currently logged user
186  */
187  void setUserInfo(in UserInfo userDetails);
188 
189  /**
190  * Determines the currently logged user (caller).
191  *
192  * @param userDetails - details about the currently logged user
193  */
194  void whoAmI(out UserInfo userDetails);
195 
196  /**
197  * Obtain a list of mobile devices of given user.
198  *
199  * @param list - mobile devices of given user
200  * @param totalItems - number of mobile devices found for given user
201  * @param query - query attributes and limits
202  */
203  void getMobileDeviceList(out kerio::jsonapi::mobile::MobileDeviceList list, out long totalItems, in kerio::web::SearchQuery query);
204 
205  /**
206  * Remove mobile device from the list of user's mobile devices.
207  *
208  * @param deviceId - ID of user's mobile device to be removed
209  */
210  void removeMobileDevice(in string deviceId);
211 
212  /**
213  * Wipe user's mobile device.
214  *
215  * @param deviceId - ID of user's mobile device to be wiped
216  * @param password - password of current user
217  */
218  void wipeMobileDevice(in string deviceId, in string password);
219 
220  /**
221  * Cancel wiping of user's mobile device.
222  *
223  * @param deviceId - ID of user's mobile device to cancel wipe
224  */
225  void cancelWipeMobileDevice(in string deviceId);
226 
227  /**
228  * Obtain list of images stored in user account
229  */
230  void getSignatureImageList(out ImageList list);
231 
232  /**
233  * Add image into user's store
234  *
235  * @param errors - list of errors
236  * @param result - succesfuly added images
237  * @param ids - Upload IDs of images to add into user's store
238  */
239  void addSignatureImage(out kerio::web::ErrorList errors, out ImageList result, in kerio::web::KIdList ids);
240 
241  /**
242  * Remove image from user's store
243  *
244  * @param ids - Image IDs to remove
245  */
246  void removeSignatureImage(out kerio::web::ErrorList errors, in kerio::web::KIdList ids);
247 };
248 
249 }; }; }; }; // end of namespace
250 
251 /**
252  * @}
253  */