#!/usr/bin/perl #!/usr/bin/speedy -- -M1 # GRR! Not even this gets rid of the messages... $ENV{'EMBPERL_SESSION_HANDLER_CLASS'} = 'no'; # This script is the interface to get the panel going # TODO: eliminate globals # There are three globals: # $::q - A CGI object (the query) # $::s - A CGI::Session object # $::p - The panel use strict; use lib qw( share share/lib ); use Panel; use CGI; use CGI::Session; use CGI::Session::ID::MD5; use Data::Dumper; $| = 1; use CGI::SpeedyCGI; my $sp = CGI::SpeedyCGI->new; $sp->register_cleanup(sub { if ($::s) { $::s->param($::newpid, { 'page' => $::p, 'timestamp' => time }); $::s->flush(); } }); my $realuser = (getpwuid($>))[0]; # Set up the Query and Session $::q = new CGI; mkdir "/tmp/$realuser", 0700; $::s = $::s || new CGI::Session(undef, $::q, {Directory=>"/tmp/$realuser/"}); $::pid = $::q->param('pid'); $::newpid = CGI::Session::ID::MD5::generate_id(); if($::pid) { $::cur = $::s->param($::pid); if($::cur) { $::p = $::cur->{'page'}; } else { $::p = new Panel(); } } else { $::pid = '0'; $::p = new Panel(); } # I would like to eliminate this bit... but I don't know how # It fixes CGI::Session's save of the panel object my $VAR1; eval(Dumper($::p)); $::p = $VAR1; $::p->resume(); # And last but not least, start the panel! $::p->main();