#!/usr/bin/perl # # Generates a navigation bar suitable for display across the top or bottom of a page. # use CGI qw(:standard); use Pg; $dbmain='ldp'; @row; $query = new CGI; # connect to the database $conn=Pg::connectdb("dbname=$dbmain"); $username = $query->remote_user(); $result=$conn->exec("SELECT username, admin, first_name, surname FROM username WHERE username='$username'"); @row = $result->fetchrow; $admin = $row[1]; $firstname = $row[2]; $surname = $row[3]; print "
$firstname $surname | \n"; print "Index | \n"; print "Documents | \n "; print "Topics | \n "; print "Maintainers | \n "; print "Editors | \n "; if ($admin) { print "Users | \n "; } print "Statistics | \n "; print "Help | \n "; print "
---|