Avoid redirection to forbidden module

pull/218/merge
Francis Lachapelle 2017-11-22 10:02:47 -05:00
parent d6e74cf9cb
commit a7b32e8c6d
2 changed files with 5 additions and 3 deletions

1
NEWS
View File

@ -17,6 +17,7 @@ Enhancements
- [web] now also give modify permission when selecting all calendar rights
- [web] allow edition of IMAP flags associated to mail labels
- [web] search scope of address book is now respected
- [web] avoid redirection to forbidden module (via ModulesConstraints)
Bug fixes
- [core] yearly repeating events are not shown in web calendar (#4237)

View File

@ -1,6 +1,6 @@
/* SOGoUserHomePage.m - this file is part of SOGo
*
* Copyright (C) 2007-2015 Inverse inc.
* Copyright (C) 2007-2017 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
@ -76,11 +76,12 @@
loginModule = [ud loginModule];
if (!([loginModule isEqualToString: @"Calendar"]
|| [loginModule isEqualToString: @"Contacts"]
|| [loginModule isEqualToString: @"Mail"]))
|| [loginModule isEqualToString: @"Mail"])
|| ![[context activeUser] canAccessModule: loginModule])
{
[self errorWithFormat: @"login module '%@' not accepted (must be"
@"'Calendar', 'Contacts' or 'Mail')", loginModule];
loginModule = @"Calendar";
loginModule = @"Contacts";
}
// We check if we must write the Sieve scripts to the server