aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Fripost/Schema
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@fripost.org>2013-01-18 22:40:14 +0100
committerGuilhem Moulin <guilhem.moulin@fripost.org>2013-01-18 22:59:16 +0100
commit145a6fc76882769391e1e9792db868b692bc4538 (patch)
tree02ad9f826d52f80683e357a2cbf02f3d6a269fd9 /lib/Fripost/Schema
parent1f35ed5ce38525af78508b46eea67a4f41c74a4a (diff)
Conversion username ↔ DN.
Diffstat (limited to 'lib/Fripost/Schema')
-rw-r--r--lib/Fripost/Schema/Domain.pm8
-rw-r--r--lib/Fripost/Schema/List.pm6
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/Fripost/Schema/Domain.pm b/lib/Fripost/Schema/Domain.pm
index fc80b4c..dc16ae0 100644
--- a/lib/Fripost/Schema/Domain.pm
+++ b/lib/Fripost/Schema/Domain.pm
@@ -103,9 +103,9 @@ sub get {
, catchalls => concat($concat, map { &_email_to_unicode ($_) }
$domain->get_value('fripostOptionalMaildrop'))
, permissions => get_perms($domain, $self->whoami)
- , canCreateAlias => concat($concat, map { &_email_to_unicode ($self->_dn2email($_)) }
+ , canCreateAlias => concat($concat, map { &_email_to_unicode ($self->_dn2fvu($_)) }
$domain->get_value('fripostCanCreateAlias'))
- , canCreateList => concat($concat, map { &_email_to_unicode ($self->_dn2email($_)) }
+ , canCreateList => concat($concat, map { &_email_to_unicode ($self->_dn2fvu($_)) }
$domain->get_value('fripostCanCreateList'))
)
}
@@ -136,10 +136,10 @@ sub replace {
, description => $d->{description}
, fripostOptionalMaildrop => $d->{catchalls}
, fripostCanCreateAlias =>
- [ map $self->_email2dn($_),
+ [ map $self->_fvu2dn($_),
@{$d->{canCreateAlias}} ]
, fripostCanCreateList =>
- [ map $self->_email2dn($_),
+ [ map $self->_fvu2dn($_),
@{$d->{canCreateList}} ]
} );
die $mesg->error."\n" if $mesg->code;
diff --git a/lib/Fripost/Schema/List.pm b/lib/Fripost/Schema/List.pm
index 7753bd1..18eeb29 100644
--- a/lib/Fripost/Schema/List.pm
+++ b/lib/Fripost/Schema/List.pm
@@ -18,7 +18,7 @@ use utf8;
use parent 'Fripost::Schema';
use Fripost::Schema::Util qw/concat explode must_attrs email_valid
- split_addr canonical_dn ldap_explode_dn/;
+ split_addr canonical_dn/;
use Net::IDN::Encode qw/domain_to_ascii email_to_ascii email_to_unicode/;
use Mail::GnuPG;
use MIME::Entity;
@@ -143,9 +143,7 @@ sub add {
# Ask the list manager to create the list now.
- my $whoami = ldap_explode_dn( $self->whoami );
- my $member = email_valid( $whoami->[0]->{fvu} .'@'. $whoami->[1]->{fvd}
- , -exact => 1 );
+ my $member = email_valid( $self->_dn2fvu($self->whoami), -exact => 1);
my $to = email_valid( 'mklist+'.$l->{transport}.'@fripost.org'
, -exact => 1 );