#!/usr/local/bin/perl -w ###################### # Copyright © 2000 Portal Scripts. # All Rights Reserved. # # The original developer of this software module and his/her company, the subsequent # editors and their companies, have no liability for use of this # software module or modifications thereof in an implementation. # # Permission to use, copy, and modify this software and its documentation on # the server of the customer is hereby granted, provided that the above copyright # notice, this paragraph and the following two paragraphs appear in all # copies. # # This software program and documentation are copyrighted by Portal Scripts. # The software program and documentation are supplied "as is", without any # accompanying services. Portal Scripts does not # warrant that the operation of the program will be # uninterrupted or error-free. # # IN NO EVENT SHALL PORTAL SCRIPTS BE LIABLE TO ANY PARTY FOR # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING # LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION. # ###################### use strict; my $real_path; if($^O =~ m#win32#i){ if($ENV{'PATH_TRANSLATED'} ne ""){ $real_path = $ENV{'PATH_TRANSLATED'}; $real_path =~ s#\\#/#g; $real_path =~ s#[^/]*$##; chdir($real_path); } } else{ if($ENV{'SCRIPT_FILENAME'} ne ""){ $real_path = $ENV{'SCRIPT_FILENAME'}; $real_path =~ s#[^/]*$##; chdir($real_path); } } my $exit; eval q{use LWP::Simple;}; if($@ ne ''){ print "Content-type: text/html\n\n"; print qq! LWP::Simple perl library is not found in your installation.
This is a requirement to be able to run ODP++.

!; $exit = 1; } eval q{use URI::Escape;}; if($@ ne ''){ print "Content-type: text/html\n\n"; print qq! URI::Escape perl library is not found in your installation.
This is a requirement to be able to run ODP++.

!; $exit = 1; } exit if($exit == 1); my $help = get("http://www.portalscripts.com/odp/help.txt"); my %HELP = grep{length} split("", $help); chdir(".."); require "tools.pm"; my %formdata = &Parse_Form; my %CONFIG = &read_config; if($CONFIG{'MAX_LOGS'} > 1000){ $CONFIG{'MAX_LOGS'} = 1000; } print "Content-type: text/html\n\n"; if(exists $formdata{'current_admin_password'}){ if($formdata{'current_admin_password'} eq $CONFIG{'ADMIN_PASSWORD'}){ delete $formdata{'current_admin_password'}; delete $formdata{'submit'}; update_conf(\%formdata); print qq! Your changes are saved. Click here to continue modifying your configuration. !; } else{ print "authorization incorrect"; } exit; } if(exists $formdata{'enterance_pass'}){ if($formdata{'enterance_pass'} eq $CONFIG{'ADMIN_PASSWORD'}){ my $out = ""; $out .= qq! ODP++

ODP++ Admin

!; for my $key (sort keys %CONFIG){ my $temp = $key; $temp =~ s#_# #g; $out .= qq! !; } $out .= qq!
Item Value Quick Help
$temp $HELP{$key}

!; print $out; } else{ print "authorization incorrect"; } exit; } print qq!

Password:

!; sub update_conf { my ($formdata) = @_; open(LIST, ">system.conf"); flock(LIST, 2); for (keys %$formdata){ print LIST "$_ == $formdata->{$_}\n"; } flock(LIST, 8); close(LIST); }