|
Lines 39-44
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
| 39 |
); |
39 |
); |
| 40 |
|
40 |
|
| 41 |
my $op = $query->param('op') || q||; |
41 |
my $op = $query->param('op') || q||; |
|
|
42 |
my $mana_base = C4::Context->config('mana_config') || ''; |
| 43 |
# Check the mana server actually exists at the other end |
| 44 |
my $bad_url; |
| 45 |
if ($mana_base) { |
| 46 |
my $request = HTTP::Request->new( GET => $mana_base ); |
| 47 |
my $result = Koha::SharedContent::process_request($request); |
| 48 |
$bad_url = 1 unless (exists($result->{version})); |
| 49 |
} |
| 42 |
|
50 |
|
| 43 |
if ( $op eq 'save' ) { |
51 |
if ( $op eq 'save' ) { |
| 44 |
my $auto_share = $query->param('autosharewithmana'); |
52 |
my $auto_share = $query->param('autosharewithmana'); |
|
Lines 66-73
if ( $op eq 'send' ) {
Link Here
|
| 66 |
lastname => $name, |
74 |
lastname => $name, |
| 67 |
email => $email}); |
75 |
email => $email}); |
| 68 |
|
76 |
|
| 69 |
my $mana_ip = C4::Context->config('mana_config'); |
77 |
my $url = "$mana_base/getsecuritytoken"; |
| 70 |
my $url = "$mana_ip/getsecuritytoken"; |
|
|
| 71 |
my $request = HTTP::Request->new( POST => $url ); |
78 |
my $request = HTTP::Request->new( POST => $url ); |
| 72 |
$request->content($content); |
79 |
$request->content($content); |
| 73 |
my $result = Koha::SharedContent::process_request($request); |
80 |
my $result = Koha::SharedContent::process_request($request); |
|
Lines 79-89
if ( $op eq 'send' ) {
Link Here
|
| 79 |
} |
86 |
} |
| 80 |
} |
87 |
} |
| 81 |
|
88 |
|
| 82 |
|
|
|
| 83 |
my $mana_url = C4::Context->config('mana_config') || ''; |
| 84 |
|
| 85 |
$template->param( |
89 |
$template->param( |
| 86 |
mana_url => $mana_url, |
90 |
mana_url => $mana_base, |
|
|
91 |
bad_url => $bad_url, |
| 87 |
); |
92 |
); |
| 88 |
|
93 |
|
| 89 |
output_html_with_http_headers $query, $cookie, $template->output; |
94 |
output_html_with_http_headers $query, $cookie, $template->output; |