From 99b3ecbaf20b4e47ee6a403fd30268939e6e1244 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 25 Jan 2013 02:49:26 +0100 Subject: Updated and redocumented Fripost::Schema::Domain. --- misc/deleteExpiredEntries.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'misc') diff --git a/misc/deleteExpiredEntries.pl b/misc/deleteExpiredEntries.pl index 80dd79b..29e26b0 100755 --- a/misc/deleteExpiredEntries.pl +++ b/misc/deleteExpiredEntries.pl @@ -32,21 +32,22 @@ my $config = { ldap_bind_dn => [ 'cn=DeletePendingEntries','ou=services','o=mail , ldap_suffix => [ 'ou=virtual','o=mailHosting','dc=fripost,dc=dev' ] }; -my $fp = Fripost::Schema::->auth( undef, 'deletependingentries', %$config ); +my $fp = Fripost::Schema::Auth->auth( undef, 'deletependingentries', %$config ); my $maxage = $ARGV[0] // 86400; # 24h by default my $now = int(strftime "%s", gmtime); my $maxdate = Net::LDAP::Util::escape_filter_value( - strftime ("%Y%m%d%H%M%SZ", localtime($now - $maxage)) ); + strftime ("%Y%m%d%H%M%SZ", localtime($now - $maxage)) + ); my $entries = $fp->ldap->search ( base => Fripost::Schema::Util::canonical_dn(@{$fp->suffix}), scope => 'subtree', deref => 'never', - filter => "(&(fripostPendingToken=*) + filter => "(&(objectClass=FripostPendingEntry) (createTimestamp<=$maxdate))", - attrs => [], + attrs => [ '1.1' ], callback => \&delete_entry ); die $entries->error."\n" if $entries->code; @@ -55,7 +56,7 @@ $fp->done; sub delete_entry { my ($mesg, $obj) = @_; if (defined $obj and $obj->isa('Net::LDAP::Entry')) { -# print STDERR "Deleting DN ".$obj->dn."\n"; + print STDERR "Deleting DN ".$obj->dn."\n"; $obj->delete; my $mesg = $obj->update($fp->ldap); die $mesg->error."\n" if $mesg->code; -- cgit v1.2.3