From: Marius Gavrilescu Date: Tue, 24 Feb 2015 19:51:29 +0000 (+0200) Subject: Merge branch 'master' into newmc X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=b7c79e04cb3c8ea826ea1aac8049333564794536;hp=-c;p=plack-app-gruntmaster.git Merge branch 'master' into newmc Conflicts: app.psgi --- b7c79e04cb3c8ea826ea1aac8049333564794536 diff --combined app.psgi index 5d3c898,dc9f75b..fd1bcac --- a/app.psgi +++ b/app.psgi @@@ -12,8 -12,8 +12,8 @@@ use Log::Log4perl use Tie::Hash::Expire; use constant AUTH_TIMEOUT => 5 * 60; - use constant ACCESSLOG_FORMAT => '%{X-Forwarded-For}i|%h %u "%r" %>s %b "%{Referer}i" "%{User-agent}i"'; + use constant ACCESSLOG_FORMAT => 'combined'; -use constant CONTENT_SECURITY_POLICY => q,default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self'; connect-src 'self',; +use constant CONTENT_SECURITY_POLICY => q,default-src 'none'; script-src 'self' static.mindcoding.ro www.google-analytics.com; style-src 'self' static.mindcoding.ro; img-src 'self' static.mindcoding.ro www.google-analytics.com; connect-src 'self',; our $db //= Gruntmaster::Data->connect($ENV{GRUNTMASTER_DSN} // 'dbi:Pg:'); diff --combined lib/Plack/App/Gruntmaster.pm index 2bacc0a,40879a9..ef80f50 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@@ -166,8 -166,7 +166,8 @@@ sub dispatch_request sub (/ed/:contest) { forbid contest->is_running; - response ed => 'Editorial of ' . contest->name, db->problem_list(contest => $_{contest}, solution => 1); + my $pblist = db->problem_list(contest => $_{contest}, solution => 1); + response ed => 'Editorial of ' . contest->name, {%$pblist, editorial => contest->editorial}; }, sub (/login) { @@@ -227,7 -226,6 +227,6 @@@ db->users->create({id => $_{username}, name => $_{name}, email => $_{email}, phone => $_{phone}, town => $_{town}, university => $_{university}, country => $_{country}, level => $_{level}}); db->user($_{username})->set_passphrase($_{password}); - purge '/us/'; reply 'Registered successfully'; }, @@@ -264,7 -262,6 +263,6 @@@ owner => remote_user->id, }); - purge '/log/'; [303, [Location => '/log/' . $newjob->id], []] },