]> ruin.nu Git - ndwebbie.git/blob - lib/NDWeb.pm
Converted naps page
[ndwebbie.git] / lib / NDWeb.pm
1 package NDWeb;
2
3 use strict;
4 use warnings;
5
6 use Catalyst::Runtime '5.70';
7
8 # Set flags and add plugins for the application
9 #
10 #         -Debug: activates the debug mode for very useful log messages
11 #   ConfigLoader: will load the configuration from a YAML file in the
12 #                 application's home directory
13 # Static::Simple: will serve static files from the application's root 
14 #                 directory
15
16 use parent qw/Catalyst/;
17
18 our $VERSION = '0.01';
19
20 # Configure the application. 
21 #
22 # Note that settings in ndweb.yml (or other external
23 # configuration file that you set up manually) take precedence
24 # over this when using ConfigLoader. Thus configuration
25 # details given here can function as a default configuration,
26 # with a external configuration file acting as an override for
27 # local deployment.
28
29 __PACKAGE__->config( name => 'NDWeb' );
30 __PACKAGE__->config->{'Plugin::Authentication'}{'use_session'} = 1;
31 __PACKAGE__->config(session => {
32         storage => "/tmp/ndweb-$>/sesession",
33         directory_umask => 077,
34         expires => 300,
35         verify_address => 1,
36 });
37 __PACKAGE__->config( cache => {
38         backend => {
39                 class => "Cache::FileCache",
40                 cache_root => "/tmp/ndweb-$>",
41                 directory_umask => 077,
42         },
43 });
44
45 __PACKAGE__->config( page_cache => {
46         set_http_headers => 1,
47 });
48
49
50 # Start the application
51 __PACKAGE__->setup(qw/
52         -Debug
53         ConfigLoader
54         Static::Simple
55
56         Authentication
57         Authentication::Store::NDWeb
58         Authentication::Credential::Password
59
60         Authorization::Roles
61         Authorization::ACL
62         
63         Session::DynamicExpiry
64         Session
65         Session::Store::File
66         Session::State::Cookie
67
68         Cache
69         PageCache
70         /);
71
72
73 __PACKAGE__->deny_access_unless('/users',[qw/admin_users/]);
74 __PACKAGE__->deny_access_unless('/alliances',[qw/alliances/]);
75 __PACKAGE__->deny_access_unless('/alliances/resources',[qw/alliances_resources/]);
76 __PACKAGE__->deny_access_unless('/graphs/alliancevsintel',[qw/graphs_intel/]);
77 __PACKAGE__->deny_access_unless('/graphs/avgalliancevsintel',[qw/graphs_intel/]);
78 __PACKAGE__->deny_access_unless('/members',[qw/members/]);
79 __PACKAGE__->deny_access_unless('/covop',[qw/covop/]);
80 __PACKAGE__->deny_access_unless('/calls/list',[qw/calls_list/]);
81 __PACKAGE__->deny_access_unless('/calls/postcallcomment',[qw/calls_edit/]);
82 __PACKAGE__->deny_access_unless('/calls/postcallupdate',[qw/calls_edit/]);
83 __PACKAGE__->deny_access_unless('/calls/postattackerupdate',[qw/calls_edit/]);
84 __PACKAGE__->deny_access_unless('/calls/defleeches',[qw/calls_leeches/]);
85 __PACKAGE__->deny_access_unless('/raids',[qw/raids_edit/]);
86 __PACKAGE__->allow_access_if('/raids/index',1);
87 __PACKAGE__->allow_access_if('/raids/view',1);
88 __PACKAGE__->allow_access_if('/raids/findRaid',1);
89 __PACKAGE__->allow_access_if('/raids/log',1);
90 __PACKAGE__->deny_access_unless('/intel',[qw/intel/]);
91 __PACKAGE__->deny_access_unless('/intel/members',[qw/intel_members/]);
92 __PACKAGE__->deny_access_unless('/intel/member',[qw/intel_member/]);
93 __PACKAGE__->deny_access_unless('/intel/naps',[qw/intel_naps/]);
94
95 =head1 NAME
96
97 NDWeb - Catalyst based application
98
99 =head1 SYNOPSIS
100
101     script/ndweb_server.pl
102
103 =head1 DESCRIPTION
104
105 [enter your description here]
106
107 =head1 SEE ALSO
108
109 L<NDWeb::Controller::Root>, L<Catalyst>
110
111 =head1 AUTHOR
112
113 Catalyst developer
114
115 =head1 LICENSE
116
117 This library is free software, you can redistribute it and/or modify
118 it under the same terms as Perl itself.
119
120 =cut
121
122 1;