diff options
Diffstat (limited to 'lib/Fripost/Panel')
-rw-r--r-- | lib/Fripost/Panel/Interface.pm | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/lib/Fripost/Panel/Interface.pm b/lib/Fripost/Panel/Interface.pm index 4e5b48e..02f3f4b 100644 --- a/lib/Fripost/Panel/Interface.pm +++ b/lib/Fripost/Panel/Interface.pm @@ -55,7 +55,7 @@ sub ListDomains : StartRunmode { } -# This Run Mode lists the known mailboxes, aliases and lists under the current +# This Run Mode lists the known users, aliases and lists under the current # domain. sub ListLocals : Runmode { my $self = shift; @@ -68,12 +68,11 @@ sub ListLocals : Runmode { # Query *the* matching domain my %domain = $fp->domain->get( $d, -die => 404 ); - # Query the mailboxes, aliases and lists under the given domain. We - # don't die with a HTTP error code here, as it is not supposed to - # crash. - my @mailboxes = $fp->mailbox->search( $d ); - my @aliases = $fp->alias->search( $d ); - my @lists = $fp->list->search( $d ); + # Query the users, aliases and lists under the given domain. We don't + # die with a HTTP error code here, as it is not supposed to crash. + my @users = $fp->user->search( $d ); + my @aliases = $fp->alias->search( $d ); + my @lists = $fp->list->search( $d ); $fp->done; @@ -88,12 +87,12 @@ sub ListLocals : Runmode { # activation, modify catchalls?) $template->param( canEditDomain => $domain{permissions} =~ /[op]/ ); - # Can the user add mailboxes? - $template->param( canAddMailbox => $domain{permissions} =~ /p/ ); - # Should we list mailboxes? - $template->param( listMailboxes => $#mailboxes >= 0 || + # Can the user add users? + $template->param( canAddUser => $domain{permissions} =~ /p/ ); + # Should we list users? + $template->param( listUsers => $#users >= 0 || $domain{permissions} =~ /p/ ); - $template->param( mailboxes => [ + $template->param( users => [ map { { &mkLink(user => $_->{user}) , description => join ("\n", @{$_->{description}}) , isactive => $_->{isactive} @@ -102,7 +101,7 @@ sub ListLocals : Runmode { , quota => $_->{quota} }; } - @mailboxes + @users ]); # Can the user add aliases? @@ -217,12 +216,12 @@ sub EditLocal : Runmode { my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG ); - # Search for *the* matching mailbox, alias or list. + # Search for *the* matching user, alias or list. my ($d,$l) = ($self->split_path)[1,2]; my %local = $fp->local->get ($l.'@'.$d, -die => 404, -concat => "\x{0D}\x{0A}" ); die "Unknown type" unless grep { $local{type} eq $_ } - qw/mailbox alias list/; + qw/user alias list/; die "404\n" if $local{ispending}; my $error; # Tells whether the change submission has failed. @@ -239,7 +238,7 @@ sub EditLocal : Runmode { if (defined $q->param('submit')) { # Changes have been submitted: process them my %entry; - if ($t eq 'mailbox') { + if ($t eq 'user') { $entry{user} = $l.'@'.$d; $entry{forwards} = $q->param('forwards'); @@ -268,7 +267,7 @@ sub EditLocal : Runmode { ldap_suffix => $CFG{ldap_suffix}, -die => "Wrong password (for ‘".$u."’)." ); }; - $error = $@ || $fp->mailbox->passwd( + $error = $@ || $fp->user->passwd( $entry{user}, Fripost::Password::hash($q->param('newpw')) ); @@ -296,7 +295,7 @@ sub EditLocal : Runmode { if ($error and defined $q->param('submit')) { # Preserve the (incorrect) form, except the passwords - if ($t eq 'mailbox') { + if ($t eq 'user') { $template->param( user => encode_entities($l) , forwards => $q->param('forwards') ); } @@ -313,7 +312,7 @@ sub EditLocal : Runmode { else { %local = $fp->local->get ($l.'@'.$d, -die => 404, -concat => "\x{0D}\x{0A}" ); - if ($t eq 'mailbox') { + if ($t eq 'user') { $template->param( user => encode_entities($local{user}) , forwards => encode_entities($local{forwards}) ); } @@ -341,8 +340,8 @@ sub EditLocal : Runmode { } -# In this Run Mode authenticated users can add mailboxes, aliases and -# lists (if they have the permission). +# In this Run Mode authenticated users can add users, aliases and lists +# (if they have the permission). sub AddLocal : Runmode { my $self = shift; my %CFG = $self->cfg; @@ -357,7 +356,7 @@ sub AddLocal : Runmode { # Changes have been submitted: process them my %entry; my %rest; - if ($t eq 'mailbox') { + if ($t eq 'user') { $entry{user} = $q->param('user').'@'.$d; $entry{forwards} = $q->param('forwards'); if ($q->param('password') ne $q->param('password2')) { @@ -417,7 +416,7 @@ sub AddLocal : Runmode { $template->param( domain => encode_entities($d) ); if ($error) { # Preserve the (incorrect) form, except the passwords - if ($t eq 'mailbox') { + if ($t eq 'user') { $template->param( user => $q->param('user') , forwards => $q->param('forwards') ); } |