############################################################################### # A U T O M A T I C V I E W / M O D I F Y S E A R C H # # If you have set up your database with either $auth_modify_own=1 or # # $auth_view_own=1 (or both), this mod will allow users to view or modify # # their records without having to first go to the search page. It does allow # # anyone with admin permission to search for records to view or modify, # # however. # ############################################################################### ############################################################################### # script: html.pl # # sub html_footer # # # # replace subroutine # # modified by shann123 8 March 2004 to work with DBMan SQL version 1 # ############################################################################### sub html_footer { # -------------------------------------------------------- # Print the menu. # # We only print options that the user have permissions for. # $key = &get_key; print qq!

<$font>!; print qq!| Home !; print qq!| Add ! if ($per_add); if (!$per_admin && $auth_view_own) { print qq!| View ! if ($per_view); } else { print qq!| View ! if ($per_view); print qq!| List All ! if ($per_view); } if (!$per_admin && $auth_modify_own) { print qq!| Delete ! if ($per_del); print qq!| Modify ! if ($per_mod); } else { print qq!| Delete ! if ($per_del); print qq!| Modify ! if ($per_mod); } print qq!| Admin ! if ($per_admin); print qq!| Log Off !; print qq!|

!; # Print the Footer. print qq!
<$font>Copyright 1998 Gossamer Threads Inc. Database Powered by Gossamer Threads Inc.
!; } ############################################################################### # script: db.cgi # # sub get_key # # # # New subroutine # # modified by shann123 8 March 2004 to work with DBMan SQL version 1 # ############################################################################### sub get_key { # -------------------------------------------------------- # Pulls the key from the Items table. Can be used for pulling other info from the Items table. my ($message, $userid, $pw, $view, $add, $del, $mod, $admin, $email, $password, $found, $output, $pass, $query); my $username_q = $DBH->quote($db_userid); $query = qq! SELECT * FROM $db_table WHERE userid = $username_q !; my $sth = $DBH->prepare($query); $sth->execute(); if ($sth->rows) { while (@data = $sth->fetchrow_array) { $key = $data[0]; } } $sth->finish; return $key; }