Source for file defines.php

Documentation is available at defines.php

  1. <?php
  2. /**
  3.  * Administrator plugin - Option definitions
  4.  *
  5.  * @version $Id: defines.php,v 1.32.2.14 2006/08/01 05:47:32 tokul Exp $
  6.  * @author Philippe Mingo
  7.  * @copyright (c) 1999-2006 The SquirrelMail Project Team
  8.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  9.  * @package plugins
  10.  * @subpackage administrator
  11.  */
  12.  
  13. /** */
  14. require_onceSM_PATH 'functions/constants.php' );
  15.  
  16. /* Define constants for the various option types. */
  17. define('SMOPT_TYPE_UNDEFINED'-1);
  18. define('SMOPT_TYPE_STRING'0);
  19. define('SMOPT_TYPE_STRLIST'1);
  20. define('SMOPT_TYPE_TEXTAREA'2);
  21. define('SMOPT_TYPE_INTEGER'3);
  22. define('SMOPT_TYPE_FLOAT'4);
  23. define('SMOPT_TYPE_BOOLEAN'5);
  24. define('SMOPT_TYPE_HIDDEN'6);
  25. define('SMOPT_TYPE_COMMENT'7);
  26. define('SMOPT_TYPE_NUMLIST'8);
  27. define('SMOPT_TYPE_TITLE'9);
  28. define('SMOPT_TYPE_THEME'10);
  29. define('SMOPT_TYPE_PLUGINS'11);
  30. define('SMOPT_TYPE_LDAP'12);
  31. define('SMOPT_TYPE_EXTERNAL'32);
  32. define('SMOPT_TYPE_PATH',33);
  33.  
  34. global $languages;
  35.  
  36. $language_values array);
  37. foreach ($languages as $lang_key => $lang_attributes{
  38.     if (isset($lang_attributes['NAME'])) {
  39.         $language_values[$lang_key$lang_attributes['NAME'];
  40.     }
  41. }
  42. asort$language_values );
  43. $language_values array_merge(array('' => _("Default"))$language_values);
  44. $left_size_values array();
  45. for ($lsv 100$lsv <= 300$lsv += 10{
  46.     $left_size_values[$lsv"$lsv _("pixels");
  47. }
  48.  
  49. $defcfg array'$config_version' => array'name' => _("Config File Version"),
  50.                                              'type' => SMOPT_TYPE_COMMENT,
  51.                                              'size' => ),
  52.                  'SM_ver' => array'name' => _("SquirrelMail Version"),
  53.                                     'type' => SMOPT_TYPE_EXTERNAL,
  54.                                     'value' => "$version),
  55.                  'PHP_ver' => array'name' => _("PHP Version"),
  56.                                      'type' => SMOPT_TYPE_EXTERNAL,
  57.                                      'value' => phpversion() ),
  58.                  /* --------------------------------------------------------*/
  59.                  'Group1' => array'name' => _("Organization Preferences"),
  60.                                     'type' => SMOPT_TYPE_TITLE ),
  61.                  '$org_name' => array'name' => _("Organization Name"),
  62.                                        'type' => SMOPT_TYPE_STRING,
  63.                                        'size' => 40 ),
  64.                  '$org_logo' => array'name' => _("Organization Logo"),
  65.                                        'type' => SMOPT_TYPE_PATH,
  66.                                        'size' => 40,
  67.                                        'default' => '../images/sm_logo.png'),
  68.                  '$org_logo_width' => array'name'    => _("Organization Logo Width"),
  69.                                              'type'    => SMOPT_TYPE_STRING,
  70.                                              'size'    => 5,
  71.                                              'default' => 0),
  72.                  '$org_logo_height' => array'name'    => _("Organization Logo Height"),
  73.                                               'type'    => SMOPT_TYPE_STRING,
  74.                                               'size'    => 5,
  75.                                               'default' => 0),
  76.                  '$org_title' => array'name' => _("Organization Title"),
  77.                                         'type' => SMOPT_TYPE_STRING,
  78.                                         'size' => 40 ),
  79.                  '$signout_page' => array'name' => _("Signout Page"),
  80.                                            'type' => SMOPT_TYPE_PATH,
  81.                                            'size' => 40 ),
  82.                  '$provider_uri' => array'name' => _("Provider Link URI"),
  83.                                            'type' => SMOPT_TYPE_STRING ),
  84.                  '$provider_name' => array'name' => _("Provider Name"),
  85.                                             'type' => SMOPT_TYPE_STRING ),
  86.                  '$frame_top' => array'name' => _("Top Frame"),
  87.                                         'type' => SMOPT_TYPE_STRING,
  88.                                         'size' => 40,
  89.                                         'default' => '_top' ),
  90.                  /* --------------------------------------------------------*/
  91.                  'Group2' => array'name' => _("Server Settings"),
  92.                                     'type' => SMOPT_TYPE_TITLE ),
  93.                  '$domain' => array'name' => _("Mail Domain"),
  94.                                      'type' => SMOPT_TYPE_STRING,
  95.                                      'size' => 40 ),
  96.                  '$imapServerAddress' => array'name' => _("IMAP Server Address"),
  97.                                                 'type' => SMOPT_TYPE_STRING,
  98.                                                 'size' => 40 ),
  99.                  '$imapPort' => array'name' => _("IMAP Server Port"),
  100.                                        'type' => SMOPT_TYPE_INTEGER ),
  101.                  '$imap_server_type' => array'name' => _("IMAP Server Type"),
  102.                                                'type' => SMOPT_TYPE_STRLIST,
  103.                                                'posvals' => array'cyrus' => _("Cyrus IMAP server"),
  104.                                                                    'uw' => _("University of Washington's IMAP server"),
  105.                                                                    'exchange' => _("Microsoft Exchange IMAP server"),
  106.                                                                    'courier' => _("Courier IMAP server"),
  107.                                                                    'macosx' => _("Mac OS X Mailserver"),
  108.                                                                    'hmailserver' => _("hMailServer IMAP server"),
  109.                                                                    'bincimap' => _("Binc IMAP server"),
  110.                                                                    'other' => _("Not one of the above servers") ) ),
  111.                  '$optional_delimiter' => array'name' => _("IMAP Folder Delimiter"),
  112.                                                  'type' => SMOPT_TYPE_STRING,
  113.                                                  'comment' => _("Use &quot;detect&quot; to auto-detect."),
  114.                                                  'size' => 10,
  115.                                                  'default' => 'detect' ),
  116.                  '$use_imap_tls' => array'name' => _("Use TLS for IMAP Connections"),
  117.                                            'type' => SMOPT_TYPE_BOOLEAN,
  118.                                            'comment' => _("Requires PHP 4.3.x! Experimental."),
  119.                                            'default' => false ),
  120.                  '$imap_auth_mech' => array'name' => _("IMAP Authentication Type"),
  121.                                              'type' => SMOPT_TYPE_STRLIST,
  122.                                              'posvals' => array('login' => _("IMAP login"),
  123.                                                                 'cram-md5' => 'CRAM-MD5',
  124.                                                                 'digest-md5' => 'DIGEST-MD5'),
  125.                                              'default' => 'login' ),
  126.                  '$useSendmail' => array'name' => _("Use Sendmail Binary"),
  127.                                           'type' => SMOPT_TYPE_BOOLEAN,
  128.                                           'comment' => _("Choose &quot;no&quot; for SMTP") ),
  129.                  '$sendmail_args' => array'name' => _("Sendmail Arguments"),
  130.                                             'type' => SMOPT_TYPE_STRING,
  131.                                             'size' => 40 ),
  132.                  '$sendmail_path' => array'name' => _("Sendmail Path"),
  133.                                             'type' => SMOPT_TYPE_STRING,
  134.                                             'size' => 40 ),
  135.                  '$smtpServerAddress' => array'name' => _("SMTP Server Address"),
  136.                                                 'type' => SMOPT_TYPE_STRING,
  137.                                                 'size' => 40 ),
  138.                  '$smtpPort' => array'name' => _("SMTP Server Port"),
  139.                                        'type' => SMOPT_TYPE_INTEGER ),
  140.                  '$use_smtp_tls' => array'name' => _("Use TLS for SMTP Connections"),
  141.                                            'type' => SMOPT_TYPE_BOOLEAN,
  142.                                            'comment' => _("Requires PHP 4.3.x! Experimental."),
  143.                                            'default' => false ),
  144.                  '$smtp_auth_mech' => array'name' => _("SMTP Authentication Type"),
  145.                                              'type' => SMOPT_TYPE_STRLIST,
  146.                                              'posvals' => array('none' => _("No SMTP auth"),
  147.                                                                 'login' => _("Login (plain text)"),
  148.                                                                 'cram-md5' => 'CRAM-MD5',
  149.                                                                 'digest-md5' => 'DIGEST-MD5'),
  150.                                              'default' => 'none'),
  151.                  '$pop_before_smtp' => array'name' => _("POP3 Before SMTP?"),
  152.                                               'type' => SMOPT_TYPE_BOOLEAN,
  153.                                               'default' => false ),
  154.                  '$encode_header_key' => array'name' => _("Header Encryption Key"),
  155.                                                 'type' => SMOPT_TYPE_STRING ),
  156.                  '$invert_time' => array'name' => _("Invert Time"),
  157.                                           'type' => SMOPT_TYPE_BOOLEAN ),
  158.                  /* --------------------------------------------------------*/
  159.                  'Group3' => array'name' => _("Folders Defaults"),
  160.                                     'type' => SMOPT_TYPE_TITLE ),
  161.                  '$default_folder_prefix' => array'name' => _("Default Folder Prefix"),
  162.                                                     'type' => SMOPT_TYPE_STRING,
  163.                                                     'size' => 40 ),
  164.                  '$show_prefix_option' => array'name' => _("Show Folder Prefix Option"),
  165.                                                  'type' => SMOPT_TYPE_BOOLEAN ),
  166.                  '$trash_folder' => array'name' => _("Trash Folder"),
  167.                                            'type' => SMOPT_TYPE_STRING,
  168.                                            'size' => 40 ),
  169.                  '$sent_folder' => array'name' => _("Sent Folder"),
  170.                                           'type' => SMOPT_TYPE_STRING,
  171.                                           'size' => 40 ),
  172.                  '$draft_folder' => array'name' => _("Draft Folder"),
  173.                                            'type' => SMOPT_TYPE_STRING,
  174.                                            'size' => 40 ),
  175.                  '$default_move_to_trash' => array'name' => _("By default, move to trash"),
  176.                                                     'type' => SMOPT_TYPE_BOOLEAN ),
  177.                  '$default_move_to_sent' => array'name' => _("By default, move to sent"),
  178.                                                    'type' => SMOPT_TYPE_BOOLEAN ),
  179.                  '$default_save_as_draft' => array'name' => _("By default, save as draft"),
  180.                                                    'type' => SMOPT_TYPE_BOOLEAN ),
  181.                  '$list_special_folders_first' => array'name' => _("List Special Folders First"),
  182.                                                          'type' => SMOPT_TYPE_BOOLEAN ),
  183.                  '$use_special_folder_color' => array'name' => _("Show Special Folders Color"),
  184.                                                        'type' => SMOPT_TYPE_BOOLEAN ),
  185.                  '$auto_expunge' => array'name' => _("Auto Expunge"),
  186.                                            'type' => SMOPT_TYPE_BOOLEAN ),
  187.                  '$default_sub_of_inbox' => array'name' => _("Default Sub. of INBOX"),
  188.                                                    'type' => SMOPT_TYPE_BOOLEAN ),
  189.                  '$show_contain_subfolders_option' => array'name' => _("Show 'Contain Sub.' Option"),
  190.                                                              'type' => SMOPT_TYPE_BOOLEAN ),
  191.                  '$default_unseen_notify' => array'name' => _("Default Unseen Notify"),
  192.                                                     'type' => SMOPT_TYPE_NUMLIST,
  193.                                                     'posvals' => arraySMPREF_UNSEEN_NONE  => _("No Notification"),
  194.                                                                         SMPREF_UNSEEN_INBOX => _("Only INBOX"),
  195.                                                                         SMPREF_UNSEEN_ALL   => _("All Folders")) ),
  196.                  '$default_unseen_type'  => array'name' => _("Default Unseen Type"),
  197.                                                    'type' => SMOPT_TYPE_NUMLIST ,
  198.                                                    'posvals' => arraySMPREF_UNSEEN_ONLY  => _("Only Unseen"),
  199.                                                                        SMPREF_UNSEEN_TOTAL => _("Unseen and Total") ) ),
  200.                  '$auto_create_special' => array'name' => _("Auto Create Special Folders"),
  201.                                                   'type' => SMOPT_TYPE_BOOLEAN ),
  202.                  '$delete_folder' => array'name' => _("Auto delete folders"),
  203.                                             'type' => SMOPT_TYPE_BOOLEAN ),
  204.                  '$noselect_fix_enable' => array'name' => _("Enable /NoSelect folder fix"),
  205.                                                   'type' => SMOPT_TYPE_BOOLEAN,
  206.                                                   'default' => false),
  207.                  /* --------------------------------------------------------*/
  208.                  'Group4' => array'name' => _("General Options"),
  209.                                     'type' => SMOPT_TYPE_TITLE ),
  210.                  '$data_dir' => array'name' => _("Data Directory"),
  211.                                        'type' => SMOPT_TYPE_PATH,
  212.                                        'size' => 40 ),
  213.                  '$attachment_dir' => array'name' => _("Temp Directory"),
  214.                                              'type' => SMOPT_TYPE_PATH,
  215.                                              'size' => 40 ),
  216.                  '$dir_hash_level' => array'name' => _("Hash Level"),
  217.                                              'type' => SMOPT_TYPE_NUMLIST,
  218.                                              'posvals' => array=> _("Hash Disabled"),
  219.                                                                  => _("Low"),
  220.                                                                  => _("Moderate"),
  221.                                                                  => _("Medium"),
  222.                                                                  => _("High") ) ),
  223.                  '$default_left_size' => array'name' => _("Default Left Size"),
  224.                                                 'type' => SMOPT_TYPE_NUMLIST,
  225.                                                 'posvals' => $left_size_values ),
  226.                  '$force_username_lowercase' => array'name' => _("Usernames in Lowercase"),
  227.                                                        'type' => SMOPT_TYPE_BOOLEAN ),
  228.                  '$default_use_priority'  => array'name' => _("Allow use of priority"),
  229.                                                     'type' => SMOPT_TYPE_BOOLEAN ),
  230.                  '$hide_sm_attributions' => array'name' => _("Hide SM attributions"),
  231.                                                    'type' => SMOPT_TYPE_BOOLEAN ),
  232.                  '$default_use_mdn' => array'name' => _("Enable use of delivery receipts"),
  233.                                              'type' => SMOPT_TYPE_BOOLEAN ),
  234.                  '$edit_identity' => array'name' => _("Allow editing of identities"),
  235.                                             'type' => SMOPT_TYPE_BOOLEAN ),
  236.                  '$edit_name' => array'name' => _("Allow editing of full name"),
  237.                                         'type' => SMOPT_TYPE_BOOLEAN ),
  238.                  '$hide_auth_header' => array'name' => _("Remove username from headers"),
  239.                                                'comment' => _("Used only when identities can't be modified"),
  240.                                                'type' => SMOPT_TYPE_BOOLEAN ),
  241.                  '$allow_server_sort' => array'name' => _("Use server-side sorting"),
  242.                                                 'type' => SMOPT_TYPE_BOOLEAN,
  243.                                                 'default' => false ),
  244.                  '$allow_thread_sort' => array'name' => _("Use server-side thread sorting"),
  245.                                                 'type' => SMOPT_TYPE_BOOLEAN,
  246.                                                 'default' => false ),
  247.                  '$allow_charset_search' => array'name' => _("Allow server charset search"),
  248.                                                    'type' => SMOPT_TYPE_BOOLEAN,
  249.                                                    'default' => false ),
  250.                  '$uid_support' => array'name' => _("UID support"),
  251.                                           'type' => SMOPT_TYPE_BOOLEAN,
  252.                                           'default' => false ),
  253.                  '$session_name' => array'name' => _("PHP session name"),
  254.                                            'type' => SMOPT_TYPE_HIDDEN ),
  255.                  '$config_location_base' => array'name' => _("Location base"),
  256.                                                    'type' => SMOPT_TYPE_STRING,
  257.                                                    'size' => 40,                
  258.                                                    'default' => '' ),
  259.                  /* --------------------------------------------------------*/
  260.                  'Group5' => array'name' => _("Message of the Day"),
  261.                                     'type' => SMOPT_TYPE_TITLE ),
  262.                  '$motd' => array'name' => _("Message of the Day"),
  263.                                    'type' => SMOPT_TYPE_TEXTAREA,
  264.                                    'size' => 40 ),
  265.                  /* --------------------------------------------------------*/
  266.                  'Group6' => array'name' => _("Database"),
  267.                                     'type' => SMOPT_TYPE_TITLE ),
  268.                  '$addrbook_dsn' => array'name' => _("Address book DSN"),
  269.                                            'type' => SMOPT_TYPE_STRING,
  270.                                            'size' => 40 ),
  271.                  '$addrbook_table' => array'name' => _("Address book table"),
  272.                                              'type' => SMOPT_TYPE_STRING,
  273.                                              'size' => 40,
  274.                                              'default' => 'address' ),
  275.                  '$prefs_dsn' => array'name' => _("Preferences DSN"),
  276.                                         'type' => SMOPT_TYPE_STRING,
  277.                                         'size' => 40 ),
  278.                  '$prefs_table' => array'name' => _("Preferences table"),
  279.                                           'type' => SMOPT_TYPE_STRING,
  280.                                           'size' => 40,
  281.                                           'default' => 'userprefs' ),
  282.                  '$prefs_user_field' => array('name' => _("Preferences username field"),
  283.                                               'type' => SMOPT_TYPE_STRING,
  284.                                               'size' => 40,
  285.                                               'default' => 'user' ),
  286.                  '$prefs_key_field' => array('name' => _("Preferences key field"),
  287.                                              'type' => SMOPT_TYPE_STRING,
  288.                                              'size' => 40,
  289.                                              'default' => 'prefkey' ),
  290.                  '$prefs_val_field' => array('name' => _("Preferences value field"),
  291.                                              'type' => SMOPT_TYPE_STRING,
  292.                                              'size' => 40,
  293.                                              'default' => 'prefval' ),
  294.                  '$addrbook_global_dsn' => array'name' => _("Global address book DSN"),
  295.                                            'type' => SMOPT_TYPE_STRING,
  296.                                            'size' => 40 ),
  297.                  '$addrbook_global_table' => array'name' => _("Global address book table"),
  298.                                              'type' => SMOPT_TYPE_STRING,
  299.                                              'size' => 40,
  300.                                              'default' => 'global_abook' ),
  301.                  '$addrbook_global_writeable' => array'name' => _("Allow writing into global address book"),
  302.                                             'type' => SMOPT_TYPE_BOOLEAN ),
  303.                  '$addrbook_global_listing' => array'name' => _("Allow listing of global address book"),
  304.                                             'type' => SMOPT_TYPE_BOOLEAN ),
  305.                  /* ---- Language settings ---- */
  306.                  'Group9' => array'name' => _("Language settings"),
  307.                                     'type' => SMOPT_TYPE_TITLE ),
  308.                  '$squirrelmail_default_language' => array'name' => _("Default Language"),
  309.                                                             'type' => SMOPT_TYPE_STRLIST,
  310.                                                             'size' => 7,
  311.                                                             'posvals' => $language_values ),
  312.                  '$default_charset' => array'name' => _("Default Charset"),
  313.                                               'type' => SMOPT_TYPE_STRLIST,
  314.                                               'posvals' => array'iso-8859-1' => 'iso-8859-1',
  315.                                                                   'iso-8859-2' => 'iso-8859-2',
  316.                                                                   'iso-8859-7' => 'iso-8859-7',
  317.                                                                   'iso-8859-9' => 'iso-8859-9',
  318.                                                                   'iso-8859-15' => 'iso-8859-15',
  319.                                                                   'utf-8' => 'utf-8',
  320.                                                                   'koi8-r' => 'koi8-r',
  321.                                                                   'euc-kr' => 'euc-kr',
  322.                                                                   'big5' => 'big5',
  323.                                                                   'gb2312' => 'gb2312',
  324.                                                                   'tis-620' => 'tis-620',
  325.                                                                   'windows-1251' => 'windows-1251',
  326.                                                                   'windows-1255' => 'windows-1255',
  327.                                                                   'windows-1256' => 'windows-1256',
  328.                                                                   'iso-2022-jp' => 'iso-2022-jp' ) ),
  329.                   '$lossy_encoding'  => array'name' => _("Enable lossy encoding"),
  330.                                                'type' => SMOPT_TYPE_BOOLEAN ),
  331.                  /* ---- Settings of address books ---- */
  332.                  'Group10' => array'name' => _("Address Books"),
  333.                                      'type' => SMOPT_TYPE_TITLE ),
  334.                  '$default_use_javascript_addr_book' => array'name' => _("Default Javascript Addressbook"),
  335.                                                   'type' => SMOPT_TYPE_BOOLEAN ),
  336.                  '$abook_global_file' => array'name' => _("Global address book file"),
  337.                                                   'type' => SMOPT_TYPE_STRING ),
  338.                  '$abook_global_file_writeable' => array'name' => _("Allow writing into global address book file"),
  339.                                                   'type' => SMOPT_TYPE_BOOLEAN ),
  340.                  /* --------------------------------------------------------*/
  341.                  'Group7' => array'name' => _("Themes"),
  342.                                     'type' => SMOPT_TYPE_TITLE ),
  343.                  '$theme_css' => array'name' => _("Style Sheet URL (css)"),
  344.                                         'type' => SMOPT_TYPE_PATH,
  345.                                         'size' => 40 ),
  346.                  '$theme_default' => array'name' => _("Default theme"),
  347.                                             'type' => SMOPT_TYPE_INTEGER,
  348.                                             'default' => 0,
  349.                                             'comment' => _("Use index number of theme") ),
  350.                  /* ---- Group8 is for plugins ---- */
  351.                  /* --------------------------------------------------------*/
  352.                  '$config_use_color' => array'name' => '',
  353.                                                'type' => SMOPT_TYPE_HIDDEN ),
  354.                  '$no_list_for_subscribe' => array'name' => '',
  355.                                                     'type' => SMOPT_TYPE_HIDDEN ),
  356.                  /* --------------------------------------------------------*/
  357.  
  358.                );
  359.  
  360. ?>

Documentation generated on Sat, 07 Oct 2006 16:30:48 +0300 by phpDocumentor 1.3.0RC6