1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2026-10-24 12:19:19 +03:00
Files
postfixadmin/edit-active.php
2007-03-24 07:27:00 +00:00

67 lines
1.5 KiB
PHP

<?php
//
// File: edit-active.php
//
// Template File: message.tpl
//
// Template Variables:
//
// tMessage
//
// Form POST \ GET Variables:
//
// fUsername
// fDomain
//
require ("./variables.inc.php");
require ("./config.inc.php");
require ("./functions.inc.php");
include ("./languages/" . check_language () . ".lang");
$SESSID_USERNAME = check_session();
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
if (isset ($_GET['username'])) $fUsername = $_GET['username'];
if (isset ($_GET['domain'])) $fDomain = $_GET['domain'];
if (!check_owner ($SESSID_USERNAME, $fDomain))
{
$error = 1;
$tMessage = $PALANG['pEdit_mailbox_domain_error'] . "<b>$fDomain</b>!</font>";
}
else
{
$result = db_query ("UPDATE mailbox SET active=1-active WHERE username='$fUsername' AND domain='$fDomain'");
if ($result['rows'] != 1)
{
$error = 1;
$tMessage = $PALANG['pEdit_mailbox_result_error'];
}
else
{
db_log ($SESSID_USERNAME, $fDomain, "edit active", $fUsername);
}
}
if ($error != 1)
{
header ("Location: overview.php?domain=$fDomain");
exit;
}
include ("./templates/header.tpl");
include ("./templates/menu.tpl");
include ("./templates/message.tpl");
include ("./templates/footer.tpl");
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
include ("./templates/header.tpl");
include ("./templates/menu.tpl");
include ("./templates/message.tpl");
include ("./templates/footer.tpl");
}
?>