Support logins, show more useful information

git-svn-id: svn://10.0.0.236/trunk@137309 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
johnkeis 2003-02-03 03:46:42 +00:00
parent 56906f7e8f
commit 8b1096193c
2 changed files with 26 additions and 10 deletions

View File

@ -4,19 +4,27 @@ use strict;
use CGI;
use Tinderbox3::Header;
use Tinderbox3::DB;
use Tinderbox3::Login;
my $p = new CGI;
my $dbh = get_dbh();
header($p, "Global Admin");
print "<h2>Administrate Tinderbox</h2>\n";
my ($login, $cookie) = check_session($p, $dbh);
header($p, $login, $cookie, "Administrate Tinderbox");
print "<table class=editlist><tr><th>Trees</th></tr>\n";
foreach my $tree (@{$dbh->selectcol_arrayref("SELECT tree_name FROM tbox_tree")}) {
print "<tr><td><a href='admintree.pl?tree=$tree'>$tree</a></td></tr>\n";
my $sth = $dbh->prepare("SELECT tree_name FROM tbox_tree");
$sth->execute();
while (my $tree_info = $sth->fetchrow_arrayref()) {
my $tree = $tree_info->[0];
my @actions;
push @actions, "<a href='sheriff.pl?tree=$tree'>Sheriff</a>";
push @actions, "<a href='admintree.pl?tree=$tree'>Edit</a>";
push @actions, "<a href='showbuilds.pl?tree=$tree'>View</a>";
print "<tr><td><a href='showbuilds.pl?tree=$tree'>$tree</a> (" . join(' | ', @actions) . ")</td></tr>\n";
}
print "<tr><td><a href='admintree.pl?tree='>Add Tree</a></td></tr>\n";
print "<tr><td><a href='admintree.pl'>Add Tree</a></td></tr>\n";
print "</table>\n";
footer($p);

View File

@ -4,19 +4,27 @@ use strict;
use CGI;
use Tinderbox3::Header;
use Tinderbox3::DB;
use Tinderbox3::Login;
my $p = new CGI;
my $dbh = get_dbh();
header($p, "Global Admin");
print "<h2>Administrate Tinderbox</h2>\n";
my ($login, $cookie) = check_session($p, $dbh);
header($p, $login, $cookie, "Administrate Tinderbox");
print "<table class=editlist><tr><th>Trees</th></tr>\n";
foreach my $tree (@{$dbh->selectcol_arrayref("SELECT tree_name FROM tbox_tree")}) {
print "<tr><td><a href='admintree.pl?tree=$tree'>$tree</a></td></tr>\n";
my $sth = $dbh->prepare("SELECT tree_name FROM tbox_tree");
$sth->execute();
while (my $tree_info = $sth->fetchrow_arrayref()) {
my $tree = $tree_info->[0];
my @actions;
push @actions, "<a href='sheriff.pl?tree=$tree'>Sheriff</a>";
push @actions, "<a href='admintree.pl?tree=$tree'>Edit</a>";
push @actions, "<a href='showbuilds.pl?tree=$tree'>View</a>";
print "<tr><td><a href='showbuilds.pl?tree=$tree'>$tree</a> (" . join(' | ', @actions) . ")</td></tr>\n";
}
print "<tr><td><a href='admintree.pl?tree='>Add Tree</a></td></tr>\n";
print "<tr><td><a href='admintree.pl'>Add Tree</a></td></tr>\n";
print "</table>\n";
footer($p);