aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Fripost/Schema
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@fripost.org>2012-09-29 02:03:21 +0200
committerGuilhem Moulin <guilhem.moulin@fripost.org>2012-09-29 02:03:21 +0200
commit2bece6abde54881bb074dd44e7f87885eab4a777 (patch)
treebde87a2c98476847ab5082facade40062cb52e70 /lib/Fripost/Schema
parentaa3340e58fc5b993bfc88070edf543a2ed82ef94 (diff)
Proper escaping of URIs.
Diffstat (limited to 'lib/Fripost/Schema')
-rw-r--r--lib/Fripost/Schema/Alias.pm2
-rw-r--r--lib/Fripost/Schema/List.pm4
-rw-r--r--lib/Fripost/Schema/Local.pm2
-rw-r--r--lib/Fripost/Schema/Mailbox.pm2
4 files changed, 7 insertions, 3 deletions
diff --git a/lib/Fripost/Schema/Alias.pm b/lib/Fripost/Schema/Alias.pm
index 07ae84f..51bf98f 100644
--- a/lib/Fripost/Schema/Alias.pm
+++ b/lib/Fripost/Schema/Alias.pm
@@ -111,8 +111,8 @@ sub add {
}
eval {
+ die "Missing alias name\n" unless $a->{alias} =~ /^.+\@.+$/;
my ($l,$d) = split /\@/, email_to_ascii($a->{alias}), 2;
- die "Missing alias name\n" if $l eq '';
&_is_valid($a);
die "‘".$a->{alias}."’ already exists\n"
if $self->local->exists($a->{alias},%options);
diff --git a/lib/Fripost/Schema/List.pm b/lib/Fripost/Schema/List.pm
index 87876f6..67da859 100644
--- a/lib/Fripost/Schema/List.pm
+++ b/lib/Fripost/Schema/List.pm
@@ -51,6 +51,7 @@ sub search {
deref => 'never',
filter => $filter,
attrs => [ qw/fvl description fripostIsStatusActive
+ fripostIsStatusPending
fripostListManager/ ]
);
if ($lists->code) {
@@ -61,6 +62,7 @@ sub search {
, isactive => $_->get_value('fripostIsStatusActive') eq 'TRUE'
, description => concat($concat, $_->get_value('description'))
, transport => $_->get_value('fripostListManager')
+ , ispending => ($_->get_value('fripostIsStatusPending') // '') eq 'TRUE'
}
}
$lists->sorted('fvl')
@@ -113,8 +115,8 @@ sub add {
eval {
+ die "Missing list name\n" unless $l->{list} =~ /^.+\@.+$/;
my ($l2,$d) = split /\@/, email_to_ascii($l->{list}), 2;
- die "Missing list name\n" if $l eq '';
must_attrs( $l, 'transport' );
&_is_valid($l);
die "‘".$l->{list}."’ already exists\n"
diff --git a/lib/Fripost/Schema/Local.pm b/lib/Fripost/Schema/Local.pm
index 9efff91..f497a4e 100644
--- a/lib/Fripost/Schema/Local.pm
+++ b/lib/Fripost/Schema/Local.pm
@@ -49,6 +49,7 @@ sub get {
(&(objectClass=FripostVirtualList)(fvl=$l)))",
attrs => [ qw/fvu description
fripostIsStatusActive
+ fripostIsStatusPending
fripostOptionalMaildrop
fripostMailboxQuota
fva fripostMaildrop
@@ -91,6 +92,7 @@ sub get {
}
$ret{isactive} = $local->get_value('fripostIsStatusActive') eq 'TRUE';
$ret{description} = concat($concat, $local->get_value('description'));
+ $ret{ispending} = ($local->get_value('fripostIsStatusPending') // '') eq 'TRUE';
return %ret;
}
diff --git a/lib/Fripost/Schema/Mailbox.pm b/lib/Fripost/Schema/Mailbox.pm
index 95e2d10..ce23d98 100644
--- a/lib/Fripost/Schema/Mailbox.pm
+++ b/lib/Fripost/Schema/Mailbox.pm
@@ -134,8 +134,8 @@ sub add {
}
eval {
+ die "Missing user name\n" unless $m->{user} =~ /^.+\@.+$/;
my ($l,$d) = split /\@/, email_to_ascii($m->{user}), 2;
- die "Missing user name\n" if $l eq '';
&_is_valid($m);
die "‘".$m->{user}."’ already exists\n"
if $self->local->exists($m->{user},%options);