diff --git a/trunk/include.pl b/trunk/include.pl index f0e9739..b19d114 100644 --- a/trunk/include.pl +++ b/trunk/include.pl @@ -1,5 +1,5 @@ +use CGI qw(:standard); use CGI::Session; -use CGI; use DBI; use XML::Simple qw(:strict); diff --git a/trunk/login.pl b/trunk/login.pl index 38710f0..32a1330 100644 --- a/trunk/login.pl +++ b/trunk/login.pl @@ -1,8 +1,8 @@ require "/var/www/perl/include.pl"; CGI::Session->name($session_name); -$session = new CGI::Session; $query = new CGI; +$session = new CGI::Session; if($query->param('action')) { $dbh = DBI->connect("DBI:mysql:$database:$dbhost", $dbuser, $dbpass); @@ -49,5 +49,4 @@ if($query->param('action')) {
'; - print STDIN; } diff --git a/trunk/register.pl b/trunk/register.pl index 4194b81..31df645 100644 --- a/trunk/register.pl +++ b/trunk/register.pl @@ -1,8 +1,8 @@ require "/var/www/perl/include.pl"; CGI::Session->name($session_name); -$session = new CGI::Session; $query = new CGI; +$session = new CGI::Session; if($query->param('user') and $query->param('pass')) { $dbh = DBI->connect("DBI:mysql:$database:$host", $dbuser, $dbpass); diff --git a/trunk/upload.pl b/trunk/upload.pl new file mode 100644 index 0000000..41d53f0 --- /dev/null +++ b/trunk/upload.pl @@ -0,0 +1,22 @@ +require "/var/www/perl/include.pl"; +require "/var/www/perl/functions.pl"; + +#create or resume session +CGI::Session->name($session_name); +my $session = new CGI::Session; + +my $username = get_username_from_sid($session->id); + +if($username) { + print $session->header(); + print ''; +} else { + print $session->header(); + print "nope..."; +} diff --git a/trunk/uploader.pl b/trunk/uploader.pl new file mode 100644 index 0000000..b2a6a02 --- /dev/null +++ b/trunk/uploader.pl @@ -0,0 +1,30 @@ +require "/var/www/perl/include.pl"; +require "/var/www/perl/functions.pl"; + +CGI::Session->name($session_name); +$query = CGI->new(\&hook); +$session = new CGI::Session; +#$query = new CGI; + +sub hook { + my ($filename, $buffer, $bytes_read, $data) = @_; + open(TEMP, ">/var/www/perl/temp.temp") or die "cannot open"; + print TEMP "Read $bytes_read bytes of $filename\n"; + close TEMP; +} + +my $username = get_username_from_sid($session->id); + +if($username) { + my $filename = $query->param("file"); + my $title = $query->param("title"); + $upload_filehandle = $query->upload("file"); + print $session->header(); + while ( <$upload_filehandle> ) + { + print; + } +} else { + print $session->header(); + print "nope..."; +} diff --git a/trunk/xsl/xhtml.xsl b/trunk/xsl/xhtml.xsl index cca8cf9..d6bf83a 100755 --- a/trunk/xsl/xhtml.xsl +++ b/trunk/xsl/xhtml.xsl @@ -73,7 +73,7 @@