<?php
  /**************************************************************************\
  * phpGroupWare application (NNTP)                                          *
  * http://www.phpgroupware.org                                              *
  * Written by Mark Peters <mpeters@satx.rr.com>                             *
  * --------------------------------------------                             *
  *  This program is free software; you can redistribute it and/or modify it *
  *  under the terms of the GNU General Public License as published by the   *
  *  Free Software Foundation; either version 2 of the License, or (at your  *
  *  option) any later version.                                              *
  \**************************************************************************/

if(substr(phpversion(),0,1) == "4") {
?>
<?php php_track_vars ?>
<?php
} else {
?>
<?php track_vars ?>
<?php
}
  /* $Id: monitor.php,v 1.11 2001/03/13 02:20:00 skeeter Exp $ */

  $phpgw_info["flags"]["currentapp"] = "nntp";
  $phpgw_info["flags"]["noheader"] = True;
  $phpgw_info["flags"]["nonavbar"] = True;
  include("../header.inc.php");

  $referer = getenv("HTTP_REFERER");

  $phpgw->db->query("SELECT active, name FROM newsgroups WHERE con=$folder");

  $phpgw->db->next_record();

  $active = $phpgw->db->f("active");
  $name = $phpgw->db->f("name");
?>
<center>
<?php

  if($active == "Y") {
    $phpgw->preferences->add('nntp',$folder);
    $phpgw->preferences->save_repository(True);
    echo "Successful in monitoring $name.";
  } else {
    echo "Cannot monitor $name.<br>Administrator has it labeled as inactive.";
  }
?>
  <form>
   <input type="button" value="Close" onClick="window.close()">
  </form>
</center>
<?php
  $phpgw->common->phpgw_exit();
?>

