aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlouise <louise>2009-11-11 14:21:06 +0000
committerlouise <louise>2009-11-11 14:21:06 +0000
commite025a608f5c73f5c546b1cbcef26e1a6d85bfe0d (patch)
tree7cbf8f477d78d57d685e1429af7e2e584b66fc72
parentc4591a5edce7cdb61a84abfec776fc1357d6799a (diff)
Allowing cobrand to determine display of cross sell ads
-rwxr-xr-xweb/alert.cgi18
1 files changed, 14 insertions, 4 deletions
diff --git a/web/alert.cgi b/web/alert.cgi
index 1e1728849..50b7f2d58 100755
--- a/web/alert.cgi
+++ b/web/alert.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: alert.cgi,v 1.58 2009-11-09 16:43:09 louise Exp $
+# $Id: alert.cgi,v 1.59 2009-11-11 14:21:06 louise Exp $
use strict;
use Standard;
@@ -372,7 +372,11 @@ sub alert_signed_input {
my $alert_id = mySociety::Alert::create($email, 'new_updates', $cobrand, '', $id);
mySociety::Alert::confirm($alert_id);
$out = $q->p(_('You have successfully subscribed to that alert.'));
- $out .= CrossSell::display_advert($q, $email);
+ my $cobrand = Page::get_cobrand($q);
+ my $display_advert = Cobrand::allow_crosssell_adverts($cobrand);
+ if ($display_advert) {
+ $out .= CrossSell::display_advert($q, $email);
+ }
} else {
$out = $q->p(_('We could not validate that alert.'));
}
@@ -391,14 +395,20 @@ sub alert_token {
}
my $out;
+ my $cobrand = Page::get_cobrand($q);
+ my $display_advert = Cobrand::allow_crosssell_adverts($cobrand);
if ($type eq 'subscribe') {
mySociety::Alert::confirm($id);
$out = $q->p(_('You have successfully confirmed your alert.'));
- $out .= CrossSell::display_advert($q, $email);
+ if ($display_advert) {
+ $out .= CrossSell::display_advert($q, $email);
+ }
} elsif ($type eq 'unsubscribe') {
mySociety::Alert::delete($id);
$out = $q->p(_('You have successfully deleted your alert.'));
- $out .= CrossSell::display_advert($q, $email);
+ if ($display_advert) {
+ $out .= CrossSell::display_advert($q, $email);
+ }
}
return $out;
}