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') || q{}; |
52 |
my $auto_share = $query->param('autosharewithmana') || q{}; |
Lines 64-71
if ( $op eq 'send' ) {
Link Here
|
64 |
my $content = to_json({name => $name, |
72 |
my $content = to_json({name => $name, |
65 |
email => $email}); |
73 |
email => $email}); |
66 |
|
74 |
|
67 |
my $mana_ip = C4::Context->config('mana_config'); |
75 |
my $url = "$mana_base/getsecuritytoken"; |
68 |
my $url = "$mana_ip/getsecuritytoken"; |
|
|
69 |
my $request = HTTP::Request->new( POST => $url ); |
76 |
my $request = HTTP::Request->new( POST => $url ); |
70 |
$request->content($content); |
77 |
$request->content($content); |
71 |
my $result = Koha::SharedContent::process_request($request); |
78 |
my $result = Koha::SharedContent::process_request($request); |
Lines 77-87
if ( $op eq 'send' ) {
Link Here
|
77 |
} |
84 |
} |
78 |
} |
85 |
} |
79 |
|
86 |
|
80 |
|
|
|
81 |
my $mana_url = C4::Context->config('mana_config') || q{}; |
82 |
|
83 |
$template->param( |
87 |
$template->param( |
84 |
mana_url => $mana_url, |
88 |
mana_url => $mana_base, |
|
|
89 |
bad_url => $bad_url, |
85 |
); |
90 |
); |
86 |
|
91 |
|
87 |
output_html_with_http_headers $query, $cookie, $template->output; |
92 |
output_html_with_http_headers $query, $cookie, $template->output; |