mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-01 05:06:24 +00:00
Monotone-Parent: 108c385b2d4d62eead27a0717dfe26849f3e4968
Monotone-Revision: 9de11b8398fba6c77d839866803040e019e78660 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-17T23:05:47 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
2007-05-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Common/UIxUserRightsEditor.m ([UIxUserRightsEditor
|
||||
-_initRights]): don't take the "None" role into account when
|
||||
initializing the list of current roles.
|
||||
|
||||
* SoObjects/SOGo/SOGoPermissions.m: added a new void role
|
||||
"SOGoRole_None".
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
#import <SoObjects/SOGo/LDAPUserManager.h>
|
||||
#import <SoObjects/SOGo/SOGoPermissions.h>
|
||||
|
||||
#import "UIxUserRightsEditor.h"
|
||||
|
||||
@@ -52,10 +53,15 @@
|
||||
return uid;
|
||||
}
|
||||
|
||||
- (BOOL) userIsDefaultUser
|
||||
{
|
||||
return [uid isEqualToString: SOGoDefaultUserID];
|
||||
}
|
||||
|
||||
- (NSString *) userDisplayName
|
||||
{
|
||||
LDAPUserManager *um;
|
||||
|
||||
|
||||
um = [LDAPUserManager sharedUserManager];
|
||||
|
||||
return [NSString stringWithFormat: @"%@ <%@>",
|
||||
@@ -66,9 +72,10 @@
|
||||
- (BOOL) _initRights
|
||||
{
|
||||
BOOL response;
|
||||
NSString *newUID, *email;
|
||||
NSString *newUID;
|
||||
LDAPUserManager *um;
|
||||
SOGoObject *clientObject;
|
||||
unsigned int count;
|
||||
|
||||
response = NO;
|
||||
|
||||
@@ -76,15 +83,17 @@
|
||||
if ([newUID length] > 0)
|
||||
{
|
||||
um = [LDAPUserManager sharedUserManager];
|
||||
email = [um getEmailForUID: newUID];
|
||||
if ([email length] > 0)
|
||||
if ([newUID isEqualToString: SOGoDefaultUserID]
|
||||
|| [[um getEmailForUID: newUID] length] > 0)
|
||||
{
|
||||
ASSIGN (uid, newUID);
|
||||
clientObject = [self clientObject];
|
||||
[userRights addObjectsFromArray: [clientObject aclsForUser: uid]];
|
||||
if (![userRights count])
|
||||
[userRights addObjectsFromArray: [clientObject defaultAclRoles]];
|
||||
|
||||
count = [userRights count];
|
||||
if (!count || (count == 1 && [[userRights objectAtIndex: 0]
|
||||
isEqualToString: SOGoRole_None]))
|
||||
[userRights setArray: [clientObject defaultAclRoles]];
|
||||
|
||||
response = YES;
|
||||
}
|
||||
}
|
||||
@@ -118,8 +127,7 @@
|
||||
else
|
||||
{
|
||||
[self updateRights];
|
||||
[[self clientObject] setRoles: userRights
|
||||
forUser: uid];
|
||||
[[self clientObject] setRoles: userRights forUser: uid];
|
||||
response = [self jsCloseWithRefreshMethod: nil];
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,13 @@
|
||||
<form id="userRightsForm" const:href="saveUserRights">
|
||||
<input type="hidden" name="uid" var:value="uid"/>
|
||||
<div class="title">
|
||||
<label><var:string label:value="User rights for:"/><br/>
|
||||
<span class="value"><var:string value="userDisplayName"/></span></label>
|
||||
<var:if condition="userIsDefaultUser">
|
||||
<label><span class="value"><var:string label:value="Default Roles"
|
||||
/></span></label>
|
||||
</var:if><var:if condition="userIsDefaultUser" const:negate="YES">
|
||||
<label><var:string label:value="User rights for:"/><br/>
|
||||
<span class="value"><var:string value="userDisplayName"
|
||||
/></span></label></var:if>
|
||||
</div>
|
||||
<div class="calendarUserRights">
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
|
||||
@@ -13,8 +13,13 @@
|
||||
<form id="userRightsForm" const:href="saveUserRights">
|
||||
<input type="hidden" name="uid" var:value="uid"/>
|
||||
<div class="title">
|
||||
<label><var:string label:value="User rights for:"/><br/>
|
||||
<span class="value"><var:string value="userDisplayName"/></span></label>
|
||||
<var:if condition="userIsDefaultUser">
|
||||
<label><span class="value"><var:string label:value="Default Roles"
|
||||
/></span></label>
|
||||
</var:if><var:if condition="userIsDefaultUser" const:negate="YES">
|
||||
<label><var:string label:value="User rights for:"/><br/>
|
||||
<span class="value"><var:string value="userDisplayName"
|
||||
/></span></label></var:if>
|
||||
</div>
|
||||
<div class="calendarUserRights">
|
||||
<table>
|
||||
|
||||
Reference in New Issue
Block a user