small aesthetic fix
[squirrelmail.git] / config / conf.pl
index 2b5b72bc275490e2db1b093d88c0f9b0411a494b..76159a7e001263fbce7619fbedb138c3527f5c85 100755 (executable)
@@ -284,6 +284,12 @@ if ( !$edit_identity ) {
 if ( !$edit_name ) {
     $edit_name = "true";
 }
+if ( !$allow_thread_sort ) {
+    $allow_thread_sort = 'false';
+}
+if ( !$allow_server_sort ) {
+    $allow_server_sort = 'false';
+}
 if ( !$prefs_user_field ) {
     $prefs_user_field = 'user';
 }
@@ -411,9 +417,10 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
         print "8.  Hide SM attributions      : $WHT$hide_sm_attributions$NRM\n";
         print "9.  Allow use of receipts     : $WHT$default_use_mdn$NRM\n";
         print "10. Allow editing of identity : $WHT$edit_identity$NRM\n";
-
+        print "11. Allow server thread sort  : $WHT$allow_thread_sort$NRM\n";
+        print "12. Allow server-side sorting : $WHT$allow_server_sort$NRM\n";
         if ( lc($edit_identity) eq "false" ) {
-            print "11. Allow editing of name     : $WHT$edit_name$NRM\n";
+            print "13. Allow editing of name     : $WHT$edit_name$NRM\n";
         }
         print "\n";
         print "R   Return to Main Menu\n";
@@ -592,7 +599,9 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
             elsif ( $command == 8 )  { $hide_sm_attributions     = command38(); }
             elsif ( $command == 9 )  { $default_use_mdn          = command39(); }
             elsif ( $command == 10 ) { $edit_identity            = command310(); }
-            elsif ( $command == 11 ) { $edit_name                = command311(); }
+            elsif ( $command == 11 ) { $allow_thread_sort        = command312(); }
+            elsif ( $command == 12 ) { $allow_server_sort        = command313(); }
+            elsif ( $command == 13 ) { $edit_name                = command311(); }
         } elsif ( $menu == 5 ) {
             if ( $command == 1 ) { command41(); }
             elsif ( $command == 2 ) { $theme_css = command42(); }
@@ -663,13 +672,15 @@ sub command2a {
     if ( $new_org_logo_width eq '' ) {
         $new_org_logo_width = $org_logo_width;
     }
-    if ( $new_org_logo_height > 0 ) {
-       print "Height: [$WHT$org_logo_height$NRM]: $WHT";
-       $new_org_logo_height = <STDIN>;
-       $new_org_logo_height =~ tr/0-9//cd;  # only want digits!
-        $new_org_logo_height = $org_logo_height;
+    if ( $new_org_logo_width > 0 ) {
+        print "Height: [$WHT$org_logo_height$NRM]: $WHT";
+        $new_org_logo_height = <STDIN>;
+        $new_org_logo_height =~ tr/0-9//cd;  # only want digits!
+        if( $new_org_logo_height eq '' ) {
+               $new_org_logo_height = $org_logo_height;
+       }
     } else {
-       $new_org_logo_height = 0;
+        $new_org_logo_height = 0;
     }
     return ($new_org_logo_width, $new_org_logo_height);
 }
@@ -1040,14 +1051,14 @@ sub command21 {
         $new_default_folder_prefix = "";
     } else {
         # add the trailing delimiter only if we know what the server is.
-       if ($optional_delimiter and $optional_delimiter ne 'detect') {
+        if ($optional_delimiter and $optional_delimiter ne 'detect') {
            $new_default_folder_prefix =~ s/${optional_delimiter}*$/$optional_delimiter/;
-       } elsif ($imap_server_type eq 'cyrus' or
-                $imap_server_type eq 'courier') {
+        } elsif ($imap_server_type eq 'cyrus' or
+                 $imap_server_type eq 'courier') {
            $new_default_folder_prefix =~ s/\.*$/\./;
-       } elsif ($imap_server_type eq 'uw') {
+        } elsif ($imap_server_type eq 'uw') {
            $new_default_folder_prefix =~ s/\/*$/\//;
-       }
+        }
     }
     return $new_default_folder_prefix;
 }
@@ -1669,6 +1680,47 @@ sub command311 {
     return $edit_name;
 }
 
+sub command312 {
+    print "This option allows you to choose if users can use thread sorting\n";
+    print "Your IMAP server must support the THREAD command for this to work\n";
+       print "PHP versions later than 4.0.3 recommended\n";
+    print "\n";
+
+    if ( lc($allow_thread_sort) eq "true" ) {
+        $default_value = "y";
+    } else {
+        $default_value = "n";
+    }
+    print "Allow server side thread sorting? (y/n) [$WHT$default_value$NRM]: $WHT";
+    $allow_thread_sort = <STDIN>;
+    if ( ( $allow_thread_sort =~ /^y\n/i ) || ( ( $allow_thread_sort =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
+        $allow_thread_sort = "true";
+    } else {
+        $allow_thread_sort = "false";
+    }
+    return $allow_thread_sort;
+}
+
+sub command313 {
+    print "This option allows you to choose if SM uses server-side sorting\n";
+    print "Your IMAP server must support the SORT  command for this to work\n";
+    print "\n";
+
+    if ( lc($allow_server_sort) eq "true" ) {
+        $default_value = "y";
+    } else {
+        $default_value = "n";
+    }
+    print "Allow server-side sorting? (y/n) [$WHT$default_value$NRM]: $WHT";
+    $allow_server_sort = <STDIN>;
+    if ( ( $allow_server_sort =~ /^y\n/i ) || ( ( $allow_server_sort =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
+        $allow_server_sort = "true";
+    } else {
+        $allow_server_sort = "false";
+    }
+    return $allow_server_sort;
+}
+
 sub command41 {
     print "\nNow we will define the themes that you wish to use.  If you have added\n";
     print "a theme of your own, just follow the instructions (?) about how to add\n";
@@ -2191,6 +2243,8 @@ sub save_data {
         print CF "\$default_use_mdn          = $default_use_mdn;\n";
         print CF "\$edit_identity            = $edit_identity;\n";
         print CF "\$edit_name                = $edit_name;\n";
+        print CF "\$allow_thread_sort        = $allow_thread_sort;\n";
+        print CF "\$allow_server_sort        = $allow_server_sort;\n";
         print CF "\n";
 
         for ( $ct = 0 ; $ct <= $#plugins ; $ct++ ) {