<?PHP

#
#   FILE:  SPT--EditRSSExportComplete.php
#
#   FUNCTIONS PROVIDED:
#
#   FUNCTIONS EXPECTED:
#
#   FORM FIELDS EXPECTED:
#
#   Part of the Scout Portal Toolkit
#   Copyright 2004 Internet Scout Project
#   http://scout.cs.wisc.edu
#

# check if current user is authorized
if (!CheckAuthorization(PRIV_SYSADMIN)) {  return;  }

$F_EntriesToPublish = $_POST["F_EntriesToPublish"];
$F_NotifyBrowser = $_POST['F_NotifyBrowser'];
$F_ChannelTitle = $_POST["F_ChannelTitle"];
$F_ChannelDescription = $_POST["F_ChannelDescription"];
$F_ImageUrl = $_POST["F_ImageUrl"];
$F_ImageTitle = $_POST["F_ImageTitle"];
$F_ImageLink = $_POST["F_ImageLink"];
$F_ImageHeight = $_POST["F_ImageHeight"];
$F_ImageWidth = $_POST["F_ImageWidth"];
$F_ImageDescription = $_POST["F_ImageDescription"];
$F_Language = $_POST["F_Language"];
$F_Copyright = $_POST["F_Copyright"];
$F_ManagingEditor = $_POST["F_ManagingEditor"];
$F_Webmaster = $_POST["F_Webmaster"];
$F_PicsRating = $_POST["F_PicsRating"];

$ErrorMessages = new ErrorList();

# make sure image height/width parameters are legal
if ($F_ImageHeight > 400 || $F_ImageHeight < 0)
{
    $ErrorMessages->AddMessage("Image Height must be <= 400 and > 0");
}
if ($F_ImageWidth > 144 || $F_ImageWidth < 0)
{
    $ErrorMessages->AddMessage("Image Width must be <= 144 and > 0");
}
if ($ErrorMessages->HasErrors())
{
    $Session->PassVariable("ErrorMessages");
    $AF->SetJumpToPage("EditRSSExport");
    return;
}

# if save changes was requested
if ($_POST["Submit"] != "Cancel")
{
    $DB = new SPTDatabase();

    $Query = "UPDATE RSSConfiguration SET
        EntriesToPublish = '".addslashes($F_EntriesToPublish)."',
        NotifyBrowser = '".addslashes($F_NotifyBrowser)."',
        ChannelTitle = '".addslashes($F_ChannelTitle)."',
        ChannelDescription = '".addslashes($F_ChannelDescription)."',
        ImageUrl = '".addslashes($F_ImageUrl)."',
        ImageTitle = '".addslashes($F_ImageTitle)."',
        ImageLink = '".addslashes($F_ImageLink)."',
        ImageHeight = '".addslashes($F_ImageHeight)."',
        ImageWidth = '".addslashes($F_ImageWidth)."',
        ImageDescription = '".addslashes($F_ImageDescription)."',
        Language = '".addslashes($F_Language)."',
        Copyright = '".addslashes($F_Copyright)."',
        ManagingEditor = '".addslashes($F_ManagingEditor)."',
        Webmaster = '".addslashes($F_Webmaster)."',
        PicsRating = '".addslashes($F_PicsRating)."'";

#    echo "Query=$Query<br>";
    $DB->Query($Query);
}

# go to parent of edited RSS Export values
$AF->SetJumpToPage("SysAdmin");

?>
