* Add enclair_db option to UserDB.pm. Allows logging of enclair password
[interchange.git] / code / SystemTag / process.coretag
1 # Copyright 2002-2007 Interchange Development Group and others
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.  See the LICENSE file for details.
7
8 # $Id: process.coretag,v 1.13 2007-10-31 11:25:53 kwalsh Exp $
9
10 UserTag process-target Alias     process
11 UserTag process-order  Alias     process
12
13 UserTag process        Order     target secure
14 UserTag process        addAttr
15 UserTag process        Version   $Revision: 1.13 $
16 UserTag process        Routine   <<EOR
17 # Returns the href to process the completed order form or do the search.
18 sub {
19         my($target,$secure,$opt) = @_;
20
21         $secure = defined $secure ? $secure : $CGI::secure;
22
23         my $page = $opt->{href} || $Vend::Cfg->{ProcessPage};
24         $opt->{add_dot_html} = $::Scratch->{mv_add_dot_html} unless defined $opt->{add_dot_html};
25
26         if($opt->{download_name}) {
27                 $page .= "/$opt->{download_name}";
28         }
29         elsif (Vend::Util::is_yes($opt->{add_dot_html})) {
30                 $page .= '.html' unless $page =~ m{(?:/|\.html?)$};
31         }
32
33         my $url;
34         if($secure) {
35                 $url = $Vend::Cfg->{SecurePostURL} || $Vend::Cfg->{SecureURL};
36         }
37         else {
38                 $url = $Vend::Cfg->{PostURL} || $Vend::Cfg->{VendURL};
39         }
40         $url =~ s,/*$,/,;
41         $url .= $page;
42
43         if($Global::TolerateGet and ! $opt->{no_session}) {
44                 my @args;
45                 push @args, "$::VN->{mv_session_id}=$Vend::SessionID"
46                         unless  $::Scratch->{no_session_id};
47                 push @args, "$::VN->{mv_pc}=" . ++$Vend::Session->{pageCount}
48                         unless  $::Scratch->{no_count};
49                 push @args, "$::VN->{mv_cat}=" . ++$Vend::Cat
50                         if  $Vend::VirtualCat;
51                 if(@args) {
52                         $url .= '?';
53                         $url .= join($Global::UrlJoiner, @args);
54                 }
55         }
56         return $url unless $target;
57         return qq{$url" target="$target};
58 }
59 EOR