Monotone-Parent: 2946be96e24ef28355163488376def0341ef650f

Monotone-Revision: 57efdfff0ce1c589f0aa7c70ace7f877ffa5d52c

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-08-26T17:40:02
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-08-26 17:40:02 +00:00
parent 335d43c92c
commit 8f9d53726f
11 changed files with 128 additions and 6 deletions
+37 -6
View File
@@ -27,6 +27,7 @@
#import <NGObjWeb/NSException+HTTP.h>
#import <NGObjWeb/SoClassSecurityInfo.h>
#import <NGObjWeb/SoSecurityManager.h>
#import <NGObjWeb/WOApplication.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGObjWeb/WORequest.h>
#import <NGObjWeb/WOResponse.h>
@@ -44,6 +45,8 @@
#import <Contacts/SOGoContactFolders.h>
#import <Mailer/SOGoMailAccounts.h>
#import <SOGoUI/UIxComponent.h>
#import "NSArray+Utilities.h"
#import "NSDictionary+Utilities.h"
#import "LDAPUserManager.h"
@@ -442,6 +445,26 @@
return [$(@"SOGoFreeBusyObject") objectWithName: _key inContainer: self];
}
- (WOResponse *) _moduleAccessDeniedPage
{
WOResponse *response;
UIxComponent *page;
NSString *content;
response = [context response];
[response setStatus: 403];
[response setHeader: @"text/html; charset=utf8"
forKey: @"content-type"];
page = [[WOApplication application] pageWithName: @"UIxModuleAccessDenied"
inContext: context];
// [page appendToResponse: response
// inContext: context];
content = [[page generateResponse] contentAsString];
[response appendContentString: content];
return response;
}
- (id) lookupName: (NSString *) _key
inContext: (WOContext *) _ctx
acquire: (BOOL) _flag
@@ -454,14 +477,22 @@
if (!obj)
{
currentUser = [_ctx activeUser];
if ([_key isEqualToString: @"Calendar"]
&& [currentUser canAccessModule: _key])
obj = [self privateCalendars: @"Calendar" inContext: _ctx];
if ([_key isEqualToString: @"Calendar"])
{
if ([currentUser canAccessModule: _key])
obj = [self privateCalendars: @"Calendar" inContext: _ctx];
else
obj = [self _moduleAccessDeniedPage];
}
else if ([_key isEqualToString: @"Contacts"])
obj = [self privateContacts: _key inContext: _ctx];
else if ([_key isEqualToString: @"Mail"]
&& [currentUser canAccessModule: _key])
obj = [self mailAccountsFolder: _key inContext: _ctx];
else if ([_key isEqualToString: @"Mail"])
{
if ([currentUser canAccessModule: _key])
obj = [self mailAccountsFolder: _key inContext: _ctx];
else
obj = [self _moduleAccessDeniedPage];
}
else if ([_key isEqualToString: @"Preferences"])
obj = [$(@"SOGoPreferencesFolder") objectWithName: _key
inContainer: self];
@@ -40,3 +40,6 @@
= "U bent al op deze map geabonneerd!";
"The user rights cannot be edited for this object!"
= "De machtigingen kunnen niet worden aangepast voor dit object!";
"You are not allowed to access this module or this system. Please contact your system administrator."
= "You are not allowed to access this module or this system. Please contact your system administrator.";
@@ -41,3 +41,6 @@
= "You have already subscribed to that folder!";
"The user rights cannot be edited for this object!"
= "The user rights cannot be edited for this object!";
"You are not allowed to access this module or this system. Please contact your system administrator."
= "You are not allowed to access this module or this system. Please contact your system administrator.";
@@ -38,3 +38,6 @@
= "Vous êtes déja abonné à ce dossier.";
"The user rights cannot be edited for this object!"
= "Les droits sur cet objet ne peuvent pas être édités.";
"You are not allowed to access this module or this system. Please contact your system administrator."
= "Vous n'êtes pas autorisé à accéder à ce module ou ce système. Veuillez contacter votre administrateur système.";
@@ -40,3 +40,6 @@
= "Sie haben diesen Ordner bereits abonniert!";
"The user rights cannot be edited for this object!"
= "Die Benutzer-Rechte können für dieses Objekt nicht verändert werden!";
"You are not allowed to access this module or this system. Please contact your system administrator."
= "You are not allowed to access this module or this system. Please contact your system administrator.";
@@ -35,3 +35,6 @@
"Unable to rename that folder!" = "Impossibile rinominare la cartella!";
"You have already subscribed to that folder!" = "Hai già sottoscritto la cartella!";
"The user rights cannot be edited for this object!" = "I permessi di questo oggetto non possono essere modificati!";
"You are not allowed to access this module or this system. Please contact your system administrator."
= "You are not allowed to access this module or this system. Please contact your system administrator.";
@@ -45,3 +45,6 @@
= "Ya se ha suscrito a esta carpeta.";
"The user rights cannot be edited for this object!"
= "No es posible modificar los permisos de acceso a este objeto.";
"You are not allowed to access this module or this system. Please contact your system administrator."
= "You are not allowed to access this module or this system. Please contact your system administrator.";
+1
View File
@@ -23,6 +23,7 @@ libSOGoUI_OBJC_FILES += \
\
UIxJSClose.m \
UIxComponent.m \
UIxModuleAccessDenied.m \
SOGoAptFormatter.m \
WOContext+UIx.m \
SOGoACLAdvisory.m \
+27
View File
@@ -0,0 +1,27 @@
/* UIxModuleAccessDenied.h - this file is part of SOGo
*
* Copyright (C) 2008 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import "UIxComponent.h"
@interface UIxModuleAccessDenied : UIxComponent
@end
+27
View File
@@ -0,0 +1,27 @@
/* UIxModuleAccessDenied.m - this file is part of SOGo
*
* Copyright (C) 2008 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import "UIxModuleAccessDenied.h"
@implementation UIxModuleAccessDenied
@end
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE var:component>
<var:component xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:label="OGo:label"
xmlns:rsrc="OGo:url"
className="UIxPageFrame"
title="title"
const:toolbar="none"
const:cssFiles="UIxModuleAccessDenied.css"
const:popup="YES">
<div id="messageWindow">
<var:string label:value="You are not allowed to access this module or this system. Please contact your system administrator."
/>
</div>
</var:component>