<?php

// get post vars: sqgetGlobalVar('foo', $var, SQ_POST);
// get global sm vars: sqgetGlobalVar('color', $color, SQ_SESSION);

// $Author: perlstalker $
// $Id: sasql_options.php,v 1.17 2005/03/14 15:52:52 perlstalker Exp $

//chdir('..');

if (!defined('SM_PATH')) { define('SM_PATH' , '../../'); }

include_once(SM_PATH.'include/validate.php');
include_once(SM_PATH.'functions/page_header.php');
include_once(SM_PATH.'include/load_prefs.php');
include_once(SM_PATH.'plugins/sasql/sasql_conf.php');
include_once(SM_PATH.'plugins/sasql/sasql_db.php');

// From sasql_conf.php
global $SqlDSN;
global $SqlTable;
global $useSA2_43;
global $allowed_sections;
global $allowed_params;
global $allowed_wl_params;
global $sa_params;
global $wl_params;
global $default_domain;

// From SM
global $username;

// Form
sqgetGlobalVar('viewsection', $viewsection, SQ_FORM);  //view only a particular section

// Connect to the DB
$DBHandle = sasql_DBConnect ($SqlDSN);

// If $default_domain is set and not '' and the username doesn't
// already have an '@' in it.
if (isset ($default_domain)
    && $default_domain != ''
    && ! preg_match ('/@/', $username)) {
  $username .= "@$default_domain";
}

$errmsg = array();

?>

<?php 
displayPageHeader($color, 'None'); 

// Set sasql gettext domain
bindtextdomain ('sasql', SM_PATH . 'locale');
textdomain ('sasql');
?>

<table border="0" width="95%" align="center" cellpadding="2" cellspacing="2">
 <tr>
  <td align="center" bgcolor="<?php echo $color[0] ?>">
   <b><?php echo _("Options") ." - ". _("Spam Filters"); ?></b>
  </td>
 </tr>

<?php
 include("start_section.inc.php");
  if (isset($viewsection)) {
    include("$viewsection.inc.php");;
  } else {
    foreach ($allowed_sections as $section):
      include("$section.inc.php");
    endforeach;
  }
 include("end_section.inc.php");
?>

<?php 
sasql_DBDisconnect( $DBHandle ); 

bindtextdomain ('squirrelmail', SM_PATH . 'locale');
textdomain ('squirrelmail');
?>

</body></html>
