|
Lines 29-58
use CGI;
Link Here
|
| 29 |
|
29 |
|
| 30 |
my $input = CGI->new; |
30 |
my $input = CGI->new; |
| 31 |
|
31 |
|
|
|
32 |
my $templatename; |
| 33 |
my $resource = $input->param('resource'); |
| 34 |
my $flagsrequired; |
| 35 |
if ( $resource eq 'report' ) { |
| 36 |
$templatename = "mana/mana-report-search-result.tt"; |
| 37 |
$flagsrequired = { reports => 'create_reports' }; |
| 38 |
} |
| 39 |
else { |
| 40 |
$templatename = "mana/mana-subscription-search-result.tt"; |
| 41 |
$flagsrequired = { serials => 'create_subscription' }; |
| 42 |
} |
| 43 |
|
| 32 |
my ( $auth_status, $sessionID ) = |
44 |
my ( $auth_status, $sessionID ) = |
| 33 |
check_cookie_auth( $input->cookie('CGISESSID'), |
45 |
check_cookie_auth( $input->cookie('CGISESSID'), $flagsrequired ); |
| 34 |
{ serials => 'create_subscription' } ); |
|
|
| 35 |
|
46 |
|
| 36 |
if ( $auth_status ne "ok" ) { |
47 |
if ( $auth_status ne "ok" ) { |
| 37 |
exit 0; |
48 |
exit 0; |
| 38 |
} |
49 |
} |
| 39 |
|
50 |
|
| 40 |
my $templatename; |
|
|
| 41 |
if ($input->param( "resource" ) eq 'report') { |
| 42 |
$templatename = "mana/mana-report-search-result.tt"; |
| 43 |
} else { |
| 44 |
$templatename = "mana/mana-subscription-search-result.tt"; |
| 45 |
} |
| 46 |
|
| 47 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
51 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
| 48 |
{ |
52 |
{ |
| 49 |
template_name => $templatename, |
53 |
template_name => $templatename, |
| 50 |
query => $input, |
54 |
query => $input, |
| 51 |
type => "intranet", |
55 |
type => "intranet", |
| 52 |
|
56 |
flagsrequired => $flagsrequired, |
| 53 |
# flagsrequired => { serials => $permission }, |
|
|
| 54 |
flagsrequired => { serials => 'create_subscription' }, |
| 55 |
debug => 1, |
| 56 |
} |
57 |
} |
| 57 |
); |
58 |
); |
| 58 |
|
59 |
|
| 59 |
- |
|
|