Source for file defines.php

Documentation is available at defines.php

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

Documentation generated on Mon, 13 Jan 2020 04:24:29 +0100 by phpDocumentor 1.4.3