From 62f0ac114989808ebb84e7728b4b7e9f65d53c0e Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 9 Sep 2012 23:34:54 +0200 Subject: Added delete links. --- lib/Fripost/Schema/Mailbox.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib/Fripost/Schema/Mailbox.pm') diff --git a/lib/Fripost/Schema/Mailbox.pm b/lib/Fripost/Schema/Mailbox.pm index a3ae4be..28ef376 100644 --- a/lib/Fripost/Schema/Mailbox.pm +++ b/lib/Fripost/Schema/Mailbox.pm @@ -160,6 +160,30 @@ sub add { } +=item B (I, I, I) + +Delete the given mailbox. Note: this will NOT wipe the mailbox off the +disk, but merely delete its entry in the LDAP directory. + +=cut + +sub delete { + my $self = shift; + my $l = shift; + my $d = shift; + my %options = @_; + + my $mesg = $self->ldap->delete( "fvu=$l,fvd=$d,".$self->suffix ); + if ($mesg->code) { + if (defined $options{'-die'}) { + return $mesg->error unless $options{'-die'}; + die $options{'-die'}."\n"; + } + die $mesg->error; + } +} + + =back =head1 GLOBAL OPTIONS -- cgit v1.2.3