#!/perl/bin/perl.exe ########################### ## ## this is a debug script to simply test each module's abilities ## ## if a new subroutine has been added to any module within ## the pm folder AND it requires testing, search THIS ## document for ## "# [modulename] TESTS" ## where [modulename] is the name of a module. eg: "bc_sql" ## add the new test in the same way as other tests found in this script ## ########################### # must have's! use strict; use warnings; use CGI::Carp qw(fatalsToBrowser); use DBI; use URI::Escape; use pm::bc_chef; use pm::bc_misc; use pm::bc_sql; use pm::subdesc; use pm::redir; use pm::search; use pm::security; my $BORDER = 0; my $navheight = 20; my $navcontainerheight = $navheight + 20; my $loggedin = pm::bc_chef::cookie_get("loggedin"); my $db = sql_connect("ns.db"); if ($loggedin !~ /^A6DE0E8077|7EE22A4BBF$/i) { if (not isUserAdmin($loggedin)) { print error_redir("/", "Access Denied"); exit 1; } } ################################################################################## ################################################################################## ################################################################################## ################################################################################## ################################################################################## # much of the code is redacted here, and only what you need is included # things like "display_debug_one" and related are redacted, since they just # display things and have no real affect / effect on the data at all my $COOL_DOT = " • "; my $rv = "cache-control: no-store\n"; $rv .= "content-type: text/html\n\n"; $rv .= "\n"; $rv .= "\n"; $rv .= " NS Debug Page\n"; $rv .= " \n"; $rv .= "\n"; $rv .= "\n"; # a paramater to capture the selected PM with my $debug_page = get_constant($db, "QUERY_DEBUG_PAGE"); my $pm = lc(get_param($debug_page)); if (not $pm) { # this part redacted, since it simply displays a menu... # end if (not $pm) } else { # if $pm contains a value if ($pm eq "chef") { ################################ # bc_chef TESTS $rv .= display_module("bc_chef", "Chef"); $rv .= "





\n"; $rv .= pm::bc_chef::_tests(); } elsif ($pm eq "date") { ############ # date TESTS $rv .= display_module("date", "Date"); $rv .= "





\n"; $rv .= pm::date::_tests(); } elsif ($pm eq "dir") { ############ # bc_dir TESTS $rv .= display_module("bc_dir", "Directory"); $rv .= "





\n"; $rv .= pm::bc_dir::_tests(); } elsif ($pm eq "misc") { ############ # bc_misc TESTS $rv .= display_module("bc_misc", "Miscellaneous"); $rv .= "





\n"; $rv .= pm::bc_misc::_tests(); } elsif ($pm eq "sql") { ############ # bc_sql TESTS $rv .= display_module("bc_sql", "SQL"); $rv .= "





\n"; $rv .= pm::bc_sql::_tests(); } elsif ($pm eq "user") { ############ # user TESTS $rv .= display_module("user", "User"); $rv .= "





\n"; $rv .= pm::user::_tests(); } elsif ($pm eq "html") { ############ # html TESTS $rv .= display_module("html", "HTML"); $rv .= "





\n"; $rv .= pm::html::_tests(); } elsif ($pm eq "redir") { ############ # redir TESTS $rv .= display_module("redir", "Redirection"); $rv .= "





\n"; $rv .= pm::redir::_tests(); } elsif ($pm eq "search") { ############ # search TESTS $rv .= display_module("search", "Search"); $rv .= "





\n"; $rv .= pm::search::_tests(); } elsif ($pm eq "security") { ############ # security TESTS $rv .= display_module("security", "Security"); $rv .= "





\n"; $rv .= pm::security::_tests(); } elsif ($pm eq "subdesc") { ############ # subdesc TESTS $rv .= display_module("subdesc", "SubDesc"); $rv .= "





\n"; # no tests needed. "debug.pl" uses the subdesc module EVERYWHERE, so it is tested and if it fails, you'll know... #$rv .= pm::subdesc::_tests(); $rv .= "no tests performed here: debug.pl is the test!
\n"; } elsif ($pm eq "faq") { $rv .= display_faq(); # no associated debugging output } elsif ($pm eq "howto") { $rv .= display_howto(); # no associated debugging output } elsif ($pm eq "notes") { $rv .= display_notes(); # no associated debugging output } elsif ($pm eq "ppdebug") { $rv .= display_paypal_debugger(); # no additional debugging output } else { $rv .= "Unrecognized module selected: $pm
\n"; } # end else of if (not $pm) }