<?php
  /*
    NetSaint phpgroupware modules
    Copyright (C) 2001 Craig Small
   
    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.                                              
  */
 
function load_settings()
{
  global $phpgw, $statuslog_filename;

  $sql = "SELECT value from phpgwnetsaint_settings WHERE fkey = 'statuslog'";
  $phpgw->db->query($sql);
  $phpgw->db->next_record();
  if ($phpgw->db->num_rows() == 0) {
    $statuslog_filename = '/var/log/netsaint/status.log';
    $phpgw->db->query("INSERT INTO phpgwnetsaint_settings VALUES ('statuslog', '/var/log/netsaint/status.log')");
  } else {
    $statuslog_filename = $phpgw->db->f('value');
    echo "got";
  }


}

function save_settings($statusfile)
{
  global $phpgw ;

  $sql = "UPDATE phpgwnetsaint_settings SET value = '$statusfile'";
  $sql .= " WHERE fkey = 'statuslog'";
  $phpgw->db->query($sql);
}
?>
