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');
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;
(-)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