maint.pl
126 lines of code
1
#!/usr/bin/perl
2
3
($<,$>) = (getpwnam('nobody'), getpwnam('nobody')) or die $!;
4
5
binmode(STDIN, ":utf8");
6
binmode(STDOUT, ":utf8");
7
8
# must have's!
9
use strict;
10
use warnings;
11
use CGI::Carp qw(fatalsToBrowser);
12
use DBI;
13
use URI::Escape;
14
15
use lib "./Pm";
16
17
use Html qw(pre_html_header header html_end debug_banner);
18
use Html2 qw(tag br hr);
19
use Bc_chef qw(cookie_get);
20
use Bc_misc qw(get_param referrer get_params_asHash);
21
use Bc_sql qw(
22
              get_constant
23
              sql_execute
24
              user_exists
25
              $QUERY_PAGE
26
              $QUERY_UID
27
              $LOGGEDIN
28
29
              $DB
30
             );
31
32
use Security qw(banned); Security::count_hits();
33
34
use Redir qw(error_redir notice_redir);
35
36
#######################################
37
# add your own USE statements here
38
39
# end of your USE statements
40
#######################################
41
42
my $DEBUG = 0;
43
my $DEBUG_STR = "";
44
45
my %params = get_params_asHash();
46
47
my $output;
48
49
$output = pre_html_header({skipmaintcheck=>1});
50
$output .= header(
51
                  "System Maintenance",
52
                  "?&nogrid=1",
53
                  0,
54
                  "setTimeout(removeMsg, " . get_constant("REMOVE_MSG_TIMEOUT") . ");",
55
                  "",
56
                  "style=\"padding: 0; margin: 0;\""
57
                 );
58
59
if ($DEBUG) {
60
  if (keys %params) {
61
    foreach my $key (sort keys %params) {
62
      $params{$key} =~ s/^ *//;
63
      $params{$key} =~ s/ *$//;
64
      $DEBUG_STR .= "$key = $params{$key}" . br;
65
    }
66
  } else {
67
    { my %str;
68
      $str{tag} = "div";
69
      $str{class} = "red-panel";
70
      $str{innerHTML} = "No Params Given!";
71
72
      $DEBUG_STR .= tag(\%str);
73
    }
74
    $DEBUG_STR .= br;
75
  }
76
77
  $output .= debug_banner("System Maintenance", $DEBUG_STR, 1);
78
}
79
80
############################################################
81
### YOUR CONTENT HERE
82
83
{ my %container;
84
  $container{tag} = "div";
85
  $container{class} = "fullsize bordered flexboxed";
86
  $container{html} = "";
87
88
  { my %fs;
89
    $fs{tag} = "fieldset";
90
    $fs{class} = "min-content nowrap margins-auto text-align-center padded";
91
    $fs{html} = "";
92
93
    { my %legend;
94
      $legend{tag} = "legend";
95
      $legend{html} = "";
96
97
      { my %img;
98
        $img{tag} = "img";
99
        $img{class} = "margins-right";
100
        $img{src} = "/images/site/error.png";
101
        $img{height} = 20;
102
103
        $legend{html} .= tag(\%img);
104
      }
105
106
      $legend{html} .= "System Maintenance";
107
108
      $fs{html} .= tag(\%legend);
109
    }
110
111
    $fs{html} .= "The website is currently undergoing" . br() .
112
                 "maintenance.  Please stand by...";
113
114
    $container{html} .= tag(\%fs);
115
  }
116
117
  $output .= tag(\%container);
118
}
119
120
### END YOUR CONTENT
121
$output .= html_end();
122
############################################################
123
124
print $output;
125
126
exit 1;