View | Details | Raw Unified | Return to bug 23075
Collapse All | Expand All

(-)a/admin/share_content.pl (-6 / +11 lines)
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;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt (-1 / +4 lines)
Lines 33-38 Link Here
33
                    <div class="dialog alert" role="alert">
33
                    <div class="dialog alert" role="alert">
34
                        Mana configuration is currently empty. This feature will not work. Please contact your site administrator.
34
                        Mana configuration is currently empty. This feature will not work. Please contact your site administrator.
35
                    </div>
35
                    </div>
36
                [% ELSIF (bad_url) %]
37
                    <div class="dialog alert" role="alert">
38
                        Cannot detect mana server at <strong>[% mana_url | url %]</strong>, please ask an administrator to check your configuration.
39
                    </div>
36
                [% END %]
40
                [% END %]
37
41
38
                <h1>Share content with the Koha community using Mana KB</h1>
42
                <h1>Share content with the Koha community using Mana KB</h1>
39
- 

Return to bug 23075