More defines
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 27 Jan 2002 18:29:20 +0000 (18:29 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 27 Jan 2002 18:29:20 +0000 (18:29 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2253 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/administrator/defines.php
plugins/administrator/options.php
src/options_display.php

index 572e3bf..c22002b 100644 (file)
@@ -22,6 +22,7 @@ define('SMOPT_TYPE_FLOAT', 4);
 define('SMOPT_TYPE_BOOLEAN', 5);
 define('SMOPT_TYPE_HIDDEN', 6);
 define('SMOPT_TYPE_COMMENT', 7);
+define('SMOPT_TYPE_NUMLIST', 8);
 define('SMOPT_TYPE_TITLE', 128);
 
 /* Define constants for the options refresh levels. */
@@ -49,6 +50,11 @@ foreach ($languages as $lang_key => $lang_attributes) {
 }
 asort( $language_values );
 
+$left_size_values = array();
+for ($lsv = 100; $lsv <= 300; $lsv += 10) {
+    $left_size_values[$lsv] = "$lsv " . _("pixels");
+}
+
 $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
                                              'type' => SMOPT_TYPE_COMMENT,
                                              'size' => 7 ),
@@ -71,6 +77,9 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
                                                             'type' => SMOPT_TYPE_STRLIST,
                                                             'size' => 7,
                                                             'posvals' => $language_values ),
+                 '$frame_top' => array( 'name' => _("Top Frame"),
+                                        'type' => SMOPT_TYPE_STRING,
+                                        'size' => 40 ),
                  /* --------------------------------------------------------*/
                  'Group2' => array( 'name' => _("Server Settings"),
                                     'type' => SMOPT_TYPE_TITLE ),
@@ -84,7 +93,6 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
                                                  'type' => SMOPT_TYPE_INTEGER ),
                  '$imap_server_type' => array( 'name' => _("IMAP Server Type"),
                                                'type' => SMOPT_TYPE_STRLIST,
-                                               'size' => 7,
                                                'posvals' => array( 'cyrus' => _("Cyrus IMAP server"),
                                                                    'uw' => _("University of Washington's IMAP server"),
                                                                    'exchange' => _("Microsoft Exchange IMAP server"),
@@ -95,6 +103,9 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
                                                  'size' => 2 ),
                  '$useSendmail' => array( 'name' => _("Use Sendmail"),
                                           'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$sendmail_path' => array( 'name' => _("Sendmail Path"),
+                                            'type' => SMOPT_TYPE_STRING,
+                                            'size' => 40 ),
                  '$smtpServerAddress' => array( 'name' => _("SMTP Server Address"),
                                                 'type' => SMOPT_TYPE_STRING,
                                                 'size' => 40 ),
@@ -107,10 +118,78 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
                  /* --------------------------------------------------------*/
                  'Group3' => array( 'name' => _("Folders Defaults"),
                                     'type' => SMOPT_TYPE_TITLE ),
-                 '$motd' => array( 'name' => _("Message of the Day"),
+                 '$default_folder_prefix' => array( 'name' => _("Default Folder Prefix"),
+                                                    'type' => SMOPT_TYPE_STRING,
+                                                    'size' => 40 ),
+                 '$show_prefix_option' => array( 'name' => _("Show Folder Prefix Option"),
+                                                 'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$trash_folder' => array( 'name' => _("Trash Folder"),
+                                           'type' => SMOPT_TYPE_STRING,
+                                           'size' => 40 ),
+                 '$sent_folder' => array( 'name' => _("Sent Folder"),
+                                          'type' => SMOPT_TYPE_STRING,
+                                          'size' => 40 ),
+                 '$draft_folder' => array( 'name' => _("Draft Folder"),
+                                           'type' => SMOPT_TYPE_STRING,
+                                           'size' => 40 ),
+                 '$default_move_to_trash' => array( 'name' => _("By default, move to trash"),
+                                                    'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$default_move_to_sent' => array( 'name' => _("By default, move to sent"),
+                                                   'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$default_save_as_draft' => array( 'name' => _("By default, save as draft"),
+                                                   'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$list_special_folders_first' => array( 'name' => _("List Special Folders First"),
+                                                         'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$use_special_folder_color' => array( 'name' => _("Show Special Folders Color"),
+                                                       'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$auto_expunge' => array( 'name' => _("Auto Expunge"),
+                                           'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$default_sub_of_inbox' => array( 'name' => _("Default Sub. of INBOX"),
+                                                   'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$show_contain_subfolders_option' => array( 'name' => _("Show 'Contain Sub.' Option"),
+                                                             'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$default_unseen_notify' => array( 'name' => _("Default Unseen Notify"),
+                                                    'type' => SMOPT_TYPE_INTEGER ),
+                 '$default_unseen_type'  => array( 'name' => _("Default Unseen Type"),
+                                                   'type' => SMOPT_TYPE_INTEGER ),
+                 '$auto_create_special' => array( 'name' => _("Auto Create Special Folders"),
+                                                  'type' => SMOPT_TYPE_BOOLEAN ),
+                 /* --------------------------------------------------------*/
+                 'Group4' => array( 'name' => _("General OPtions"),
+                                    'type' => SMOPT_TYPE_TITLE ),
+                 '$default_charset' => array( 'name' => _("Default Charset"),
+                                              'type' => SMOPT_TYPE_STRING,
+                                              'size' => 10 ),
+                 '$data_dir' => array( 'name' => _("Data Directory"),
+                                       'type' => SMOPT_TYPE_STRING,
+                                       'size' => 40 ),
+                 '$attachment_dir' => array( 'name' => _("Temp Directory"),
                                              'type' => SMOPT_TYPE_STRING,
                                              'size' => 40 ),
-
+                 '$dir_hash_level' => array( 'name' => _("Hash Level"),
+                                             'type' => SMOPT_TYPE_NUMLIST,
+                                             'posvals' => array( 0 => _("Hash Disabled"),
+                                                                 1 => _("Low"),
+                                                                 2 => _("Moderate"),
+                                                                 3 => _("Medium"),
+                                                                 4 => _("High") ) ),
+                 '$default_left_size' => array( 'name' => _("Hash Level"),
+                                                'type' => SMOPT_TYPE_NUMLIST,
+                                                'posvals' => $left_size_values ),
+                 '$force_username_lowercase' => array( 'name' => _("Usernames in Lowercase"),
+                                                       'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$default_use_priority'  => array( 'name' => _("Allow use of priority"),
+                                                    'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$hide_sm_attributions' => array( 'name' => _("Hide SM attributions"),
+                                                   'type' => SMOPT_TYPE_BOOLEAN ),
+                 /* --------------------------------------------------------*/
+                 'Group5' => array( 'name' => _("Themes"),
+                                    'type' => SMOPT_TYPE_TITLE )
                );
 
+
+$defcfg['$motd'] = array( 'name' => _("Message of the Day"),
+                          'type' => SMOPT_TYPE_STRING,
+                          'size' => 40 );
+
 ?>
\ No newline at end of file
index d75b062..a5500f7 100644 (file)
@@ -18,6 +18,19 @@ require_once('../functions/imap.php');
 require_once('../src/load_prefs.php');
 require_once('../plugins/administrator/defines.php');
 
+$auth = FALSE;
+if ( $adm_id = fileowner('../config/config.php') ) {
+    $adm = posix_getpwuid( $adm_id );
+    if ( $username == $adm['name'] ) {
+        $auth = TRUE;
+    }
+}
+
+if ( !auth ) {
+    header("Location: ../../src/options.php") ;
+    exit;
+}
+
 displayPageHeader($color, 'None');
 
 $cfgfile = '../config/config.php';
@@ -132,7 +145,7 @@ foreach ( $newcfg as $k => $v ) {
 
     switch ( $type ) {
     case SMOPT_TYPE_TITLE:
-        echo "<tr bgcolor=\"$color[5]\"><th colspan=2>$name</th></tr>";
+        echo "<tr bgcolor=\"$color[0]\"><th colspan=2>$name</th></tr>";
         break;
     case SMOPT_TYPE_COMMENT:
         $v = substr( $v, 1, strlen( $v ) - 2 );
@@ -148,6 +161,22 @@ foreach ( $newcfg as $k => $v ) {
         echo "<tr><td>$name</td><td>";
         echo "<input size=10 name=\"adm_$n\" value=\"$v\">";
         break;
+    case SMOPT_TYPE_NUMLIST:
+        if ( isset( $HTTP_POST_VARS[$e] ) ) {
+            $v = $HTTP_POST_VARS[$e];
+            $newcfg[$k] = $v;
+        }
+        echo "<tr><td>$name</td><td>";
+        echo "<select name=\"adm_$n\">";
+        foreach ( $defcfg[$k]['posvals'] as $kp => $vp ) {
+            echo "<option value=\"$kp\"";
+            if ( $kp == $v ) {
+                echo ' selected';
+            }
+            echo ">$vp</option>";
+        }
+        echo '</select>';
+        break;
     case SMOPT_TYPE_STRLIST:
         if ( isset( $HTTP_POST_VARS[$e] ) ) {
             $v = '"' . $HTTP_POST_VARS[$e] . '"';
index bf46485..d5c30fd 100644 (file)
@@ -49,13 +49,13 @@ function load_optpage_data_display() {
     );
  
     $css_values = array( 'none' => _("Default" ) );
-       $handle=opendir('../themes/css/');
-       while ($file = readdir($handle) ) {
-           if ( substr( $file, -4 ) == '.css' ) {
-               $css_values[$file] = substr( $file, 0, strlen( $file ) - 4 );
+    $handle=opendir('../themes/css/');
+    while ($file = readdir($handle) ) {
+        if ( substr( $file, -4 ) == '.css' ) {
+            $css_values[$file] = substr( $file, 0, strlen( $file ) - 4 );
         }
-       }       
-       closedir($handle);
+    }
+    closedir($handle);
     
     if ( count( $css_values > 1 ) ) {