6 use Catalyst::Runtime 5.80;
8 # Set flags and add plugins for the application
10 # -Debug: activates the debug mode for very useful log messages
11 # ConfigLoader: will load the configuration from a Config::General file in the
12 # application's home directory
13 # Static::Simple: will serve static files from the application's root
16 use parent qw/Catalyst/;
24 Authentication::Store::NDWeb
25 Authentication::Credential::Password
30 Session::DynamicExpiry
33 Session::State::Cookie
42 our $VERSION = '0.01';
44 # Configure the application.
46 # Note that settings in ndweb.yml (or other external
47 # configuration file that you set up manually) take precedence
48 # over this when using ConfigLoader. Thus configuration
49 # details given here can function as a default configuration,
50 # with an external configuration file acting as an override for
53 __PACKAGE__->config( name => 'NDWeb' );
54 __PACKAGE__->config->{'Plugin::Authentication'}{'use_session'} = 1;
55 __PACKAGE__->config(session => {
56 storage => "/tmp/ndweb-$>/session",
57 directory_umask => 077,
61 __PACKAGE__->config( cache => {
63 class => "Cache::FileCache",
64 cache_root => "/tmp/ndweb-$>",
66 default_expires_in => 3600,
67 directory_umask => 077,
71 __PACKAGE__->config( page_cache => {
72 set_http_headers => 1,
76 __PACKAGE__->config( default_model => 'Model');
77 # Start the application
80 __PACKAGE__->deny_access_unless('/users',[qw/admin_users/]);
81 __PACKAGE__->deny_access_unless('/alliances',[qw/alliances/]);
82 __PACKAGE__->deny_access_unless('/alliances/resources',[qw/alliances_resources/]);
83 __PACKAGE__->deny_access_unless('/graphs/alliancevsintel',[qw/graphs_intel/]);
84 __PACKAGE__->deny_access_unless('/graphs/avgalliancevsintel',[qw/graphs_intel/]);
85 __PACKAGE__->deny_access_unless('/members',[qw/members/]);
86 __PACKAGE__->deny_access_unless('/members/defenders',[qw/members_defenders/]);
87 __PACKAGE__->deny_access_unless('/covop',[qw/covop/]);
88 __PACKAGE__->deny_access_unless('/calls',[qw/calls_edit/]);
89 __PACKAGE__->allow_access_if('/calls/index',[qw/calls_list/]);
90 __PACKAGE__->allow_access_if('/calls/list',[qw/calls_list/]);
91 __PACKAGE__->allow_access_if('/calls/edit',[qw/members/]);
92 __PACKAGE__->allow_access_if('/calls/findCall',[qw/members/]);
93 __PACKAGE__->deny_access_unless('/raids',[qw/raids_edit/]);
94 __PACKAGE__->allow_access_if('/raids/index',[qw//]);
95 __PACKAGE__->allow_access_if('/raids/view',[qw//]);
96 __PACKAGE__->allow_access_if('/raids/targetcalc',[qw//]);
97 __PACKAGE__->allow_access_if('/raids/findRaid',[qw//]);
98 __PACKAGE__->allow_access_if('/raids/log',[qw//]);
99 __PACKAGE__->deny_access_unless('/intel',[qw/intel/]);
100 __PACKAGE__->deny_access_unless('/intel/members',[qw/intel_members/]);
101 __PACKAGE__->deny_access_unless('/intel/member',[qw/intel_member/]);
102 __PACKAGE__->deny_access_unless('/intel/naps',[qw/intel_naps/]);
103 __PACKAGE__->deny_access_unless('/jsrpc',[qw//]);
104 __PACKAGE__->allow_access_if('/jsrpc/end',1);
105 __PACKAGE__->deny_access_unless('/forum/allUnread',[qw//]);
106 __PACKAGE__->deny_access_unless('/forum/privmsg',[qw//]);
107 __PACKAGE__->deny_access_unless('/settings',[qw//]);
108 __PACKAGE__->deny_access_unless('/textexport/alliance',[qw/textexport_alliance/]);
112 NDWeb - Catalyst based application
116 script/ndweb_server.pl
120 [enter your description here]
124 L<NDWeb::Controller::Root>, L<Catalyst>
132 This library is free software. You can redistribute it and/or modify
133 it under the same terms as Perl itself.