<?php
/*
This file is part of Thomas Bley's moregroupware webmail2/calendar2/admin2 module. (tb-mgw)

More information:
-----------------

Simple Groupware Solutions Thomas Bley
Fichtenstr. 23
Germany, 85640 Putzbrunn

Contact:
--------

info@simple-groupware.de

http://www.simple-groupware.de


Copyright 2002-2003 Thomas Bley
tb-mgw is distributed under the terms of the GNU General Public License 

tb-mgw 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.

tb-mgw is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with tb-mgw; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

// Settings-inc
// Moregroupware.org

/* get sort methods */
$sort = array();
$sort[] = array("md","webmail2_settings_sort_message_id");
$sort[] = array("fa","webmail2_settings_sort_sender");
$sort[] = array("sa","webmail2_settings_sort_subject");
$sort[] = array("dd","webmail2_settings_sort_date");
$sort[] = array("md","webmail2_settings_sort_unsorted");

$font_size = array();
$font_size[] = array("8pt","8 pt");
$font_size[] = array("10pt","10 pt");
$font_size[] = array("12pt","12 pt");
$font_size[] = array("14pt","14 pt");
$font_size[] = array("18pt","18 pt");
$font_size[] = array("24pt","24 pt");
$font_size[] = array("36pt","36 pt");

$font = array();
$font[] = array("arial,helvetica,sans-serif","Arial");
$font[] = array("courier new,courier,monospace","Courier New");
$font[] = array("georgia,times new roman,times,serif","Georgia");
$font[] = array("tahoma,arial,helvetica,sans-serif","Tahoma");
$font[] = array("times new roman,times,serif","Times New Roman");
$font[] = array("verdana,arial,helvetica,sans-serif","Verdana");
$font[] = array("impact","Impact");
$font[] = array("wingdings","WingDings");

$virus_scanner = array();
$virus_scanner[] = array("wm2_virusscanner_f-prot_linux","F-Prot Linux (f-prot)");
$virus_scanner[] = array("wm2_virusscanner_f-prot_win32","F-Prot Windows (fpcmd)");
$virus_scanner[] = array("wm2_virusscanner_mcafee_linux","McAfee Linux (uvscan)");
$virus_scanner[] = array("wm2_virusscanner_mcafee_win32","McAfee Windows (scan)");
$virus_scanner[] = array("wm2_virusscanner_kav_linux","Kaspersky AV Linux (kavscanner)");
$virus_scanner[] = array("wm2_virusscanner_sophos_win32","SOPHOS Windows (sav32cli)");
$virus_scanner[] = array("wm2_virusscanner_clam_linux","Clam Antivirus (clamscan)");

/* settings array */

$MGW = $_SESSION["MGW"];

$settings["webmail2"] = array(
	"gensettings" => array(
        "wm2_disable_create_accounts" => array(
        	"method" => "checkbox",
            "name" => "webmail2_disable_create_accounts",
            "type" => "int",
			"default" => "0"
        ),
        "wm2_disable_public_folders" => array(
        	"method" => "checkbox",
            "name" => "webmail2_disable_public_folders",
            "type" => "int",
			"default" => "0"
        ),
        "wm2_disable_local_send" => array(
        	"method" => "checkbox",
            "name" => "webmail2_disable_local_send",
            "type" => "int",
			"default" => "0"
        ),
        "wm2_securehtmlmails" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_securehtmlmails",
            "type" => "int",
			"default" => "1"
        ),
        "wm2_dontdownloadobjects" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_dontdownloadobjects",
            "type" => "int",
			"default" => "1"
        ),
        "wm2_enabledownload" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_enabledownload",
            "type" => "int",
			"default" => "0"
        ),
        "wm2_disable_ext" => array(
        	"method" => "textarea",
            "name" => "webmail2_settings_disable_ext",
		    "note" => "webmail2_settings_disable_ext_handbook",
            "type" => "txt",
			"default" => "exe, vbs, vbe, pif, com, wsh, bat, cmd, sys, dll, scr, chm, hta, vxd, do, jse, rm, xl"
        ),
        "wm2_performvirusscan" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_performvirusscan",
            "type" => "int",
			"default" => "0"
        ),
        "wm2_antivirusprog" => array(
        	"method" => "text",
            "name" => "webmail2_settings_antivirusprog",
            "type" => "str",
			"default" => "/usr/local/f-prot/f-prot"
        ),
        "wm2_antivirusprogoptions" => array(
        	"method" => "select",
            "choices" => array(
            	array("name" => "", "value" => $virus_scanner)),
            "translate" => false,
            "name" => "webmail2_settings_antivirusprogoptions",
            "type" => "str",
			"default" => ""
        ),
        "wm2_antispam_admin" => array(
        	"method" => "textarea",
            "name" => "webmail2_settings_antispam_admin",
			"note" => "webmail2_settings_antispam_handbook",
            "type" => "txt",
			"default" => ""
        ),
        "wm2_antispam_subject_admin" => array(
        	"method" => "textarea",
            "name" => "webmail2_settings_antispam_subject_admin",
			"note" => "webmail2_settings_antispam_subject_handbook",
            "type" => "txt",
			"default" => ""
        ),
        "wm2_gpg_use" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_gpg_use",
            "type" => "int",
			"default" => "0"
        ),
        "wm2_gpg_prog" => array(
        	"method" => "text",
            "name" => "webmail2_settings_gpg_prog",
            "type" => "str",
			"default" => "/usr/bin/gpg"
        ),
        "wm2_gpg_keyserver" => array(
        	"method" => "text",
            "name" => "webmail2_settings_gpg_keyserver",
            "type" => "str",
			"default" => "wwwkeys.pgp.net"
        ),
        "wm2_gpg_pubring" => array(
        	"method" => "text",
            "name" => "webmail2_settings_gpg_pubring",
            "type" => "str",
			"default" => "~/.gnupg/pubring.gpg"
        ),
        "wm2_gpg_secring" => array(
        	"method" => "text",
            "name" => "webmail2_settings_gpg_secring",
            "type" => "str",
			"default" => "~/.gnupg/secring.gpg"
        ),
        "wm2_unzip" => array(
        	"method" => "text",
            "name" => "webmail2_settings_unzip",
            "type" => "str",
			"default" => ""
        ),
	    "admin" => true
	),
	"settings" => array(
    	"wm2_sort" => array(
        	"method" => "select",
            "choices" => array(
            	array("name" => "", "value" => $sort)),
            "translate" => true,
            "name" => "webmail2_settings_sort",
            "type" => "str",
			"default" => "wm2_sort_unsorted"
        ),
        "wm2_sortbyaccount" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_sortbyaccount",
            "type" => "int",
			"default" => "0"
        ),	
        "wm2_showshort_from_to" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_showshort_from_to",
            "type" => "int",
			"default" => "1"
        ),	
        "wm2_show_size_in_maillist" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_show_size_in_maillist",
            "type" => "int",
			"default" => "0"
        ),	
        "wm2_emailsperpage" => array(
        	"method" => "text",
            "name" => "webmail2_settings_emailsperpage",
            "type" => "int",
			"default" => "10"
        ),
        "wm2_waittime" => array(
        	"method" => "text",
            "name" => "webmail2_settings_waittime",
            "type" => "int",
			"default" => "5"
        ),
        "wm2_always_hide_sidebar" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_always_hide_sidebar",
            "type" => "int",
			"default" => "0"
        ),
        "wm2_show_top_menu" => array(
        	"method" => "checkbox",
            "name" => "top_max_top",
            "type" => "int",
			"default" => "1"
        ),
        "wm2_openallfolders" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_openallfolders",
            "type" => "int",
			"default" => "0"
        ),
        "wm2_preserve_state" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_preserve_state",
            "type" => "int",
			"default" => "1"
        ),
        "wm2_auto_open_unread_folders" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_auto_open_unread_folders",
            "type" => "int",
			"default" => "1"
        ),
        "wm2_width_mailfolders" => array(
        	"method" => "text",
            "name" => "webmail2_settings_width_mailfolders",
            "type" => "int",
			"default" => "100"
        ),
        "wm2_width_treeframe" => array(
        	"method" => "text",
            "name" => "webmail2_settings_width_treeframe",
            "type" => "int",
			"default" => "200"
        ),
        "wm2_enablefetchnotify" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_enablefetchnotify",
            "type" => "int",
			"default" => "0"
        ),	
        "wm2_fetchnotifytime" => array(
        	"method" => "text",
            "name" => "webmail2_settings_fetchnotifytime",
            "type" => "int",
			"default" => "120"
        ),
    	"wm2_compose_font_size" => array(
        	"method" => "select",
            "choices" => array(
            	array("name" => "", "value" => $font_size)),
            "translate" => false,
            "name" => "webmail2_settings_compose_font_size",
            "type" => "str",
			"default" => "10 pt"
        ),
    	"wm2_compose_font" => array(
        	"method" => "select",
            "choices" => array(
            	array("name" => "", "value" => $font)),
            "translate" => false,
            "name" => "webmail2_settings_compose_font",
            "type" => "str",
			"default" => "Verdana"
        ),
        "wm2_reverse_contacts" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_reverse_contacts",
            "type" => "int",
			"default" => "1"
        ),
        "wm2_return_receipt" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_return_receipt",
            "type" => "int",
			"default" => "0"
        ),
        "wm2_accept_receipt" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_accept_receipt",
            "type" => "int",
			"default" => "1"
        ),
        "wm2_always_sendplain" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_always_sendplain",
            "type" => "int",
			"default" => "0"
        ),
        "wm2_addsignature" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_addsignature",
            "type" => "int",
			"default" => "1"
        ),
        "wm2_fetch_limit" => array(
        	"method" => "text",
            "name" => "webmail2_settings_fetch_limit",
            "type" => "int",
			"default" => "4000"
        ),
        "wm2_always_recache" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_always_recache",
            "type" => "int",
			"default" => "0"
        ),
        "wm2_show_emoticons" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_show_emoticons",
            "type" => "int",
			"default" => "1"
        ),
        "wm2_enableinline" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_enableinline",
            "type" => "int",
			"default" => "1"
        ),
        "wm2_enablecal2_popup" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_enablecal2_popup",
            "type" => "int",
			"default" => "1"
        ),
        "wm2_showstructure" => array(
        	"method" => "checkbox",
            "name" => "webmail2_settings_showstructure",
            "type" => "int",
			"default" => "1"
        ),
        "wm2_gpg_passphrase" => array(
        	"method" => "text",
            "name" => "webmail2_gpg_passphrase",
            "type" => "str",
			"default" => ""
        ),
        "title" => "webmail2_settings_general_settings"
    )
);

if (is_array($settings["webmail2"])) foreach ($settings["webmail2"] as $my_module_settings) {
  if (is_array($my_module_settings)) foreach ($my_module_settings as $key=>$key2) {
    if (!isset($_SESSION["MGW"]->settings[$key]) and isset($key2["default"])) {
	  $_SESSION["MGW"]->settings[$key] = $key2["default"];
	}
  }
}

?>
