aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Fripost/Panel
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@fripost.org>2013-02-01 02:17:24 +0100
committerGuilhem Moulin <guilhem.moulin@fripost.org>2013-02-01 02:17:24 +0100
commit7076e66b79a98a3978b3a967fdea792b5b9d1cd5 (patch)
tree403381dbba2aa46a1126d85b032f48abb16ca89f /lib/Fripost/Panel
parent0dbcef539b19bd4d50d4bbc904b32f53ebdcf102 (diff)
Make the whole configuration available through the library.
Diffstat (limited to 'lib/Fripost/Panel')
-rw-r--r--lib/Fripost/Panel/Interface.pm17
-rw-r--r--lib/Fripost/Panel/Login.pm2
2 files changed, 8 insertions, 11 deletions
diff --git a/lib/Fripost/Panel/Interface.pm b/lib/Fripost/Panel/Interface.pm
index 675c9ba..f357b53 100644
--- a/lib/Fripost/Panel/Interface.pm
+++ b/lib/Fripost/Panel/Interface.pm
@@ -40,7 +40,7 @@ sub ListDomains : StartRunmode {
my $self = shift;
my %CFG = $self->cfg;
- my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG );
+ my $fp = Fripost::Schema::->SASLauth( $self->authen->username, \%CFG );
my @domains = $fp->domain->search( undef, -sort => 1,
-keys => [qw/name isActive isPending description/]);
my $canIAdd = $fp->domain->domain->canIAdd;
@@ -78,7 +78,7 @@ sub AddDomain : Runmode {
my $error; # Tells whether the change submission has failed.
if (defined $q->param('submit')) {
# Changes have been submitted: process them
- my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG );
+ my $fp = Fripost::Schema::->SASLauth( $self->authen->username, \%CFG );
if (defined $q->param('owner') and defined $session_param) {
# Ensure that the user didn't spoof the domain ownership.
@@ -93,9 +93,6 @@ sub AddDomain : Runmode {
, '-send-confirmation-token' => $q->param('owner') // undef
, '-dry-run' => not (defined $q->param('owner'))
, -error => \$error
- , webapp_url => $self->cfg('webapp_url')
- , tmpl_path => $self->cfg('tmpl_path')
- , email_from => $self->cfg('email_from')
);
$fp->done;
}
@@ -148,7 +145,7 @@ sub EditDomain : Runmode {
# Get the domain name from the URL.
my $domainname = ($self->split_path)[1];
- my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG );
+ my $fp = Fripost::Schema::->SASLauth( $self->authen->username, \%CFG );
my $error; # Tells whether the change submission has failed.
if (defined $q->param('submit')) {
@@ -193,7 +190,7 @@ sub ListLocals : Runmode {
# Get the domain name from the URL.
my $domainname = ($self->split_path)[1];
- my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG );
+ my $fp = Fripost::Schema::->SASLauth( $self->authen->username, \%CFG );
if (defined $q->param('unlock')) {
# Unlock the domain, and come back to the home page.
@@ -294,7 +291,7 @@ sub AddLocal : Runmode {
my $domainname = ($self->split_path)[1];
my $t = $q->param('t') or return $self->redirect('./');
return $self->redirect('./') unless grep { $t eq $_ } qw/user alias list/;
- my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG );
+ my $fp = Fripost::Schema::->SASLauth( $self->authen->username, \%CFG );
my $error; # Tells whether the change submission has failed.
if (defined $q->param('submit')) {
@@ -330,7 +327,7 @@ sub AddLocal : Runmode {
};
unless ($error) {
- my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG );
+ my $fp = Fripost::Schema::->SASLauth( $self->authen->username, \%CFG );
$fp->domain->search ($domainname, -filter => 'unlocked', -count => 1)
or die "404\n";
$fp->local->add( $local, %rest, -error => \$error );
@@ -372,7 +369,7 @@ sub EditLocal : Runmode {
# Get the domain name from the URL.
my ($localname,$domainname) = ($self->split_path)[2,1];
my $name = $localname.'@'.$domainname;
- my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG );
+ my $fp = Fripost::Schema::->SASLauth( $self->authen->username, \%CFG );
# Search for *the* matching user, alias or list.
$fp->domain->search ($domainname, -filter => 'unlocked', -count => 1)
diff --git a/lib/Fripost/Panel/Login.pm b/lib/Fripost/Panel/Login.pm
index 3b2846a..1fca602 100644
--- a/lib/Fripost/Panel/Login.pm
+++ b/lib/Fripost/Panel/Login.pm
@@ -59,7 +59,7 @@ sub cgiapp_init {
$CFG{default_realm} // return 0;
$u .= '@'.$CFG{default_realm};
}
- my $fp = Fripost::Schema::->auth($u, $p, %CFG, -error => undef)
+ my $fp = Fripost::Schema::->auth($u, $p, \%CFG, -error => undef)
// return 0;
$fp->done;
return $u;