diff options
author | Guilhem Moulin <guilhem.moulin@fripost.org> | 2012-09-29 21:17:15 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@fripost.org> | 2012-09-29 21:17:15 +0200 |
commit | a4fb637c441cad75350edcbbb2520f7a303b33c2 (patch) | |
tree | 7761e4104a6c3cb64b0930293bc2a748e0c52c11 /lib/Fripost/Schema.pm | |
parent | 58825808fb1fd2d9950e8f7a81ad62db18be4aa7 (diff) |
Grant the right to create aliases and/or lists.
Diffstat (limited to 'lib/Fripost/Schema.pm')
-rw-r--r-- | lib/Fripost/Schema.pm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Fripost/Schema.pm b/lib/Fripost/Schema.pm index bb1f3f5..ad88c82 100644 --- a/lib/Fripost/Schema.pm +++ b/lib/Fripost/Schema.pm @@ -211,6 +211,25 @@ under the same terms as perl itself. =cut +sub _dn2email { + my $self = shift; + my $dn = shift; + $dn =~ s/^fvd=([^,]+),.*/\@$1/ and return $dn; + $dn =~ s/^fv(?:u|a|l)=([^,]+),fvd=([^,]+),.*/$1\@$2/ + or die "Wrong usage: of _dn2email: $dn"; + return $dn; +} +sub _email2dn { + my $self = shift; + my $email = shift; + my ($l,$d) = split /\@/, $email, 2; + die "Wrong usage: of _email2dn: $email" unless defined $d; + + my $dn = "fvd=$d,".$self->suffix; + $dn = "fvu=$l,".$dn if $l ne ''; + return $dn; +} + 1; __END__ |