#!/usr/bin/perl use DBI(); use CGI qw(:standard); $act = param("act"); $dom = param("domain"); $com = param("comment"); $trans = param("trans"); $old = param("old"); $authl = param("authl"); $authp = param("authp"); system "./auth.cgi domail.cgi $authl $authp"; $retcode = $? / 256; if ($retcode ne "1") {exit;} my $cooke = cookie('mail.miranet'); if ($cooke eq "") {print ""; exit;} if ($cooke ne "1") {print "

Forbidden


Недостаточно прав"; exit;} #print "Content-type: text/html\n\n"; system("./ustat $rip |grep 1 > $rip"); open(patt,"<./patt_n1.html")||die "Pattern file 1 not found"; while() { print; } close(patt); $database="mail"; $hostname="127.0.0.1"; $port="3306"; $dbuser="root"; $dbpasswd="zopa25703"; $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port"; $dbh = DBI->connect_cached($dsn, $dbuser, $dbpasswd) || die; if ($act eq "delete") { $sth = $dbh->prepare("DELETE FROM transport WHERE domain=\"$dom\""); $sth->execute(); $act = ""; } if ($act eq "add") { $sth = $dbh->prepare("INSERT INTO transport VALUES (\"$dom\",\"$trans\",\"$com\")"); $sth->execute(); $act = ""; } if ($act eq "change") { $sth = $dbh->prepare("UPDATE transport SET domain=\"$dom\",transport=\"$trans\",comment=\"$com\" WHERE domain=\"$old\""); $sth->execute(); $act = ""; } if ($act eq "edit") { print "
"; print ""; print ""; print ""; print ""; $sth = $dbh->prepare("SELECT * FROM transport WHERE domain=\"$dom\""); $sth->execute(); ($domain, $tr, $comm) = $sth->fetchrow_array(); $sth = $dbh->prepare("SELECT * FROM transport"); $sth->execute(); while (my ($domain1, $tr, $comm) = $sth->fetchrow_array()) { if ($domain1 ne $domain) { print ""; print ""; print ""; print ""; } else { print "
ДоменТранспортКоментарийДействие
$domain1$tr$comm  Удалить Изменить
Отменить"; } } print "
"; print "
| Учётные записи | Настройка доменов |"; } if ($act eq "") { print "
"; print ""; print ""; print ""; print ""; $sth = $dbh->prepare("SELECT * FROM transport"); $sth->execute(); while (my ($domain, $tr, $comm) = $sth->fetchrow_array()) { print ""; print ""; print ""; print ""; } print "
ДоменТранспортКоментарийДействие
$domain$tr$comm  Удалить Изменить
"; print "
"; print "
| Учётные записи | Пользователи |"; } $dbh->disconnect(); system("./ustat $rip |grep 1 > $rip"); open(patt,"<./patt_n2.html")||die "Pattern file 2 not found"; while() { print; } close(patt);