mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-06 00:45:09 +00:00
Monotone-Parent: 5e1b27b6e34627f5e4895164179fcf344a96e20d
Monotone-Revision: 6e082f09a153b3a0152c5b9355a2001b3c542c96 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-06-07T13:15:20 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2010-06-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Common/UIxAclEditor.m (-isPublicAccessEnabled): we now expose
|
||||
the state of public access in order to not show the "anonymous"
|
||||
user when not needed.
|
||||
|
||||
2010-06-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxCalendarProperties.m (-calDavURL, -webDavICSURL)
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#import <SOGo/SOGoContentObject.h>
|
||||
#import <SOGo/SOGoGCSFolder.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoSystemDefaults.h>
|
||||
#import <SOGo/SOGoUserManager.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
|
||||
@@ -121,8 +122,7 @@
|
||||
ASSIGN (defaultUserID, [[self clientObject] defaultUserID]);
|
||||
|
||||
aclsEnum = [[self aclsForObject] objectEnumerator];
|
||||
currentUID = [aclsEnum nextObject];
|
||||
while (currentUID)
|
||||
while ((currentUID = [aclsEnum nextObject]))
|
||||
{
|
||||
if ([currentUID hasPrefix: @"@"])
|
||||
// NOTE: don't remove the prefix if we want to identify the lists visually
|
||||
@@ -131,7 +131,6 @@
|
||||
|| [currentUID isEqualToString: defaultUserID]
|
||||
|| [currentUID isEqualToString: @"anonymous"]))
|
||||
[users addObjectUniquely: currentUID];
|
||||
currentUID = [aclsEnum nextObject];
|
||||
}
|
||||
|
||||
prepared = YES;
|
||||
@@ -231,14 +230,10 @@
|
||||
inContext: context]);
|
||||
}
|
||||
|
||||
// - (id <WOActionResults>) addUserInAcls
|
||||
// {
|
||||
// SOGoObject *clientObject;
|
||||
// NSString *uid;
|
||||
|
||||
// uid = [self queryParameterForKey: @"uid"];
|
||||
|
||||
// clientObject = [self clientObject];
|
||||
// }
|
||||
- (BOOL) isPublicAccessEnabled
|
||||
{
|
||||
return [[SOGoSystemDefaults sharedSystemDefaults]
|
||||
enablePublicAccess];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -8,15 +8,18 @@
|
||||
xmlns:rsrc="OGo:url"
|
||||
className="UIxPageFrame"
|
||||
title="title"
|
||||
const:toolbar="none"
|
||||
const:popup="YES">
|
||||
<script type="text/javascript"
|
||||
><var:if condition="canSubscribeUsers">
|
||||
var canSubscribeUsers = true;
|
||||
</var:if
|
||||
><var:if condition="canSubscribeUsers" const:negate="YES">
|
||||
var canSubscribeUsers = false;
|
||||
</var:if
|
||||
></script>
|
||||
<script type="text/javascript">
|
||||
var canSubscribeUsers = <var:if condition="canSubscribeUsers"
|
||||
>true</var:if><var:if condition="canSubscribeUsers"
|
||||
const:negate="YES"
|
||||
>false</var:if>;
|
||||
var isPublicAccessEnabled = <var:if condition="isPublicAccessEnabled"
|
||||
>true</var:if><var:if condition="isPublicAccessEnabled"
|
||||
const:negate="YES"
|
||||
>false</var:if>;
|
||||
</script>
|
||||
|
||||
<form id="aclForm" const:href="saveAcls">
|
||||
<div class="acls">
|
||||
|
||||
@@ -16,13 +16,23 @@ function addUser(userName, userID) {
|
||||
var lis = ul.childNodesWithTag("li");
|
||||
var newNode = nodeForUser(userName, userID, canSubscribeUsers);
|
||||
newNode.addClassName("normal-user");
|
||||
if (lis.length > 1) {
|
||||
var publicNode = lis[lis.length-2];
|
||||
ul.insertBefore(newNode, publicNode);
|
||||
|
||||
var count = lis.length - 1;
|
||||
var nextLi = null;
|
||||
while (count > -1 && !nextLi) {
|
||||
log("current li: " + lis[count].id);
|
||||
if (lis[count].hasClassName("normal-user")) {
|
||||
nextLi = lis[count+1];
|
||||
}
|
||||
else {
|
||||
count--;
|
||||
}
|
||||
}
|
||||
else {
|
||||
ul.appendChild(newNode);
|
||||
if (!nextLi) {
|
||||
nextLi = lis[0];
|
||||
}
|
||||
ul.insertBefore(newNode, nextLi);
|
||||
|
||||
var url = window.location.href;
|
||||
var elements = url.split("/");
|
||||
elements[elements.length-1] = ("addUserInAcls?uid="
|
||||
@@ -115,8 +125,11 @@ function onUserRemove(event) {
|
||||
var baseURL = elements.join("/");
|
||||
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var userId = nodes[i].getAttribute("id");
|
||||
triggerAjaxRequest(baseURL + userId, removeUserCallback, nodes[i]);
|
||||
var userId = nodes[i].id;
|
||||
if (userId != defaultUserID && userId != "anonymous") {
|
||||
triggerAjaxRequest(baseURL + userId, removeUserCallback,
|
||||
nodes[i]);
|
||||
}
|
||||
}
|
||||
preventDefault(event);
|
||||
}
|
||||
@@ -175,7 +188,7 @@ function onAclLoadHandler() {
|
||||
defaultUserID);
|
||||
userNode.addClassName("any-user");
|
||||
ul.appendChild(userNode);
|
||||
if (CurrentModule() != "Mail") {
|
||||
if (isPublicAccessEnabled && CurrentModule() != "Mail") {
|
||||
userNode = nodeForUser(_("Public Access"), "anonymous");
|
||||
userNode.addClassName("anonymous-user");
|
||||
ul.appendChild(userNode);
|
||||
|
||||
Reference in New Issue
Block a user