added a server-side sorting option. set gloablly in conf.pl
[squirrelmail.git] / config / conf.pl
index 7e18dda637156694f0fe86846ff3ea112af66806..9b5ec456239925316414bc122c723f18b6b5343f 100755 (executable)
@@ -287,6 +287,9 @@ if ( !$edit_name ) {
 if ( !$allow_thread_sort ) {
     $allow_thread_sort = 'false';
 }
+if ( !$allow_server_sort ) {
+    $allow_server_sort = 'false';
+}
 if ( !$prefs_user_field ) {
     $prefs_user_field = 'user';
 }
@@ -415,8 +418,9 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
         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 "12. 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";
@@ -596,7 +600,8 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
             elsif ( $command == 9 )  { $default_use_mdn          = command39(); }
             elsif ( $command == 10 ) { $edit_identity            = command310(); }
             elsif ( $command == 11 ) { $allow_thread_sort        = command312(); }
-            elsif ( $command == 12 ) { $edit_name                = command311(); }
+            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(); }
@@ -1676,6 +1681,7 @@ sub command311 {
 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" ) {
@@ -1693,6 +1699,26 @@ sub command312 {
     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";
@@ -2216,6 +2242,7 @@ sub save_data {
         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++ ) {