]> ruin.nu Git - ndwebbie.git/blob - lib/NDWeb.pm
Converted memberIntel
[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
94 =head1 NAME
95
96 NDWeb - Catalyst based application
97
98 =head1 SYNOPSIS
99
100     script/ndweb_server.pl
101
102 =head1 DESCRIPTION
103
104 [enter your description here]
105
106 =head1 SEE ALSO
107
108 L<NDWeb::Controller::Root>, L<Catalyst>
109
110 =head1 AUTHOR
111
112 Catalyst developer
113
114 =head1 LICENSE
115
116 This library is free software, you can redistribute it and/or modify
117 it under the same terms as Perl itself.
118
119 =cut
120
121 1;