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-2018 The SquirrelMail Project Team
  8.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  9.  * @version $Id: defines.php 14749 2018-01-16 23:36:07Z 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_BOOLEAN,
  121.                                            'comment' => _("Requires PHP 4.3.x! Experimental."),
  122.                                            'default' => false ),
  123.                  '$imap_auth_mech' => array'name' => _("IMAP Authentication Type"),
  124.                                              'type' => SMOPT_TYPE_STRLIST,
  125.                                              'posvals' => array('login' => _("IMAP login"),
  126.                                                                 'cram-md5' => 'CRAM-MD5',
  127.                                                                 'digest-md5' => 'DIGEST-MD5'),
  128.                                              'default' => 'login' ),
  129.                  '$useSendmail' => array'name' => _("Use Sendmail Binary"),
  130.                                           'type' => SMOPT_TYPE_BOOLEAN,
  131.                                           'comment' => _("Choose &quot;no&quot; for SMTP") ),
  132.                  '$sendmail_path' => array'name' => _("Sendmail Path"),
  133.                                             'type' => SMOPT_TYPE_STRING,
  134.                                             'size' => 40 ),
  135.                  '$sendmail_args' => array'name' => _("Sendmail Arguments"),
  136.                                             'type' => SMOPT_TYPE_STRING,
  137.                                             'size' => 40 ),
  138.                  '$smtpServerAddress' => array'name' => _("SMTP Server Address"),
  139.                                                 'type' => SMOPT_TYPE_STRING,
  140.                                                 'size' => 40 ),
  141.                  '$smtpPort' => array'name' => _("SMTP Server Port"),
  142.                                        'type' => SMOPT_TYPE_INTEGER ),
  143.                  '$use_smtp_tls' => array'name' => _("Use TLS for SMTP Connections"),
  144.                                            'type' => SMOPT_TYPE_BOOLEAN,
  145.                                            'comment' => _("Requires PHP 4.3.x! Experimental."),
  146.                                            'default' => false ),
  147.                  '$smtp_auth_mech' => array'name' => _("SMTP Authentication Type"),
  148.                                              'type' => SMOPT_TYPE_STRLIST,
  149.                                              'posvals' => array('none' => _("No SMTP auth"),
  150.                                                                 'login' => _("Login (plain text)"),
  151.                                                                 'cram-md5' => 'CRAM-MD5',
  152.                                                                 'digest-md5' => 'DIGEST-MD5'),
  153.                                              'default' => 'none'),
  154.                  '$smtp_sitewide_user' => array'name' => _("Custom SMTP AUTH username"),
  155.                                                  'type' => SMOPT_TYPE_STRING,
  156.                                                  'size' => 40),
  157.                  '$smtp_sitewide_pass' => array'name' => _("Custom SMTP AUTH password"),
  158.                                                  'type' => SMOPT_TYPE_STRING,
  159.                                                  'size' => 40),
  160.                  '$pop_before_smtp' => array'name' => _("POP3 Before SMTP?"),
  161.                                               'type' => SMOPT_TYPE_BOOLEAN,
  162.                                               'default' => false ),
  163.                  '$encode_header_key' => array'name' => _("Header Encryption Key"),
  164.                                                 'type' => SMOPT_TYPE_STRING ),
  165.                  '$invert_time' => array'name' => _("Invert Time"),
  166.                                           'type' => SMOPT_TYPE_BOOLEAN ),
  167.                  /* --------------------------------------------------------*/
  168.                  'Group3' => array'name' => _("Folders Defaults"),
  169.                                     'type' => SMOPT_TYPE_TITLE ),
  170.                  '$default_folder_prefix' => array'name' => _("Default Folder Prefix"),
  171.                                                     'type' => SMOPT_TYPE_STRING,
  172.                                                     'size' => 40 ),
  173.                  '$show_prefix_option' => array'name' => _("Show Folder Prefix Option"),
  174.                                                  'type' => SMOPT_TYPE_BOOLEAN ),
  175.                  '$trash_folder' => array'name' => _("Trash Folder"),
  176.                                            'type' => SMOPT_TYPE_STRING,
  177.                                            'size' => 40 ),
  178.                  '$sent_folder' => array'name' => _("Sent Folder"),
  179.                                           'type' => SMOPT_TYPE_STRING,
  180.                                           'size' => 40 ),
  181.                  '$draft_folder' => array'name' => _("Draft Folder"),
  182.                                            'type' => SMOPT_TYPE_STRING,
  183.                                            'size' => 40 ),
  184.                  '$default_move_to_trash' => array'name' => _("By default, move to trash"),
  185.                                                     'type' => SMOPT_TYPE_BOOLEAN ),
  186.                  '$default_move_to_sent' => array'name' => _("By default, move to sent"),
  187.                                                    'type' => SMOPT_TYPE_BOOLEAN ),
  188.                  '$default_save_as_draft' => array'name' => _("By default, save as draft"),
  189.                                                    'type' => SMOPT_TYPE_BOOLEAN ),
  190.                  '$list_special_folders_first' => array'name' => _("List Special Folders First"),
  191.                                                          'type' => SMOPT_TYPE_BOOLEAN ),
  192.                  '$use_special_folder_color' => array'name' => _("Show Special Folders Color"),
  193.                                                        'type' => SMOPT_TYPE_BOOLEAN ),
  194.                  '$auto_expunge' => array'name' => _("Auto Expunge"),
  195.                                            'type' => SMOPT_TYPE_BOOLEAN ),
  196.                  '$default_sub_of_inbox' => array'name' => _("Default Sub. of INBOX"),
  197.                                                    'type' => SMOPT_TYPE_BOOLEAN ),
  198.                  '$show_contain_subfolders_option' => array'name' => _("Show 'Contain Sub.' Option"),
  199.                                                              'type' => SMOPT_TYPE_BOOLEAN ),
  200.                  '$default_unseen_notify' => array'name' => _("Default Unseen Notify"),
  201.                                                     'type' => SMOPT_TYPE_NUMLIST,
  202.                                                     'posvals' => arraySMPREF_UNSEEN_NONE  => _("No Notification"),
  203.                                                                         SMPREF_UNSEEN_INBOX => _("Only INBOX"),
  204.                                                                         SMPREF_UNSEEN_ALL   => _("All Folders")) ),
  205.                  '$default_unseen_type'  => array'name' => _("Default Unseen Type"),
  206.                                                    'type' => SMOPT_TYPE_NUMLIST ,
  207.                                                    'posvals' => arraySMPREF_UNSEEN_ONLY  => _("Only Unseen"),
  208.                                                                        SMPREF_UNSEEN_TOTAL => _("Unseen and Total") ) ),
  209.                  '$auto_create_special' => array'name' => _("Auto Create Special Folders"),
  210.                                                   'type' => SMOPT_TYPE_BOOLEAN ),
  211.                  '$delete_folder' => array'name' => _("Auto delete folders"),
  212.                                             'type' => SMOPT_TYPE_BOOLEAN ),
  213.                  '$noselect_fix_enable' => array'name' => _("Enable /NoSelect folder fix"),
  214.                                                   'type' => SMOPT_TYPE_BOOLEAN,
  215.                                                   'default' => false),
  216.                  /* --------------------------------------------------------*/
  217.                  'Group4' => array'name' => _("General Options"),
  218.                                     'type' => SMOPT_TYPE_TITLE ),
  219.                  '$data_dir' => array'name' => _("Data Directory"),
  220.                                        'type' => SMOPT_TYPE_PATH,
  221.                                        'size' => 40 ),
  222.                  '$attachment_dir' => array'name' => _("Temp Directory"),
  223.                                              'type' => SMOPT_TYPE_PATH,
  224.                                              'size' => 40 ),
  225.                  '$dir_hash_level' => array'name' => _("Hash Level"),
  226.                                              'type' => SMOPT_TYPE_NUMLIST,
  227.                                              'posvals' => array=> _("Hash Disabled"),
  228.                                                                  => _("Low"),
  229.                                                                  => _("Moderate"),
  230.                                                                  => _("Medium"),
  231.                                                                  => _("High") ) ),
  232.                  '$default_left_size' => array'name' => _("Default Left Size"),
  233.                                                 'type' => SMOPT_TYPE_NUMLIST,
  234.                                                 'posvals' => $left_size_values ),
  235.                  '$force_username_lowercase' => array'name' => _("Usernames in Lowercase"),
  236.                                                        'type' => SMOPT_TYPE_BOOLEAN ),
  237.                  '$default_use_priority'  => array'name' => _("Allow use of priority"),
  238.                                                     'type' => SMOPT_TYPE_BOOLEAN ),
  239.                  '$hide_sm_attributions' => array'name' => _("Hide SM attributions"),
  240.                                                    'type' => SMOPT_TYPE_BOOLEAN ),
  241.                  '$default_use_mdn' => array'name' => _("Enable use of delivery receipts"),
  242.                                              'type' => SMOPT_TYPE_BOOLEAN ),
  243.                  '$edit_identity' => array'name' => _("Allow editing of identities"),
  244.                                             'type' => SMOPT_TYPE_BOOLEAN ),
  245.                  '$edit_name' => array'name' => _("Allow editing of full name"),
  246.                                         'type' => SMOPT_TYPE_BOOLEAN ),
  247.                  '$edit_reply_to' => array'name' => _("Allow editing of reply-to address"),
  248.                                         'type' => SMOPT_TYPE_BOOLEAN ),
  249.                  '$hide_auth_header' => array'name' => _("Remove username from headers"),
  250.                                                'comment' => _("Used only when identities can't be modified"),
  251.                                                'type' => SMOPT_TYPE_BOOLEAN ),
  252.                  '$allow_server_sort' => array'name' => _("Use server-side sorting"),
  253.                                                 'type' => SMOPT_TYPE_BOOLEAN,
  254.                                                 'default' => false ),
  255.                  '$allow_thread_sort' => array'name' => _("Use server-side thread sorting"),
  256.                                                 'type' => SMOPT_TYPE_BOOLEAN,
  257.                                                 'default' => false ),
  258.                  '$allow_charset_search' => array'name' => _("Allow server charset search"),
  259.                                                    'type' => SMOPT_TYPE_BOOLEAN,
  260.                                                    'default' => false ),
  261.                  '$uid_support' => array'name' => _("UID support"),
  262.                                           'type' => SMOPT_TYPE_BOOLEAN,
  263.                                           'default' => false ),
  264.                  '$session_name' => array'name' => _("PHP session name"),
  265.                                            'type' => SMOPT_TYPE_HIDDEN ),
  266.                  '$config_location_base' => array'name' => _("Location base"),
  267.                                                    'type' => SMOPT_TYPE_STRING,
  268.                                                    'size' => 40,
  269.                                                    'default' => '' ),
  270.                  '$use_transparent_security_image' => array'name' => _("Use transparent security image"),
  271.                                           'type' => SMOPT_TYPE_BOOLEAN,
  272.                                           'default' => true ),
  273.                  '$display_imap_login_error' => array'name' => _("Show login error message directly from IMAP server instead of generic one"),
  274.                                           'type' => SMOPT_TYPE_BOOLEAN,
  275.                                           'default' => false ),
  276.                  /* --------------------------------------------------------*/
  277.                  'Group5' => array'name' => _("Message of the Day"),
  278.                                     'type' => SMOPT_TYPE_TITLE ),
  279.                  '$motd' => array'name' => _("Message of the Day"),
  280.                                    'type' => SMOPT_TYPE_TEXTAREA,
  281.                                    'size' => 40 ),
  282.                  /* ---- Database settings ---- */
  283.                  'Group6' => array'name' => _("Database"),
  284.                                     'type' => SMOPT_TYPE_TITLE ),
  285.                  '$addrbook_dsn' => array'name' => _("Address book DSN"),
  286.                                            'type' => SMOPT_TYPE_STRING,
  287.                                            'size' => 40 ),
  288.                  '$addrbook_table' => array'name' => _("Address book table"),
  289.                                              'type' => SMOPT_TYPE_STRING,
  290.                                              'size' => 40,
  291.                                              'default' => 'address' ),
  292.                  '$prefs_dsn' => array'name' => _("Preferences DSN"),
  293.                                         'type' => SMOPT_TYPE_STRING,
  294.                                         'size' => 40 ),
  295.                  '$prefs_table' => array'name' => _("Preferences table"),
  296.                                           'type' => SMOPT_TYPE_STRING,
  297.                                           'size' => 40,
  298.                                           'default' => 'userprefs' ),
  299.                  '$prefs_user_field' => array('name' => _("Preferences username field"),
  300.                                               'type' => SMOPT_TYPE_STRING,
  301.                                               'size' => 40,
  302.                                               'default' => 'user' ),
  303.                  '$prefs_key_field' => array('name' => _("Preferences key field"),
  304.                                              'type' => SMOPT_TYPE_STRING,
  305.                                              'size' => 40,
  306.                                              'default' => 'prefkey' ),
  307.                  '$prefs_val_field' => array('name' => _("Preferences value field"),
  308.                                              'type' => SMOPT_TYPE_STRING,
  309.                                              'size' => 40,
  310.                                              'default' => 'prefval' ),
  311.                  '$addrbook_global_dsn' => array'name' => _("Global address book DSN"),
  312.                                            'type' => SMOPT_TYPE_STRING,
  313.                                            'size' => 40 ),
  314.                  '$addrbook_global_table' => array'name' => _("Global address book table"),
  315.                                              'type' => SMOPT_TYPE_STRING,
  316.                                              'size' => 40,
  317.                                              'default' => 'global_abook' ),
  318.                  '$addrbook_global_writeable' => array'name' => _("Allow writing into global address book"),
  319.                                             'type' => SMOPT_TYPE_BOOLEAN ),
  320.                  '$addrbook_global_listing' => array'name' => _("Allow listing of global address book"),
  321.                                             'type' => SMOPT_TYPE_BOOLEAN ),
  322.                  /* ---- Language settings ---- */
  323.                  'Group9' => array'name' => _("Language settings"),
  324.                                     'type' => SMOPT_TYPE_TITLE ),
  325.                  '$squirrelmail_default_language' => array'name' => _("Default Language"),
  326.                                                             'type' => SMOPT_TYPE_STRLIST,
  327.                                                             'size' => 7,
  328.                                                             'posvals' => $language_values ),
  329.                  '$default_charset' => array'name' => _("Default Charset"),
  330.                                               'type' => SMOPT_TYPE_STRLIST,
  331.                                               'posvals' => array'iso-8859-1' => 'iso-8859-1',
  332.                                                                   'iso-8859-2' => 'iso-8859-2',
  333.                                                                   'iso-8859-7' => 'iso-8859-7',
  334.                                                                   'iso-8859-9' => 'iso-8859-9',
  335.                                                                   'iso-8859-15' => 'iso-8859-15',
  336.                                                                   'utf-8' => 'utf-8',
  337.                                                                   'koi8-r' => 'koi8-r',
  338.                                                                   'euc-kr' => 'euc-kr',
  339.                                                                   'big5' => 'big5',
  340.                                                                   'gb2312' => 'gb2312',
  341.                                                                   'tis-620' => 'tis-620',
  342.                                                                   'windows-1251' => 'windows-1251',
  343.                                                                   'windows-1255' => 'windows-1255',
  344.                                                                   'windows-1256' => 'windows-1256',
  345.                                                                   'iso-2022-jp' => 'iso-2022-jp' ) ),
  346.                   '$lossy_encoding'  => array'name' => _("Enable lossy encoding"),
  347.                                                'type' => SMOPT_TYPE_BOOLEAN ),
  348.                  /* ---- Settings of address books ---- */
  349.                  'Group10' => array'name' => _("Address Books"),
  350.                                      'type' => SMOPT_TYPE_TITLE ),
  351.                  '$default_use_javascript_addr_book' => array'name' => _("Default Javascript Addressbook"),
  352.                                                   'type' => SMOPT_TYPE_BOOLEAN ),
  353.                  '$abook_global_file' => array'name' => _("Global address book file"),
  354.                                                   'type' => SMOPT_TYPE_STRING ),
  355.                  '$abook_global_file_writeable' => array'name' => _("Allow writing into global address book file"),
  356.                                                   'type' => SMOPT_TYPE_BOOLEAN ),
  357.                  /* --------------------------------------------------------*/
  358.                  'Group7' => array'name' => _("Themes"),
  359.                                     'type' => SMOPT_TYPE_TITLE ),
  360.                  '$theme_css' => array'name' => _("Style Sheet URL (css)"),
  361.                                         'type' => SMOPT_TYPE_PATH,
  362.                                         'size' => 40 ),
  363.                  '$theme_default' => array'name' => _("Default theme"),
  364.                                             'type' => SMOPT_TYPE_INTEGER,
  365.                                             'default' => 0,
  366.                                             'comment' => _("Use index number of theme") ),
  367.                  /* --------------------------------------------------------*/
  368.                  '$config_use_color' => array'name' => '',
  369.                                                'type' => SMOPT_TYPE_HIDDEN ),
  370.                  '$no_list_for_subscribe' => array'name' => '',
  371.                                                     'type' => SMOPT_TYPE_HIDDEN ),
  372.                  /* --------------------------------------------------------*/
  373.  
  374.                );

Documentation generated on Wed, 24 Jan 2018 04:25:46 +0100 by phpDocumentor 1.4.3