<?

include_once "./setting.php";

include_once $global["root"] . "/include/handle.php";
include_once $global["root"] . "/include/print_array.php";

include_once $global["root"] . "/module/message/function/etc.php";

//-------------------------------------------------- protection
include_once $global["root"] . "/lib/Site.php";

$Site = new Site;
$Site->init("mail");

extract($_POST);

$a[] = sprintf("full_name = '%s'", addslashes($_POST["full_name"]));
$a[] = sprintf("reply_to = '%s'", addslashes($_POST["reply_to"]));
$a[] = sprintf("forward = '%s'", addslashes($_POST["forward_to"]));
$a[] = sprintf("signature = '%s'", addslashes($_POST["signature"]));
$a[] = sprintf("htmlview_method = '%s'", addslashes($_POST["htmlview_method"]));

if (! is_array($a)) {
	goprev();
} else {
	$SQL_UPDATE_USER_PRIV = "update user_priv set %s where id = '%s'";

	$Site->DB->transaction_start(true);
	$Site->DB->query(
		sprintf($SQL_UPDATE_USER_PRIV, implode(",", $a), $_SESSION["config_id"]));

	$retval = $Site->DB->retval;
	$Site->DB->close();
}

if ($retval) {
	$url = "Location: " . $_SESSION["user_www_url"] .
		"/mail?mode=control&control=1&no=0";

	$Site->end1();

	Header($url);
	exit;
} else {
	$Site->end1();

	goprev();
}

/*
Description
-----------

Author
------
 Spike^ekipS <spike@spikeekips.net>

Changelog
---------

Usage
-----

*/

?>
