<%perl> my $referer = $ARGS{referer}||$ARGS{referrer}; my $page_action = $ARGS{page_action}; my $user = $ARGS{user}; $m->session->{loginReturnPage} = $ENV{HTTP_REFERER} if $referer; $m->session->{'l_user'} = $ARGS{'user'} if $user; if (exists($ARGS{redirect})) { $ARGS{redirect} = uri_unescape(uri_unescape($ARGS{redirect})); if ($ARGS{redirect} eq $REQ->uri) { $ARGS{redirect} = '/index.html'; } else { $m->session->{loginReturnPage} = $ARGS{redirect} ; } } else { $ARGS{redirect} = $m->session->{loginReturnPage}; } if ( $m->session->{'loggedin'} ) { if ( $ARGS{'redirect'} ) { my $redirect = $ARGS{'redirect'}; #shout "redirect: ".$redirect; $redirect =~ s/^\/account\/login\.html/\/account\//i; if ( $ARGS{'auth'} eq 'y' ) { my $u = new L6::User id => $m->session->{u}->{id}; unless ( $u->error ) { my $c = $u->generate_magic_cookie; if ( $redirect =~ m/\?/g ) { $redirect .= "&mc=$c"; } else { $redirect .= "?mc=$c"; } } } $m->redirect( $redirect ); } else { my $redirect = $m->session->{loginReturnPage}; #shout "redirect: ".$redirect; $redirect =~ s/^\/account\/login\.html/\/account\//i; unless ($redirect) { $redirect = '/account/'; } $m->redirect( $redirect ); } % } else {
% if ($page_action) { <% $m->comp('SELF:action_message', page_action => $page_action ) %> % }
<& /func/login_simple.cp, user_attempt => $ARGS{'user_attempt'}, %ARGS &>
% } %# {{{ method action_message <%method action_message> <%args> $page_action => '' <%perl> my %page_actions = ( 'gpo_signup' => 'To sign up for GuitarPort Online you will need an account at Line6.com', 'offer' => 'To take advantage of this offer, you will need an account at Line6.com', 'store_free' => 'To get this free item, you will need an account at Line6.com', 'store' => 'To order from our store, you will need an account at Line6.com', 'csm' => "To Access the Service Manuals, You need to log in with an authorized line6.com account", 'store' => "To complete your purchase, you need to log in with a line6.com account", ); return unless $page_actions{$page_action};

<% $page_actions{$page_action} %>

%# }}}