mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-15 08:25:25 +00:00
merge of '403e9c9f8b6284761ab422dee636699902d4babe'
and '9b7b6ece389f868c2c9b2bcae1bcdfd5af065e48' Monotone-Parent: 403e9c9f8b6284761ab422dee636699902d4babe Monotone-Parent: 9b7b6ece389f868c2c9b2bcae1bcdfd5af065e48 Monotone-Revision: 49a23fbd758d213ee3123b508598dcc5bdede2a5 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-04T20:28:41 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,20 @@
|
||||
2012-04-04 Jean Raby <jraby@inverse.ca>
|
||||
|
||||
* Added a new tool: 'sogo-tool expire-sessions'
|
||||
Along with the associated new cronjob, this allows
|
||||
user sessions expiration without a custom script.
|
||||
|
||||
* While there, sort tools in sogo-tool output
|
||||
|
||||
2012-04-03 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* Tools/SOGoToolRemoveDoubles.m (-removeDoublesFromFolder)
|
||||
(-amountOfFilledQuickFields): lowered the case of the
|
||||
telephonenumber table fieldname.
|
||||
|
||||
* OGoContentStore/OCSContactFieldExtractor.m
|
||||
(-extractQuickFieldsFromVCard): idem.
|
||||
|
||||
2012-03-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreCalendarMessage.m (-save): remove comment if
|
||||
@@ -35,6 +52,29 @@
|
||||
|
||||
* UI/WebServerResources/MailerUI.js (startDragging): idem.
|
||||
|
||||
2012-03-29 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/UIxPreferences.js (savePreferences): fixed
|
||||
validation of end date of vacation of message when not using ISO
|
||||
format (currently limited to French).
|
||||
|
||||
* UI/WebServerResources/ContactsUI.js (startDragging): create an
|
||||
overlapping safety block (div) to avoid possible selection of the
|
||||
underlying text.
|
||||
|
||||
* UI/WebServerResources/MailerUI.js (startDragging): idem.
|
||||
|
||||
2012-03-28 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Contacts/SOGoFolder+CardDAV.m (_isValidFilter:):
|
||||
accept "email" as filter name.
|
||||
(_appendObject:withBaseURL:toREPORTResponse:): fixed the ordering
|
||||
of XML elements as the address*-data props where put outside of
|
||||
the <D:prop> tree.
|
||||
|
||||
* SoObjects/SOGo/LDAPSource.m (-allEntryIDs): take the _filter
|
||||
ivar into account.
|
||||
|
||||
2012-03-28 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/SOGoMAPIFSMessage.m
|
||||
@@ -71,6 +111,24 @@
|
||||
first available directory source.
|
||||
(-davResourceType): declare resource as "directory" (carddav).
|
||||
|
||||
2012-03-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Contacts/SOGoContactFolders.m
|
||||
(-lookupName:inContext:acquire:): overriden method that enables
|
||||
the lookup of hidden public sources with iOS devices.
|
||||
|
||||
* SoObjects/Contacts/SOGoContactLDIFEntry.m (-davAddressData): new
|
||||
getter similar to davCalendarData.
|
||||
|
||||
* SoObjects/Contacts/SOGoContactSourceFolder.m
|
||||
(-davAddressbookMultiget): new REPORT handler based on
|
||||
-[SOGoAppointmentFolder davCalendarMultiget].
|
||||
|
||||
* SoObjects/Contacts/SOGoUserFolder+Contacts.m
|
||||
(-davDirectoryGateway): new getter that returns the url to the
|
||||
first available directory source.
|
||||
(-davResourceType): declare resource as "directory" (carddav).
|
||||
|
||||
2012-03-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreTasksMessage.m (-save): take PR_HTML as
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
1.3.15 (2012-04-DD)
|
||||
-------------------
|
||||
New Features
|
||||
-
|
||||
- Sources address books are now exposed in Apple and iOS AddressBook app
|
||||
using the "directory gateway" extension of CardDAV
|
||||
|
||||
Enhancements
|
||||
-
|
||||
|
||||
Bug Fixes
|
||||
-
|
||||
- fixed wrong date validation in preferences module affecting French users
|
||||
|
||||
1.3.14 (2012-03-23)
|
||||
-------------------
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
forKey: @"c_givenName"];
|
||||
value = [vCard preferredTel];
|
||||
if (value)
|
||||
[fields setObject: value forKey: @"c_telephoneNumber"];
|
||||
[fields setObject: value forKey: @"c_telephonenumber"];
|
||||
value = [vCard preferredEMail];
|
||||
if (![value isNotNull])
|
||||
value = @"";
|
||||
|
||||
+8
-3
@@ -2,14 +2,19 @@
|
||||
|
||||
# Vacation messages expiration
|
||||
# Make sure to set authname and authpassword with the credentials of a sieve admin
|
||||
#0 0 * * * sogo /usr/sbin/sogo-tool expire-autoreply authname:authpassword
|
||||
#0 0 * * * sogo /usr/sbin/sogo-tool expire-autoreply authname:authpassword
|
||||
|
||||
# Session cleanup - runs every minute
|
||||
# - Ajust the nbMinutes parameter to suit your needs
|
||||
# Example: Sessions without activity since 60 minutes will be dropped:
|
||||
#* * * * * sogo /usr/sbin/sogo-tool expire-sessions 60
|
||||
|
||||
# Email alarms - runs every minutes
|
||||
#* * * * * sogo /usr/sbin/sogo-ealarms-notify
|
||||
#* * * * * sogo /usr/sbin/sogo-ealarms-notify
|
||||
|
||||
# Daily backups
|
||||
# - writes to /home/sogo/backups/ by default
|
||||
# - will keep 31 days worth of backups by default
|
||||
# - runs once a day by default, but can run more frequently
|
||||
# - make sure to set the path to sogo-backup.sh correctly
|
||||
#30 0 * * * sogo /usr/share/doc/sogo/sogo-backup.sh
|
||||
#30 0 * * * sogo /usr/share/doc/sogo/sogo-backup.sh
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@ $(SOGO_TOOL)_OBJC_FILES += \
|
||||
SOGoToolRemove.m \
|
||||
SOGoToolRenameUser.m \
|
||||
SOGoToolUserPreferences.m \
|
||||
SOGoToolExpireAutoReply.m
|
||||
SOGoToolExpireAutoReply.m \
|
||||
SOGoToolExpireUserSessions.m
|
||||
TOOL_NAME += $(SOGO_TOOL)
|
||||
|
||||
###
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
/* SOGoToolExpireUserSessions.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2012 Inverse inc.
|
||||
*
|
||||
* Author: Jean Raby <jraby@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 <Foundation/NSArray.h>
|
||||
#import <Foundation/NSCalendarDate.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <GDLAccess/EOAdaptorChannel.h>
|
||||
|
||||
#import <GDLContentStore/GCSChannelManager.h>
|
||||
#import <GDLContentStore/NSURL+GCS.h>
|
||||
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
|
||||
#import <SOGo/NSString+Utilities.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoSystemDefaults.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
|
||||
#import "SOGoTool.h"
|
||||
|
||||
@interface SOGoToolExpireUserSessions : SOGoTool
|
||||
@end
|
||||
|
||||
@implementation SOGoToolExpireUserSessions
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
}
|
||||
|
||||
+ (NSString *) command
|
||||
{
|
||||
return @"expire-sessions";
|
||||
}
|
||||
|
||||
+ (NSString *) description
|
||||
{
|
||||
return @"Expires user sessions without activity for specified number of minutes";
|
||||
}
|
||||
|
||||
- (void) usage
|
||||
{
|
||||
fprintf (stderr, "expire-sessions [nbMinutes]\n\n"
|
||||
" nbMinutes Number of minutes of inactivity after which a user session will be expired\n"
|
||||
"\n"
|
||||
"The SOGoSessionExpireMinutes user default will be used if nbMinutes is not specified\n"
|
||||
"The expire-sessions action should be configured as a cronjob.\n");
|
||||
}
|
||||
|
||||
- (BOOL) expireUserSessionOlderThan: (int) nbMinutes
|
||||
{
|
||||
BOOL rc;
|
||||
EOAdaptorChannel *channel;
|
||||
GCSChannelManager *cm;
|
||||
NSArray *attrs, *qValues;
|
||||
NSDictionary *qresult;
|
||||
NSException *ex;
|
||||
NSString *sql, *sessionsFolderURL;
|
||||
NSURL *tableURL;
|
||||
NSUserDefaults *ud;
|
||||
|
||||
unsigned int now, oldest;
|
||||
int sessionsToDelete;
|
||||
|
||||
rc=YES;
|
||||
ud = [NSUserDefaults standardUserDefaults];
|
||||
now = [[NSCalendarDate calendarDate] timeIntervalSince1970];
|
||||
oldest = now - (nbMinutes * 60);
|
||||
|
||||
sessionsFolderURL = [ud stringForKey: @"OCSSessionsFolderURL"];
|
||||
if (!sessionsFolderURL)
|
||||
{
|
||||
if (verbose)
|
||||
NSLog(@"Couldn't read OCSSessionsFolderURL");
|
||||
return rc = NO;
|
||||
}
|
||||
|
||||
tableURL = [[NSURL alloc] initWithString: sessionsFolderURL];
|
||||
cm = [GCSChannelManager defaultChannelManager];
|
||||
channel = [cm acquireOpenChannelForURL: tableURL];
|
||||
if (!channel)
|
||||
{
|
||||
/* FIXME: nice error msg */
|
||||
NSLog(@"Can't aquire channel");
|
||||
return rc=NO;
|
||||
}
|
||||
|
||||
sql = [NSString stringWithFormat: @"SELECT count(*) FROM %@ WHERE c_lastseen <= %d;",
|
||||
[tableURL gcsTableName], oldest];
|
||||
ex = [channel evaluateExpressionX: sql];
|
||||
if (ex)
|
||||
{
|
||||
NSLog(@"%@", [ex reason]);
|
||||
[ex raise];
|
||||
return rc=NO;
|
||||
}
|
||||
|
||||
attrs = [channel describeResults: NO];
|
||||
/* only one row */
|
||||
qresult = [channel fetchAttributes: attrs withZone: NULL];
|
||||
qValues = [qresult allValues];
|
||||
sessionsToDelete = [[qValues objectAtIndex: 0] intValue];
|
||||
if (sessionsToDelete)
|
||||
{
|
||||
if (verbose)
|
||||
NSLog(@"Will be removing %d sessions", sessionsToDelete);
|
||||
[channel cancelFetch];
|
||||
sql = [NSString stringWithFormat: @"DELETE FROM %@ WHERE c_lastseen <= %d;",
|
||||
[tableURL gcsTableName], oldest];
|
||||
if (verbose)
|
||||
NSLog(@"Removing sessions older than %d minute(s)", nbMinutes);
|
||||
ex = [channel evaluateExpressionX: sql];
|
||||
if (ex)
|
||||
{
|
||||
NSLog(@"An exception occured while deleting old sessions: %@", [ex reason]);
|
||||
[ex raise];
|
||||
return rc=NO;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (verbose)
|
||||
NSLog(@"No session to remove", sessionsToDelete);
|
||||
}
|
||||
|
||||
[cm releaseChannel: channel];
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (BOOL) run
|
||||
{
|
||||
BOOL rc;
|
||||
int sessionExpireMinutes=0;
|
||||
|
||||
rc = NO;
|
||||
|
||||
if ([arguments count])
|
||||
{
|
||||
sessionExpireMinutes = [[arguments objectAtIndex: 0] intValue];
|
||||
}
|
||||
|
||||
if (sessionExpireMinutes > 0)
|
||||
{
|
||||
rc = [self expireUserSessionOlderThan: sessionExpireMinutes];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self usage];
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -304,7 +304,7 @@
|
||||
{
|
||||
quickFields = [NSArray arrayWithObjects: @"c_givenname", @"c_cn",
|
||||
@"c_sn", @"c_screenname", @"c_l", @"c_mail",
|
||||
@"c_o", @"c_ou", @"c_telephoneNumber", nil];
|
||||
@"c_o", @"c_ou", @"c_telephonenumber", nil];
|
||||
[quickFields retain];
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@
|
||||
|
||||
fields = [NSArray arrayWithObjects: @"c_name", @"c_givenname", @"c_cn",
|
||||
@"c_sn", @"c_screenname", @"c_l", @"c_mail", @"c_o",
|
||||
@"c_ou", @"c_telephoneNumber", @"c_content", @"c_version",
|
||||
@"c_ou", @"c_telephonenumber", @"c_content", @"c_version",
|
||||
@"c_creationdate", @"c_lastmodified", nil];
|
||||
qualifier = [EOQualifier qualifierWithQualifierFormat: @"c_component = %@",
|
||||
@"vcard"];
|
||||
|
||||
+2
-2
@@ -143,11 +143,11 @@
|
||||
[helpString appendString: @" argument1, ...\targuments passed to the"
|
||||
@" specified command\n\n"];
|
||||
[helpString appendString: @" Available commands:\n"];
|
||||
toolsEnum = [[tools allKeys] objectEnumerator];
|
||||
toolsEnum = [[[tools allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] objectEnumerator];
|
||||
while ((command = [toolsEnum nextObject]))
|
||||
{
|
||||
currentTool = [tools objectForKey: command];
|
||||
[helpString appendFormat: @"\t%@\t-- %@\n",
|
||||
[helpString appendFormat: @"\t%-20@-- %@\n",
|
||||
command, [currentTool objectAtIndex: 1]];
|
||||
}
|
||||
|
||||
|
||||
@@ -54,9 +54,6 @@ DIV#bgDialogDiv
|
||||
IMG.dragMessage
|
||||
{ filter: alpha(opacity=70); }
|
||||
|
||||
TD.mailer_fieldname
|
||||
{ width: 8em; }
|
||||
|
||||
TABLE.messageList TD
|
||||
{ white-space: pre; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user