#!/usr/bin/perl ######################################### # import # escorts ftp'd files into the database ######################################### use localbucky; my $pid; $dbh = DBI->connect ($dsn); our ($USER, $lastlog) = checkin(); logout() unless ($USER != -1); if ($input->{c} eq "n") { my $valid = 0; my $thread_id = 0; if ($DEBUG) { header("importing files..."); foreach $k (sort keys %$input) { print "$k => ".$input->{$k}."
"; } } foreach my $k (keys %$input) { if ($k =~ /^import/) { $valid = 1; last; } } if ($valid) { if ($input->{id} && $input->{id} ne "new") { $thread = get_thread($input->{id}); $keyword = get_keyword($thread->{keyword}); if ($thread != -1 && check_privacy($thread, $keyword)) { $thread_id = $thread->{id}; touch_thread($thread); } else { error("cannot import into specified thread"); } } else { if ($input->{title} eq undef || $input->{title} =~ /^\s+$/) { error ("No thread title!"); } else { $thread_id = add_thread($input->{title}, $USER->{username}, 0); } } print "thread_id => $thread_id
" if ($DEBUG); add_comment($thread_id,-1,$USER->{username},$input->{comment}) if ($input->{comment} ne undef); situate_imports($thread_id, $USER->{username}); if (exists($input->{keyword})) { my $k = get_keyword($input->{keyword}); if ($k->{public} || check_op($k)) { keyword_assign_mechanism($input->{keyword}, $thread_id, $k); } } } else { error("No imports specified!"); } if ($DEBUG) { print qq{this way to your new thread: link!}; footer(); } redirect("$BUCKY/details/$thread_id"); } else { my ($title, $size, $inc); my $thread = -1; my $keyword = -1; if ($input->{id}) { # id title username createdate lastmodified size private allowed flagged $thread = get_thread($input->{id}); $keyword = get_keyword($thread->{keyword}); } if ($input->{keyword}) { $keyword = get_keyword($input->{keyword}); } elsif ($thread->{keyword}) { $keyword = get_keyword($thread->{keyword}); } header("ftp import"); menu(); if ($USER->{'username'} eq "asdfasdfadsfadsf") { print <<__SORRY__;

SORRY!
You have maxed out your upload quota!

Delete some things you've uploaded, then try again.


__SORRY__ exit; } print <
UPLOAD FILES TO BUCKY WITH CONVENIENCE USING SFTP
You must generate a cryptographic key to use this service. Don't worry it's easy!



ON A MAC / UNIX

recc'd sftp client: Cyberd*ck
to generate the key, from Terminal run:
ssh-keygen -t rsa
send me the public key
(private key is handled automatically)



ON WINDOWS ...

recc'd sftp client: WINSCP (PC)
generate the key with the program puttygen
send me the public key
(the private key goes in the program when you set up the session.)



log in here:

$BUCKY_FTP_HOST
username: $BUCKY_FTP_USER




Once you're in, upload your files and they should show up below. Check off only the files that are yours, or click the toggle button to select them all. impHEAD if ($thread == -1) { print qq(To attach FTP'd files to a pre-existing thread, go to the thread and click ftp here.); } print qq!
\n\n!; print qq!
\n!; print qq!
\n!; ($title, $inc, $size) = list_imports(); print <
widget if ($inc) { print "
INCOMPLETE FILES ARE SHOWN IN ITALICS -- PLEASE WAIT FOR YOUR UPLOAD TO FINISH

\n\n"; } if ($DEBUG) { print qq!\n!; } print qq!\n!; print qq!

!; print qq!!; if ($thread != -1 && check_privacy($thread, $keyword)) { print qq!!; } else { print qq!\n\n!; print qq!!; print qq!!; } print qq!!; print qq!
!; print qq! !; print qq!!; print qq!These files will be added to:

$thread->{title}
\n!; print qq!posted by $thread->{username} on !.verbosedate($thread->{createdate}).qq!

\n\n!; print qq!\n!; print qq!

!; print qq!title: !; print qq!!; print qq!
\n!; print qq!
!; print "keyword: "; print qq!!; if (exists($input->{keyword})) { my $k = get_keyword($input->{keyword}); if ($k->{public} || check_op($k)) { keyword_pulldown($k->{keyword}); $checked = $k->{public} ? "" : " checked"; } else { keyword_pulldown("NONE"); } } else { keyword_pulldown("NONE"); } print qq!
!; print " "; print qq!
!; print qq!comment: !; print qq!!; print <

impFOOT footer(); } $dbh->disconnect ();