From 7076e66b79a98a3978b3a967fdea792b5b9d1cd5 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 1 Feb 2013 02:17:24 +0100 Subject: Make the whole configuration available through the library. --- lib/Fripost/Schema/Domain.pm | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'lib/Fripost/Schema/Domain.pm') diff --git a/lib/Fripost/Schema/Domain.pm b/lib/Fripost/Schema/Domain.pm index 36194d8..11502ea 100644 --- a/lib/Fripost/Schema/Domain.pm +++ b/lib/Fripost/Schema/Domain.pm @@ -480,16 +480,6 @@ the directory. When set, this option locks down the domain before inserting it, and send a message to I with the unlocking token. -=item B - -The URL to send, together with the token, to provide instructions how to -unlock the domain. - -=item B - -Where to find the e-mail template with the instructions how to unlock -the domain. - =back Errors can be caught with options B<-die> and B<-error>; See @@ -560,18 +550,17 @@ sub add { # Send token email_valid ($options{'-send-confirmation-token'}); - my $tt = Template->new({ INCLUDE_PATH => $options{tmpl_path} + my $tt = Template->new({ INCLUDE_PATH => $self->cfg('tmpl_path') // './' , INTERPOLATE => 1 }) or die $Template::ERROR; my $vars = { domain => $domainname, token => $token }; - $vars->{unlockurl} = $options{webapp_url} + $vars->{unlockurl} = ($self->cfg('webapp_url') // '') .encodeURIComponent($domainname) - .'/?unlock='.$token - if defined $options{webapp_url}; + .'/?unlock='.$token; my $data; $tt->process( 'new-domain.tt', $vars, \$data) or die $tt->error; - Fripost::Schema::Mail::->new( From => $options{email_from} // + Fripost::Schema::Mail::->new( From => $self->cfg('email_from') // $ENV{USER}.'@localhost' , To => $options{'-send-confirmation-token'} , Subject => "Your new domain ".$domain->{name} -- cgit v1.2.3