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 &copy; 1999-2006 The SquirrelMail Project Team
  8.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  9.  * @version $Id: defines.php,v 1.76 2006/10/02 12:26:01 pdontthink Exp $
  10.  * @package plugins
  11.  * @subpackage administrator
  12.  */
  13.  
  14. /** Define constants for the various option types. */
  15. define('SMOPT_TYPE_UNDEFINED'-1);
  16. define('SMOPT_TYPE_STRING'0);
  17. define('SMOPT_TYPE_STRLIST'1);
  18. define('SMOPT_TYPE_TEXTAREA'2);
  19. define('SMOPT_TYPE_INTEGER'3);
  20. define('SMOPT_TYPE_FLOAT'4);
  21. define('SMOPT_TYPE_BOOLEAN'5);
  22. define('SMOPT_TYPE_HIDDEN'6);
  23. define('SMOPT_TYPE_COMMENT'7);
  24. define('SMOPT_TYPE_NUMLIST'8);
  25. define('SMOPT_TYPE_TITLE'9);
  26. define('SMOPT_TYPE_THEME'10);
  27. define('SMOPT_TYPE_PLUGINS'11);
  28. define('SMOPT_TYPE_LDAP'12);
  29. define('SMOPT_TYPE_CUSTOM'13);
  30. define('SMOPT_TYPE_EXTERNAL'32);
  31. define('SMOPT_TYPE_PATH',33);
  32.  
  33. /**
  34.  * Returns reformated aTemplateSet array data for option selection
  35.  * @return array template selection options
  36.  * @since 1.5.1
  37.  */
  38. function adm_template_options({
  39.     global $aTemplateSet;
  40.     $ret array();
  41.     foreach ($aTemplateSet as $iTemplateID => $aTemplate{
  42.         $ret[$iTemplateID$aTemplate['NAME'];
  43.     }
  44.     return $ret;
  45. }
  46.  
  47. global $languages$version;
  48.  
  49. $language_values array);
  50. foreach ($languages as $lang_key => $lang_attributes{
  51.     if (isset($lang_attributes['NAME'])) {
  52.         $language_values[$lang_key$lang_attributes['NAME'];
  53.     }
  54. }
  55. asort$language_values );
  56. $language_values array_merge(array('' => _("Default"))$language_values);
  57. $left_size_values array();
  58. for ($lsv 100$lsv <= 300$lsv += 10{
  59.     $left_size_values[$lsv"$lsv _("pixels");
  60. }
  61.  
  62. $defcfg array'$config_version' => array'name' => _("Config File Version"),
  63.                                              'type' => SMOPT_TYPE_COMMENT,
  64.                                              'size' => ),
  65.                  'SM_ver' => array'name' => _("SquirrelMail Version"),
  66.                                     'type' => SMOPT_TYPE_EXTERNAL,
  67.                                     'value' => "$version),
  68.                  'PHP_ver' => array'name' => _("PHP Version"),
  69.                                      'type' => SMOPT_TYPE_EXTERNAL,
  70.                                      'value' => phpversion() ),
  71.                  /* --------------------------------------------------------*/
  72.                  'Group1' => array'name' => _("Organization Preferences"),
  73.                                     'type' => SMOPT_TYPE_TITLE ),
  74.                  '$org_name' => array'name' => _("Organization Name"),
  75.                                        'type' => SMOPT_TYPE_STRING,
  76.                                        'size' => 40 ),
  77.                  '$org_logo' => array'name' => _("Organization Logo"),
  78.                                        'type' => SMOPT_TYPE_PATH,
  79.                                        'size' => 40,
  80.                                        'default' => '../images/sm_logo.png'),
  81.                  '$org_logo_width' => array'name'    => _("Organization Logo Width"),
  82.                                              'type'    => SMOPT_TYPE_STRING,
  83.                                              'size'    => 5,
  84.                                              'default' => 0),
  85.                  '$org_logo_height' => array'name'    => _("Organization Logo Height"),
  86.                                               'type'    => SMOPT_TYPE_STRING,
  87.                                               'size'    => 5,
  88.                                               'default' => 0),
  89.                  '$org_title' => array'name' => _("Organization Title"),
  90.                                         'type' => SMOPT_TYPE_STRING,
  91.                                         'size' => 40 ),
  92.                  '$signout_page' => array'name' => _("Signout Page"),
  93.                                            'type' => SMOPT_TYPE_PATH,
  94.                                            'size' => 40 ),
  95.                  '$provider_uri' => array'name' => _("Provider Link URI"),
  96.                                            'type' => SMOPT_TYPE_STRING ),
  97.                  '$provider_name' => array'name' => _("Provider Name"),
  98.                                             'type' => SMOPT_TYPE_STRING ),
  99.                  '$frame_top' => array'name' => _("Top Frame"),
  100.                                         'type' => SMOPT_TYPE_STRING,
  101.                                         'size' => 40,
  102.                                         'default' => '_top' ),
  103.                  /* --------------------------------------------------------*/
  104.                  'Group2' => array'name' => _("Server Settings"),
  105.                                     'type' => SMOPT_TYPE_TITLE ),
  106.                  '$domain' => array'name' => _("Mail Domain"),
  107.                                      'type' => SMOPT_TYPE_STRING,
  108.                                      'size' => 40 ),
  109.                  '$imapServerAddress' => array'name' => _("IMAP Server Address"),
  110.                                                 'type' => SMOPT_TYPE_STRING,
  111.                                                 'size' => 40 ),
  112.                  '$imapPort' => array'name' => _("IMAP Server Port"),
  113.                                        'type' => SMOPT_TYPE_INTEGER ),
  114.                  '$imap_server_type' => array'name' => _("IMAP Server Type"),
  115.                                                'type' => SMOPT_TYPE_STRLIST,
  116.                                                'posvals' => array'cyrus' => _("Cyrus IMAP server"),
  117.                                                                    'uw' => _("University of Washington's IMAP server"),
  118.                                                                    'exchange' => _("Microsoft Exchange IMAP server"),
  119.                                                                    'courier' => _("Courier IMAP server"),
  120.                                                                    'macosx' => _("Mac OS X Mailserver"),
  121.                                                                    'hmailserver' => _("hMailServer IMAP server"),
  122.                                                                    'mercury32' => _("Mercury/32 IMAP server"),
  123.                                                                    'bincimap' => _("Binc IMAP server"),
  124.                                                                    'other' => _("Not one of the above servers") ) ),
  125.                  '$optional_delimiter' => array'name' => _("IMAP Folder Delimiter"),
  126.                                                  'type' => SMOPT_TYPE_STRING,
  127.                                                  'comment' => _("Use &quot;detect&quot; to auto-detect."),
  128.                                                  'size' => 10,
  129.                                                  'default' => 'detect' ),
  130.                  '$use_imap_tls' => array'name' => _("IMAP Connection Security"),
  131.                                            'type' => SMOPT_TYPE_STRLIST,
  132.                                            'posvals' => array=> _("Plain text connection"),
  133.                                                                => _("Secure IMAP (TLS) connection"),
  134.                                                                => _("IMAP STARTTLS connection")),
  135.                                            'comment' => _("Requires higher PHP version and special functions. See SquirrelMail documentation."),
  136.                                            'default' => ),
  137.                  '$imap_auth_mech' => array'name' => _("IMAP Authentication Type"),
  138.                                              'type' => SMOPT_TYPE_STRLIST,
  139.                                              'posvals' => array('login' => _("IMAP login"),
  140.                                                                 'cram-md5' => 'CRAM-MD5',
  141.                                                                 'digest-md5' => 'DIGEST-MD5'),
  142.                                              'default' => 'login' ),
  143.                  '$useSendmail' => array'name' => _("Use Sendmail Binary"),
  144.                                           'type' => SMOPT_TYPE_BOOLEAN,
  145.                                           'comment' => _("Choose &quot;no&quot; for SMTP") ),
  146.                  '$sendmail_path' => array'name' => _("Sendmail Path"),
  147.                                             'type' => SMOPT_TYPE_STRING,
  148.                                             'size' => 40 ),
  149.                  '$sendmail_args' => array'name' => _("Sendmail Arguments"),
  150.                                             'type' => SMOPT_TYPE_STRING,
  151.                                             'size' => 40 ),
  152.                  '$smtpServerAddress' => array'name' => _("SMTP Server Address"),
  153.                                                 'type' => SMOPT_TYPE_STRING,
  154.                                                 'size' => 40 ),
  155.                  '$smtpPort' => array'name' => _("SMTP Server Port"),
  156.                                        'type' => SMOPT_TYPE_INTEGER ),
  157.                  '$use_smtp_tls' => array'name' => _("SMTP Connection Security"),
  158.                                            'type' => SMOPT_TYPE_STRLIST,
  159.                                            'posvals' => array=> _("Plain text connection"),
  160.                                                                => _("Secure IMAP (TLS) connection"),
  161.                                                                => _("IMAP STARTTLS connection")),
  162.                                            'comment' => _("Requires higher PHP version and special functions. See SquirrelMail documentation."),
  163.                                            'default' => ),
  164.                  '$smtp_auth_mech' => array'name' => _("SMTP Authentication Type"),
  165.                                              'type' => SMOPT_TYPE_STRLIST,
  166.                                              'posvals' => array('none' => _("No SMTP auth"),
  167.                                                                 'login' => _("Login (plain text)"),
  168.                                                                 'cram-md5' => 'CRAM-MD5',
  169.                                                                 'digest-md5' => 'DIGEST-MD5'),
  170.                                              'default' => 'none'),
  171.                  '$smtp_sitewide_user' => array'name' => _("Custom SMTP AUTH username"),
  172.                                                  'type' => SMOPT_TYPE_STRING,
  173.                                                  'size' => 40 ),
  174.                  '$smtp_sitewide_pass' => array'name' => _("Custom SMTP AUTH password"),
  175.                                                  'type' => SMOPT_TYPE_STRING,
  176.                                                  'size' => 40 ),
  177.                  '$pop_before_smtp' => array'name' => _("POP3 Before SMTP?"),
  178.                                               'type' => SMOPT_TYPE_BOOLEAN,
  179.                                               'default' => false ),
  180.                  '$encode_header_key' => array'name' => _("Header Encryption Key"),
  181.                                           'type' => SMOPT_TYPE_STRING ),
  182.                  '$invert_time' => array'name' => _("Invert Time"),
  183.                                           'type' => SMOPT_TYPE_BOOLEAN ),
  184.                  /* --------------------------------------------------------*/
  185.                  'Group3' => array'name' => _("Folders Defaults"),
  186.                                     'type' => SMOPT_TYPE_TITLE ),
  187.                  '$default_folder_prefix' => array'name' => _("Default Folder Prefix"),
  188.                                                     'type' => SMOPT_TYPE_STRING,
  189.                                                     'size' => 40 ),
  190.                  '$show_prefix_option' => array'name' => _("Show Folder Prefix Option"),
  191.                                                  'type' => SMOPT_TYPE_BOOLEAN ),
  192.                  '$trash_folder' => array'name' => _("Trash Folder"),
  193.                                            'type' => SMOPT_TYPE_STRING,
  194.                                            'size' => 40 ),
  195.                  '$sent_folder' => array'name' => _("Sent Folder"),
  196.                                           'type' => SMOPT_TYPE_STRING,
  197.                                           'size' => 40 ),
  198.                  '$draft_folder' => array'name' => _("Draft Folder"),
  199.                                            'type' => SMOPT_TYPE_STRING,
  200.                                            'size' => 40 ),
  201.                  '$default_move_to_trash' => array'name' => _("By default, move to trash"),
  202.                                                     'type' => SMOPT_TYPE_BOOLEAN ),
  203.                  '$default_move_to_sent' => array'name' => _("By default, move to sent"),
  204.                                                    'type' => SMOPT_TYPE_BOOLEAN ),
  205.                  '$default_save_as_draft' => array'name' => _("By default, save as draft"),
  206.                                                    'type' => SMOPT_TYPE_BOOLEAN ),
  207.                  '$list_special_folders_first' => array'name' => _("List Special Folders First"),
  208.                                                          'type' => SMOPT_TYPE_BOOLEAN ),
  209.                  '$use_special_folder_color' => array'name' => _("Show Special Folders Color"),
  210.                                                        'type' => SMOPT_TYPE_BOOLEAN ),
  211.                  '$auto_expunge' => array'name' => _("Auto Expunge"),
  212.                                            'type' => SMOPT_TYPE_BOOLEAN ),
  213.                  '$default_sub_of_inbox' => array'name' => _("Default Sub. of INBOX"),
  214.                                                    'type' => SMOPT_TYPE_BOOLEAN ),
  215.                  '$show_contain_subfolders_option' => array'name' => _("Show 'Contain Sub.' Option"),
  216.                                                              'type' => SMOPT_TYPE_BOOLEAN ),
  217.                  '$default_unseen_notify' => array'name' => _("Default Unseen Notify"),
  218.                                                     'type' => SMOPT_TYPE_NUMLIST,
  219.                                                     'posvals' => arraySMPREF_UNSEEN_NONE  => _("No Notification"),
  220.                                                                         SMPREF_UNSEEN_INBOX => _("Only INBOX"),
  221.                                                                         SMPREF_UNSEEN_ALL   => _("All Folders")) ),
  222.                  '$default_unseen_type'  => array'name' => _("Default Unseen Type"),
  223.                                                    'type' => SMOPT_TYPE_NUMLIST ,
  224.                                                    'posvals' => arraySMPREF_UNSEEN_ONLY  => _("Only Unseen"),
  225.                                                                        SMPREF_UNSEEN_TOTAL => _("Unseen and Total") ) ),
  226.                  '$auto_create_special' => array'name' => _("Auto Create Special Folders"),
  227.                                                   'type' => SMOPT_TYPE_BOOLEAN ),
  228.                  '$delete_folder' => array'name' => _("Auto delete folders"),
  229.                                             'type' => SMOPT_TYPE_BOOLEAN ),
  230.                  '$noselect_fix_enable' => array'name' => _("Enable /NoSelect folder fix"),
  231.                                                   'type' => SMOPT_TYPE_BOOLEAN,
  232.                                                   'default' => false),
  233.                  /* --------------------------------------------------------*/
  234.                  'Group4' => array'name' => _("General Options"),
  235.                                     'type' => SMOPT_TYPE_TITLE ),
  236.                  '$data_dir' => array'name' => _("Data Directory"),
  237.                                        'type' => SMOPT_TYPE_PATH,
  238.                                        'size' => 40 ),
  239.                  '$attachment_dir' => array'name' => _("Temp Directory"),
  240.                                              'type' => SMOPT_TYPE_PATH,
  241.                                              'size' => 40 ),
  242.                  '$dir_hash_level' => array'name' => _("Hash Level"),
  243.                                              'type' => SMOPT_TYPE_NUMLIST,
  244.                                              'posvals' => array=> _("Hash Disabled"),
  245.                                                                  => _("Low"),
  246.                                                                  => _("Moderate"),
  247.                                                                  => _("Medium"),
  248.                                                                  => _("High") ) ),
  249.                  '$default_left_size' => array'name' => _("Default Left Size"),
  250.                                                 'type' => SMOPT_TYPE_NUMLIST,
  251.                                                 'posvals' => $left_size_values ),
  252.                  '$force_username_lowercase' => array'name' => _("Usernames in Lowercase"),
  253.                                                        'type' => SMOPT_TYPE_BOOLEAN ),
  254.                  '$default_use_priority'  => array'name' => _("Allow use of priority"),
  255.                                                     'type' => SMOPT_TYPE_BOOLEAN ),
  256.                  '$hide_sm_attributions' => array'name' => _("Hide SM attributions"),
  257.                                                    'type' => SMOPT_TYPE_BOOLEAN ),
  258.                  '$default_use_mdn' => array'name' => _("Enable use of delivery receipts"),
  259.                                              'type' => SMOPT_TYPE_BOOLEAN ),
  260.                  '$edit_identity' => array'name' => _("Allow editing of i