Strings update
[squirrelmail.git] / config / conf.pl
index 5610f64bbeb91b34ca5719e8d40ac2d787484a03..12fa4c77fcafc0f7e53bd372e793c5f115301fbf 100755 (executable)
@@ -35,7 +35,7 @@ if ( -e "config.php") {
                $o[1] =~ s/[\n|\r]//g;
                $o[1] =~ s/\";\s*$//;
                $o[1] =~ s/;$//;
-               $o[1] =~ s/^"//;
+               $o[1] =~ s/^\"//;
 
                $config_version = $o[1];
                close (FILE);
@@ -86,7 +86,7 @@ if ( -e "config.php") {
                $o[1] =~ s/[\n|\r]//g;
                $o[1] =~ s/\";\s*$//;
                $o[1] =~ s/;$//;
-               $o[1] =~ s/^"//;
+               $o[1] =~ s/^\"//;
 
                $config_version = $o[1];
                close (FILE);
@@ -248,6 +248,12 @@ if (!$use_authenticated_smtp) {
 if (!$auto_create_special) {
        $auto_create_special = "false";
 }
+if(!$default_use_priority) {
+        $default_use_priority = "true";
+}
+if(!$hide_sm_attributions) {
+        $hide_sm_attributions = "false";
+}
 
 #####################################################################################
 if ($config_use_color == 1) {
@@ -340,6 +346,8 @@ while (($command ne "q") && ($command ne "Q")) {
       print "3.  Attachment Directory   : $WHT$attachment_dir$NRM\n";
       print "4.  Default Left Size      : $WHT$default_left_size$NRM\n";
       print "5.  Usernames in Lowercase : $WHT$force_username_lowercase$NRM\n";
+      print "6.  Allow use of priority  : $WHT$default_use_priority$NRM\n";
+      print "7.  Hide SM attributions   : $WHT$hide_sm_attributions$NRM\n";
       print "\n";
       print "R   Return to Main Menu\n";
    } elsif ($menu == 5) {
@@ -402,6 +410,8 @@ while (($command ne "q") && ($command ne "Q")) {
       }
       closedir DIR;
       
+      print "\n";
+      print "A   Sanitize all plugins for use with Squirrelmail 1.2\n";
       print "\n";
       print "R   Return to Main Menu\n";
    }
@@ -495,6 +505,8 @@ while (($command ne "q") && ($command ne "Q")) {
          elsif ($command == 3) { $attachment_dir           = command34 (); }
          elsif ($command == 4) { $default_left_size        = command35 (); }
         elsif ($command == 5) { $force_username_lowercase = command36 (); }
+        elsif ($command == 6) { $default_use_priority     = command37 (); }
+         elsif ($command == 7) { $hide_sm_attributions     = command38 (); }
       } elsif ($menu == 5) {
          if    ($command == 1) { command41 (); }
          elsif ($command == 2) { $theme_css = command42 (); }
@@ -505,6 +517,7 @@ while (($command ne "q") && ($command ne "Q")) {
          if    ($command == 1) { $motd             = command71(); }
       } elsif ($menu == 8) {
          if    ($command =~ /^[0-9]+/) { @plugins = command81(); }
+         elsif ($command eq "a") { command8s(); }
       }
    }   
 }
@@ -833,6 +846,9 @@ sub command81 {
          while ($ct <= $#unused_plugins) {
             if ($ct == $num) {
                @newplugins = (@newplugins, $unused_plugins[$ct]);
+               # sanitize the plugin
+              $dir = $unused_plugins[$ct];
+               `./ri_once.pl ../plugins/$dir`;
             }
             $ct++;
          }
@@ -842,6 +858,18 @@ sub command81 {
    return @plugins;
 }   
 
+sub command8s {
+    print "This command will sanitize all plugins for use with\n";
+    print "Squirrelmail 1.2. That is, it will rewrite some php-\n";
+    print "constructs that are *incompatible* with the 1.2 design\n";
+    print "into ones that are *compatible*\n";
+    print "Do you wish to issue this command [y/N]? ";
+    $ctu = <STDIN>;
+    if ($ctu =~ /^y\n/i) {
+        `./ri_once.pl ../plugins`;
+    }
+}
+
 ################# FOLDERS ###################
 
 # default_folder_prefix
@@ -1338,6 +1366,43 @@ sub command36 {
    return "false";
 }
 
+sub command37 {
+   print "";
+   print "\n";
+   
+   if ($default_use_priority eq "true") {
+      $default_value = "y";
+   } else {
+      $default_value = "n";
+   }
+   
+   print "Allow users to specify priority of outgoing mail (y/n) [$WHT$default_value$NRM]: $WHT";
+      $new_show = <STDIN>;
+      if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
+         return "true";
+      }
+      return "false";
+}
+                                                        
+
+sub command38 {
+   print "";
+   print "\n";
+   
+   if ($default_hide_attribution eq "true") {
+      $default_value = "y";
+   } else {
+      $default_value = "n";
+   }
+   
+   print "Hide SM attributions (y/n) [$WHT$default_value$NRM]: $WHT";
+      $new_show = <STDIN>;
+      if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
+         return "true";
+      }
+      return "false";
+}
+
 
 sub command41 {
    print "\nNow we will define the themes that you wish to use.  If you have added\n";
@@ -1731,11 +1796,14 @@ sub save_data {
 
    print FILE "\tglobal \$default_charset, \$data_dir, \$attachment_dir;\n";
    print FILE "\tglobal \$default_left_size, \$force_username_lowercase;\n";
+   print FILE "\tglobal \$default_use_priority, \$hide_sm_attributions;\n";
    print FILE "\t\$default_charset          = \"$default_charset\";\n";
    print FILE "\t\$data_dir                 = \"$data_dir\";\n";
    print FILE "\t\$attachment_dir           = \"$attachment_dir\";\n";
    print FILE "\t\$default_left_size        =  $default_left_size;\n";
    print FILE "\t\$force_username_lowercase = $force_username_lowercase;\n";
+   print FILE "\t\$default_use_priority     = $default_use_priority;\n";
+   print FILE "\t\$hide_sm_attributions     = $hide_sm_attributions;\n";
 
    print FILE "\n";