#!/usr/bin/perl
#########################################
# administration of threads, keywords,
# privacy, etc.
use localbucky;
our $id;
our $files;
$dbh = DBI->connect ($dsn);
our ($USER, $lastlog) = checkin();
logout() unless ($USER != -1);
if ($USER->{ulevel} != 3)
{ redirect("/"); }
else
{
header( { title => "bucky administrauma", color => "red" } );
menu();
if (exists($input->{c}))
{
if ($input->{c} eq "s")
{
update_thread_title($id, $input->{title});
$t->{title} = $input->{title};
print "Changed thread $id title to: $t->{title}
\n";
}
elsif ($input->{c} eq "pass")
{
do_password_reset();
}
elsif ($input->{c} eq "p")
{
if ($input->{private} == 1)
{
print "Thread is now private.
";
switch_thread_privacy($id, 1);
$t->{allowed} = update_whitelist();
$t->{private} = 1;
}
else
{
print "Thread is now public.
";
switch_thread_privacy($id, 0);
$t->{private} = 0;
}
}
elsif ($input->{c} eq "f")
{
my @flagged = corral($input, "file");
if ($DEBUG)
{
print "
\nfiles flagged: ";
foreach (@flagged)
{ print; print " "; }
print "
\n";
}
if ($input->{verb} eq "flag")
{
print "Flagged file $flagged[0]
";
update_flagged($id, $flagged[0]);
$t->{flagged} = $flagged[0];
admin_form($id, $t, $files, $k);
}
elsif ($input->{verb} eq "move")
{
print "When this works it will be like this:!
\n";
print "Where do you want to move these files here
\n";
print "Moving files...
\n";
# system("mv", $data_path/$oldpid/$filenamea ..., "$data_path/$newpid/");
print "Moving ids...
\n";
print "Recalculating thread sizes...
\n";
}
elsif ($input->{verb} eq "rm")
{
if (!$input->{ok})
{
print qq!
\n!; print qq!
| \n\n}; # my $reqs = get_user_requests(); # if ($reqs != -1) # { # my $s = (@$reqs != 1) ? "s" : ""; # alert_box("$BUCKY/approve", @$reqs." account request$s pending!"); # } print < |