]> git.sesse.net Git - nms/blobdiff - web/sshow.pl
Fix charset issues.
[nms] / web / sshow.pl
index 32a8306ab94aed68e5fe41fc205c285595dfe719..5e0fbdce5e3fd901305a3c6350fc4eaf91ceb56a 100755 (executable)
@@ -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(
@@ -83,7 +74,7 @@ WHERE gid = ?::text::int")
 
 my $cgi = new CGI;
 
-print $cgi->header(-type=>'text/html');
+print $cgi->header(-type=>'text/html; charset=utf-8');
 
 print << "EOF";
 <html>
@@ -119,9 +110,6 @@ if (defined($cgi->param('agid'))) {
        my $gid = $cgi->param('gid');
        if (!defined($gid)) {
                print "<font color=\"red\">Du har ikke valgt en gid å slette.</font>\n";
-       }
-       if ($cgi->param('agid') eq 'Disable') {
-               $sdisablegid->execute($gid);
                print "<p>gid: ".$cgi->param('gid')." har blitt disablet.\n";
        }
        else {