[Xitami] Perl script deleting all my perl scripts ?
xitami@lists.xitami.org
xitami@lists.xitami.org
Mon, 11 Mar 2002 08:51:42 +0100
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C1C8D1.9548C9A0
Content-Type: text/plain;
charset="iso-8859-1"
Hi again,
I think the deletion happens in the code in attach. I don't know whether
you would have the time to take a look at this file, but it would be greatly
appreciated. What is a directory read ?!
Best Regards,
-----Original Message-----
From: Russel Olinger [mailto:rolinger@airpower.net]
Sent: vendredi 8 mars 2002 1:15
To: activeperl; xitami@lists.xitami.org
Subject: Re: [Xitami] Perl script deleting all my perl scripts ?
you should post your article to: activeperl@listserv.ActiveState.com
however, you need to register with the site first before you can post to the
forums. It sounds like a directory read deleting your .pl files....post me
the code that is causing the deletes.
-R
----- Original Message -----
From: <nico.debackere@skynet.be>
To: "Xitami" <xitami@lists.xitami.org>
Sent: Thursday, March 07, 2002 3:58 PM
Subject: [Xitami] Perl script deleting all my perl scripts ?
> Hi,
>
> I am using a tested web infrastructure, and it seems to work fine, excepts
> for some buttons; when I use them, all my scripts.pl dissapear from the
> cgi-bin directory! I've tried moving them to another directory, but there
> the same thing happend. The problem is I am no good around Perl, any
> suggestions ?
> Any comment welcome.
>
> Joris
>
>
>
> --
> Xitami Users Mailing List -- For Xitami support
> To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
>
--
Xitami Users Mailing List -- For Xitami support
To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
------_=_NextPart_000_01C1C8D1.9548C9A0
Content-Type: application/octet-stream;
name="welcome.pl"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="welcome.pl"
#!perl
#
# The welcome page. It handles the bottom frame. Generally, it splits
# the bottom frame into two more frames - the left (navigation) and =
right (info)
# frames.
#
# It also is used to reset the cookies on the client side when the user =
logs
# out.=20
#=20
use CGI qw(:standard);
require "systemPaths";
if (param('page') eq 'menus') {
showMenus();
}
elsif ((param('page') eq 'search') || (param('startOver'))) {
showFlightSearch();
}
elsif (param('page') eq 'itinerary') {
showItinerary();
}
else {
showDefault();
}
########################################################################=
##
#
# show the menus - the search/itinerary/home/logout menu on the left,
# and the homepage on the right. home button is shaded.
#
sub showMenus {
print header();
print <<EOF;
<!--=20
User has returned to the home page. Since user has already logged on,
we can give them the menu in the navbar.
--->
<html>
<title>Mercury Tours</title>
<!-- Frame Set -->
<frameset cols=3D"125,*" border=3D0 frameborder=3D0>
<!-- Navigation Frame -->
<frame src=3Dnav.pl?page=3Dmenu&in=3Dhome name=3Dnavbar=20
marginheight=3D0 marginwidth=3D0 noresize scrolling=3Dauto>
<!-- Intro Frame -->
<frame src=3Dlogin.pl?intro=3Dtrue name=3Dinfo=20
marginheight=3D0 marginwidth=3D0 noresize scrolling=3Dauto>
</frameset>
EOF
}
#
# start the flight search sequence...load the menu with the search =
button
# shaded...and start the flight intro page, allowing the users to =
search
# through the various flights available.
#
sub showFlightSearch {
print header();
print <<EOF;
<!--=20
User has returned to the search page. Since user has already logged =
on,
we can give them the menu in the navbar.
--->
<html>
<title>Mercury Tours</title>
<!-- Frame Set -->
<frameset cols=3D"125,*" border=3D0 frameborder=3D0>
<!-- Navigation Frame -->
<frame src=3Dnav.pl?page=3Dmenu&in=3Dflights name=3Dnavbar=20
marginheight=3D0 marginwidth=3D0 noresize scrolling=3Dauto>
<!-- Reservation Frame -->
<frame src=3Dreservations.pl?page=3Dwelcome name=3Dinfo=20
marginheight=3D0 marginwidth=3D0 noresize scrolling=3Dauto>
</frameset>
EOF
}
#
# load the itinerary pages into the info frame...and shade the =
itinerary
# button.
#
sub showItinerary {
print header();
print <<EOF;
<!--=20
User wants the intineraries. Since user has already logged on,
we can give them the menu in the navbar.
--->
<html>
<title>Mercury Tours</title>
<!-- Frame Set -->
<frameset cols=3D"125,*" border=3D0 frameborder=3D0>
<!-- Navigation Frame -->
<frame src=3Dnav.pl?page=3Dmenu&in=3Ditinerary name=3Dnavbar=20
marginheight=3D0 marginwidth=3D0 noresize scrolling=3Dauto>
<!-- Itinerary Frame -->
<frame src=3Ditinerary.pl name=3Dinfo=20
marginheight=3D0 marginwidth=3D0 noresize scrolling=3Dauto>
</frameset>
EOF
}
#
# This is the default page. It gives the user two cookies. Once cookie
# is used as user information - it starts out with only a session value =
- which
# is used later on as a weak form of authentication. The MSO cookie is =
used
# to maintain the server options as the user moves throughout the site.
# Load in the login navigation page, with the welcome to mercury tours
# homepage.
#
# If the users directory doesn't exist in MTData, it will create it,
# and all its subdirectories. Subdirectories are used to store =
usernames
# by hash values.
#
sub showDefault {
# create a session ID - it's just the time for now..
$cookie1 =3D fillCookie();
# delete any old info and get a new server option cookie
if (param('signOff')) {
$cookie2 =3D cookie(-name=3D>'MTUserInfo', -value=3D>"",
-path=3D>"/", -expires=3D>'-1d');
print header(-cookie=3D>[$cookie1, $cookie2]);
}
# give them a cookie if they don't already have one.
elsif (!cookie('MSO')) {
print header(-cookie=3D>$cookie1);
}
else {
print header();
}
=09
=09
# Framesets can't be in the body....
print <<EOF;
<!--=20
A Session ID has been created and loaded into a cookie called MSO.
Also, the server options have been loaded into the cookie called
MSO as well. The server options can be set via the Admin page.
--->
<html>
<title>Mercury Tours</title>
<!-- Frame Set -->
<frameset cols=3D"125,*" border=3D0 frameborder=3D0>
<!-- Navigation Frame -->
<frame src=3Dnav.pl?in=3Dhome name=3Dnavbar marginheight=3D0 =
marginwidth=3D0=20
noresize scrolling=3Dauto>
<!-- Home Frame -->
<frame src=3D$pageBase/home.html name=3Dinfo marginheight=3D0 =
marginwidth=3D0=20
noresize scrolling=3Dauto>
</frameset>
EOF
print end_html();
=09
chdir ("MTData");=09
createDirectories() unless (-d "users");
}
#
# Utility functions to=20
# build the necessary file structure
# load the server options for a cookie
# create the actual cookie.
#
sub createDirectories {
mkdir ("users", 0777) unless (-d "users");
chdir("users");
for ($i =3D 0; $i < 128; $i++) {
mkdir($i, 0777) unless (-d $i);
}
}
sub loadServerOptions {
%tempOptions =3D ( "SID" =3D> time);
=09
$ip =3D remote_addr();
$filename =3D $ip."so";
$filename =3D~ s/\.//g;
chdir("MTData");
open (ADMINFILE, "<$filename") or return %tempOptions;
$query =3D new CGI(ADMINFILE);
close ADMINFILE; =20
@names =3D $query->param;
foreach $key (@names) {
$tempOptions{$key} =3D $query->param($key) unless ($key eq =
'save');
}
=09
return %tempOptions;
}
=09
sub fillCookie { =09
%options =3D loadServerOptions();
return cookie(-name=3D>'MSO',
-value=3D>\%options,
-path=3D>"/");
}
------_=_NextPart_000_01C1C8D1.9548C9A0--