X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=web%2Fsshow.pl;h=b840ac8a70a1b940e0951d8f7b2dfe24b64de3fd;hb=1e7869f8141084245dcd34fb065f38a418517e7b;hp=32a8306ab94aed68e5fe41fc205c285595dfe719;hpb=d6cfbb682b3492d24b6623fbf1345c5b2b95f230;p=nms diff --git a/web/sshow.pl b/web/sshow.pl index 32a8306..b840ac8 100755 --- a/web/sshow.pl +++ b/web/sshow.pl @@ -1,26 +1,17 @@ #!/usr/bin/perl -# -# - -my $username = ''; -my $password = 'removed'; - -# Seconds to wait for connection -my $timeout = 15; +use lib '../include'; +use nms; use warnings; use strict; use Switch; use CGI; -use Net::Telnet; use DBI; # Grab from .htaccess-authentication my $user = $ENV{'REMOTE_USER'}; -my $dbh = DBI->connect("dbi:Pg:dbname=snmpfetch;host=violet.tg05.gathering.org", - "snmpfetch", "removed") - or die "Couldn't connect to database"; +my $dbh = nms::db_connect(); $dbh->{AutoCommit} = 0; my $sgetdone = $dbh->prepare( @@ -119,9 +110,6 @@ if (defined($cgi->param('agid'))) { my $gid = $cgi->param('gid'); if (!defined($gid)) { print "Du har ikke valgt en gid å slette.\n"; - } - if ($cgi->param('agid') eq 'Disable') { - $sdisablegid->execute($gid); print "

gid: ".$cgi->param('gid')." har blitt disablet.\n"; } else {