]> bicyclesonthemoon.info Git - ott/bsta/blobdiff - frame.1.pl
Adapted for new config tool.
[ott/bsta] / frame.1.pl
index ad58411e6b161fee9f90fd6b9a383bc8324f44c2..7645c47039c92b495ef093accb70aa9172f34e0d 100644 (file)
@@ -1,37 +1,36 @@
-###PERL;
-#
+###RUN_PERL: #!/usr/bin/perl
+
 # /bsta/f
 # viewer.pl is generated from viewer.1.pl.
-# 19.10.2016
 #
 # The frame interface
 #
-#    Copyright (C) 2016  Balthasar SzczepaƱski
+# Copyright (C) 2016, 2023  Balthasar SzczepaƱski
 #
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
 #
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
 #
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 use strict;
 #use warnings;
-###LIB;
+###PERL_LIB: use lib /botm/lib/bsta
 
 use bsta_lib qw(failpage gethttpheader getcgi readdatafile);
 
-###SETTINGS_PATH;
-###DEFAULT_PATH;
-###DATA_PATH;
-###STATE_PATH;
-###NOACCESS_PATH;
+###PERL_DATA_PATH:          DATA_PATH          = /botm/data/bsta
+###PERL_DATA_DEFAULT_PATH:  DATA_DEFAULT_PATH  = /botm/data/bsta/default
+###PERL_DATA_NOACCESS_PATH: DATA_NOACCESS_PATH = /botm/data/bsta/noaccess
+###PERL_DATA_SETTINGS_PATH: DATA_SETTINGS_PATH = /botm/data/bsta/settings
+###PERL_DATA_STATE_PATH:    DATA_STATE_PATH    = /botm/data/bsta/state
 
 my %http;
 my %cgi;
@@ -55,7 +54,7 @@ my $buffer;
 my @fileinfo;
 
 delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
-###PATH;
+###PERL_SET_PATH: $ENV{'PATH'} = /usr/local/bin:/usr/bin:/bin;
 
 if ($ENV{'REQUEST_METHOD'} =~ /^(HEAD|GET|POST)$/) {
        $method=$1;
@@ -97,9 +96,9 @@ else {
        $password='';
 }
 
-%settings=readdatafile(SETTINGS_PATH);
-%default=readdatafile(DEFAULT_PATH);
-%state=readdatafile(STATE_PATH);
+%settings=readdatafile(DATA_SETTINGS_PATH);
+%default=readdatafile(DATA_DEFAULT_PATH);
+%state=readdatafile(DATA_STATE_PATH);
 if($frame<0) {
        $frame = $state{'last'} + $frame +1;
 }
@@ -116,12 +115,12 @@ else{
        $passwordOK = 0;
 }
 
-if ($passwordOK || (int($state{'state'}) >= 1 && $frame <= int($state{'last'}) && $frame > 0)) {
+if ($passwordOK || (int($state{'state'}) >= 1 && $frame <= int($state{'last'}) && $frame >= 0)) {
        $access=1;
 }
 else {
        $access=0;
-       %framedata = readdatafile(NOACCESS_PATH);
+       %framedata = readdatafile(DATA_NOACCESS_PATH);
        foreach my $ind (keys %default) {
                unless(defined($framedata{$ind})){
                        $framedata{$ind}=$default{$ind};