+ #
+ $self -> {check_success} = $self -> check_cgi;
+
+ return;
+}
+
+### sub load_main_file #########################################################
+#
+# load and parse the forum main file
+#
+# Return: Success (true/false)
+#
+sub load_main_file {
+ my $self = shift;
+ my $lock_stat;
+
+ unless ($lock_stat = write_lock_file ($self ->{forum_file_name})) {
+ if ($lock_stat == 0) {
+ # occupied or no w-bit set for the directory..., hmmm
+ #
+ violent_unlock_file ($self -> {forum_file_name});
+ $self -> {error} = {
+ spec => 'occupied',
+ type => 'fatal'
+ };
+ return;
+ }
+ else {
+ # master lock is set
+ #
+ $self -> {error} = {
+ spec => 'master_lock',
+ type => 'fatal'
+ };
+ return;
+ }
+ }
+ else {
+ $self -> {forum} -> {flocked} = 1;
+ ( $self -> {forum} -> {threads},
+ $self -> {forum} -> {last_thread},
+ $self -> {forum} -> {last_message},
+ undef,
+ $self -> {forum} -> {unids}
+ ) = get_all_threads ($self -> {forum_file_name}, KEEP_DELETED);
+ }
+
+ # ok, looks good
+ 1;
+}
+
+### sub check_reply ############################################################
+#
+# check whether a reply is legal
+# (followup posting must exists)
+#
+# Return: Status Code (Bool)
+#
+sub check_reply {
+ my $self = shift;
+
+ # return true unless it's not a reply
+ #
+ return 1 unless $self -> {response} -> {reply};
+
+
+}
+
+### sub check_dupe #############################################################
+#
+# check whether this form request is a dupe
+# (unique id already exists)
+#
+# Return: Status Code (Bool)
+#
+sub check_dupe {
+ my $self = shift;
+
+ return 1 if ($self -> {response} -> {new_thread});