$var = $line;
$var =~ s/=/EQUALS/;
- if ( $var =~ /^([a-z]|[A-Z])/ ) {
+ if ( $var =~ /^([a-z])/i ) {
@o = split ( /\s*EQUALS\s*/, $var );
if ( $o[0] eq "config_version" ) {
- $o[1] =~ s/[\n|\r]//g;
- $o[1] =~ s/[\'|\"];\s*$//;
+ $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);
$var = $line;
$var =~ s/=/EQUALS/;
- if ( $var =~ /^([a-z]|[A-Z])/ ) {
+ if ( $var =~ /^([a-z])/i ) {
@o = split ( /\s*EQUALS\s*/, $var );
if ( $o[0] eq "config_version" ) {
- $o[1] =~ s/[\n|\r]//g;
- $o[1] =~ s/[\'|\"];\s*$//;
+ $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);
$var = $line;
$var =~ s/=/EQUALS/;
- if ( $var =~ /^([a-z]|[A-Z])/ ) {
+ if ( $var =~ /^([a-z])/i ) {
@options = split ( /\s*EQUALS\s*/, $var );
- $options[1] =~ s/[\n|\r]//g;
- $options[1] =~ s/[\'|\"];\s*$//;
+ $options[1] =~ s/[\n\r]//g;
+ $options[1] =~ s/[\'\"];\s*$//;
$options[1] =~ s/;$//;
- $options[1] =~ s/^[\'|\"]//;
+ $options[1] =~ s/^[\'\"]//;
+ # de-escape escaped strings
+ $options[1] =~ s/\\'/'/g;
+ $options[1] =~ s/\\\\/\\/g;
- if ( $options[0] =~ /^theme\[[0-9]+\]\[['|"]PATH['|"]\]/ ) {
+ if ( $options[0] =~ /^theme\[[0-9]+\]\[['"]PATH['"]\]/ ) {
$sub = $options[0];
- $sub =~ s/\]\[['|"]PATH['|"]\]//;
+ $sub =~ s/\]\[['"]PATH['"]\]//;
$sub =~ s/.*\[//;
if ( -e "../themes" ) {
$options[1] =~ s/^\.\.\/config/\.\.\/themes/;
}
$theme_path[$sub] = &change_to_rel_path($options[1]);
- } elsif ( $options[0] =~ /^theme\[[0-9]+\]\[['|"]NAME['|"]\]/ ) {
+ } elsif ( $options[0] =~ /^theme\[[0-9]+\]\[['"]NAME['"]\]/ ) {
$sub = $options[0];
- $sub =~ s/\]\[['|"]NAME['|"]\]//;
+ $sub =~ s/\]\[['"]NAME['"]\]//;
$sub =~ s/.*\[//;
$theme_name[$sub] = $options[1];
} elsif ( $options[0] =~ /^plugins\[[0-9]+\]/ ) {
$continue = 1;
}
- if ( $tmp =~ /^\s*[\'|\"]host[\'|\"]/i ) {
- $tmp =~ s/^\s*[\'|\"]host[\'|\"]\s*=>\s*[\'|\"]//i;
- $tmp =~ s/[\'|\"],?\s*$//;
- $tmp =~ s/[\'|\"]\);\s*$//;
+ if ( $tmp =~ /^\s*[\'\"]host[\'\"]/i ) {
+ $tmp =~ s/^\s*[\'\"]host[\'\"]\s*=>\s*[\'\"]//i;
+ $tmp =~ s/[\'\"],?\s*$//;
+ $tmp =~ s/[\'\"]\);\s*$//;
$host = $tmp;
- } elsif ( $tmp =~ /^\s*[\'|\"]base[\'|\"]/i ) {
- $tmp =~ s/^\s*[\'|\"]base[\'|\"]\s*=>\s*[\'|\"]//i;
- $tmp =~ s/[\'|\"],?\s*$//;
- $tmp =~ s/[\'|\"]\);\s*$//;
+ } elsif ( $tmp =~ /^\s*[\'\"]base[\'\"]/i ) {
+ $tmp =~ s/^\s*[\'\"]base[\'\"]\s*=>\s*[\'\"]//i;
+ $tmp =~ s/[\'\"],?\s*$//;
+ $tmp =~ s/[\'\"]\);\s*$//;
$base = $tmp;
- } elsif ( $tmp =~ /^\s*[\'|\"]charset[\'|\"]/i ) {
- $tmp =~ s/^\s*[\'|\"]charset[\'|\"]\s*=>\s*[\'|\"]//i;
- $tmp =~ s/[\'|\"],?\s*$//;
- $tmp =~ s/[\'|\"]\);\s*$//;
+ } elsif ( $tmp =~ /^\s*[\'\"]charset[\'\"]/i ) {
+ $tmp =~ s/^\s*[\'\"]charset[\'\"]\s*=>\s*[\'\"]//i;
+ $tmp =~ s/[\'\"],?\s*$//;
+ $tmp =~ s/[\'\"]\);\s*$//;
$charset = $tmp;
- } elsif ( $tmp =~ /^\s*[\'|\"]port[\'|\"]/i ) {
- $tmp =~ s/^\s*[\'|\"]port[\'|\"]\s*=>\s*[\'|\"]?//i;
- $tmp =~ s/[\'|\"]?,?\s*$//;
- $tmp =~ s/[\'|\"]?\);\s*$//;
+ } elsif ( $tmp =~ /^\s*[\'\"]port[\'\"]/i ) {
+ $tmp =~ s/^\s*[\'\"]port[\'\"]\s*=>\s*[\'\"]?//i;
+ $tmp =~ s/[\'\"]?,?\s*$//;
+ $tmp =~ s/[\'\"]?\);\s*$//;
$port = $tmp;
- } elsif ( $tmp =~ /^\s*[\'|\"]maxrows[\'|\"]/i ) {
- $tmp =~ s/^\s*[\'|\"]maxrows[\'|\"]\s*=>\s*[\'|\"]?//i;
- $tmp =~ s/[\'|\"]?,?\s*$//;
- $tmp =~ s/[\'|\"]?\);\s*$//;
+ } elsif ( $tmp =~ /^\s*[\'\"]maxrows[\'\"]/i ) {
+ $tmp =~ s/^\s*[\'\"]maxrows[\'\"]\s*=>\s*[\'\"]?//i;
+ $tmp =~ s/[\'\"]?,?\s*$//;
+ $tmp =~ s/[\'\"]?\);\s*$//;
$maxrows = $tmp;
- } elsif ( $tmp =~ /^\s*[\'|\"]name[\'|\"]/i ) {
- $tmp =~ s/^\s*[\'|\"]name[\'|\"]\s*=>\s*[\'|\"]//i;
- $tmp =~ s/[\'|\"],?\s*$//;
- $tmp =~ s/[\'|\"]\);\s*$//;
+ } elsif ( $tmp =~ /^\s*[\'\"]name[\'\"]/i ) {
+ $tmp =~ s/^\s*[\'\"]name[\'\"]\s*=>\s*[\'\"]//i;
+ $tmp =~ s/[\'\"],?\s*$//;
+ $tmp =~ s/[\'\"]\);\s*$//;
$name = $tmp;
- } elsif ( $tmp =~ /^\s*[\'|\"]binddn[\'|\"]/i ) {
- $tmp =~ s/^\s*[\'|\"]binddn[\'|\"]\s*=>\s*[\'|\"]//i;
- $tmp =~ s/[\'|\"],?\s*$//;
- $tmp =~ s/[\'|\"]\);\s*$//;
+ } elsif ( $tmp =~ /^\s*[\'\"]binddn[\'\"]/i ) {
+ $tmp =~ s/^\s*[\'\"]binddn[\'\"]\s*=>\s*[\'\"]//i;
+ $tmp =~ s/[\'\"],?\s*$//;
+ $tmp =~ s/[\'\"]\);\s*$//;
$binddn = $tmp;
- } elsif ( $tmp =~ /^\s*[\'|\"]bindpw[\'|\"]/i ) {
- $tmp =~ s/^\s*[\'|\"]bindpw[\'|\"]\s*=>\s*[\'|\"]//i;
- $tmp =~ s/[\'|\"],?\s*$//;
- $tmp =~ s/[\'|\"]\);\s*$//;
+ } elsif ( $tmp =~ /^\s*[\'\"]bindpw[\'\"]/i ) {
+ $tmp =~ s/^\s*[\'\"]bindpw[\'\"]\s*=>\s*[\'\"]//i;
+ $tmp =~ s/[\'\"],?\s*$//;
+ $tmp =~ s/[\'\"]\);\s*$//;
$bindpw = $tmp;
- } elsif ( $tmp =~ /^\s*[\'|\"]protocol[\'|\"]/i ) {
- $tmp =~ s/^\s*[\'|\"]protocol[\'|\"]\s*=>\s*[\'|\"]?//i;
- $tmp =~ s/[\'|\"]?,?\s*$//;
- $tmp =~ s/[\'|\"]?\);\s*$//;
+ } elsif ( $tmp =~ /^\s*[\'\"]protocol[\'\"]/i ) {
+ $tmp =~ s/^\s*[\'\"]protocol[\'\"]\s*=>\s*[\'\"]?//i;
+ $tmp =~ s/[\'\"]?,?\s*$//;
+ $tmp =~ s/[\'\"]?\);\s*$//;
$protocol = $tmp;
}
}
$allow_server_sort = 'false' if ( !$allow_server_sort );
$no_list_for_subscribe = 'false' if ( !$no_list_for_subscribe );
$allow_charset_search = 'true' if ( !$allow_charset_search );
+$allow_advanced_search = 0 if ( !$allow_advanced_search) ;
$prefs_user_field = 'user' if ( !$prefs_user_field );
$prefs_key_field = 'prefkey' if ( !$prefs_key_field );
$prefs_val_field = 'prefval' if ( !$prefs_val_field );
$session_name = 'SQMSESSID' if ( !$session_name );
$show_alternative_names = 'false' if ( !$show_alternative_names );
$available_languages = 'all' if ( !$available_languages );
-$agresive_decoding = 'false' if ( !$agresive_decoding );
+$aggressive_decoding = 'false' if ( !$aggressive_decoding );
+$lossy_encoding = 'false' if ( !$lossy_encoding );
$advanced_tree = 'false' if ( !$advanced_tree );
$oldway = 'false' if ( !$oldway );
$use_icons = 'false' if ( !$use_icons );
print "10. Allow server thread sort : $WHT$allow_thread_sort$NRM\n";
print "11. Allow server-side sorting : $WHT$allow_server_sort$NRM\n";
print "12. Allow server charset search : $WHT$allow_charset_search$NRM\n";
- print "13. PHP session name : $WHT$session_name$NRM\n";
+ print "13. Allow advanced search : $WHT$allow_advanced_search$NRM\n";
+ print "14. PHP session name : $WHT$session_name$NRM\n";
print "\n";
print "R Return to Main Menu\n";
} elsif ( $menu == 5 ) {
print "2. Default Charset : $WHT$default_charset$NRM\n";
print "3. Show alternative language names : $WHT$show_alternative_names$NRM\n";
print "4. Available languages : $WHT$available_languages$NRM\n";
- print "5. Use agresive decoding : $WHT$agresive_decoding$NRM\n";
+ print "5. Enable aggressive decoding : $WHT$aggressive_decoding$NRM\n";
+ print "6. Enable lossy encoding : $WHT$lossy_encoding$NRM\n";
print "\n";
print "R Return to Main Menu\n";
} elsif ( $menu == 11 ) {
print "R Return to Main Menu\n";
}
if ( $config_use_color == 1 ) {
- print "C. Turn color off\n";
+ print "C Turn color off\n";
} else {
- print "C. Turn color on\n";
+ print "C Turn color on\n";
}
print "S Save data\n";
print "Q Quit\n";
print "\n";
print "Command >> " . $WHT;
$command = <STDIN>;
- $command =~ s/[\n|\r]//g;
+ $command =~ s/[\n\r]//g;
$command =~ tr/A-Z/a-z/;
print "$NRM\n";
elsif ( $command == 10 ) { $allow_thread_sort = command312(); }
elsif ( $command == 11 ) { $allow_server_sort = command313(); }
elsif ( $command == 12 ) { $allow_charset_search = command314(); }
- elsif ( $command == 13 ) { $session_name = command316(); }
+ elsif ( $command == 13 ) { $allow_advanced_search = command316(); }
+ elsif ( $command == 14 ) { $session_name = command317(); }
} elsif ( $menu == 5 ) {
if ( $command == 1 ) { command41(); }
elsif ( $command == 2 ) { $theme_css = command42(); }
elsif ( $command == 2 ) { $default_charset = commandA2(); }
elsif ( $command == 3 ) { $show_alternative_names = commandA3(); }
elsif ( $command == 4 ) { $available_languages = commandA4(); }
- elsif ( $command == 5 ) { $agresive_decoding = commandA5(); }
+ elsif ( $command == 5 ) { $aggressive_decoding = commandA5(); }
+ elsif ( $command == 6 ) { $lossy_encoding = commandA6(); }
} elsif ( $menu == 11 ) {
if ( $command == 1 ) { $advanced_tree = commandB1(); }
elsif ( $command == 2 ) { $oldway = commandB2(); }
if ( $new_org_name eq "\n" ) {
$new_org_name = $org_name;
} else {
- $new_org_name =~ s/[\r|\n]//g;
+ $new_org_name =~ s/[\r\n]//g;
$new_org_name =~ s/\"/"/g;
}
return $new_org_name;
if ( $new_org_logo eq "\n" ) {
$new_org_logo = $org_logo;
} else {
- $new_org_logo =~ s/[\r|\n]//g;
+ $new_org_logo =~ s/[\r\n]//g;
}
return $new_org_logo;
}
if ( $new_org_title eq "\n" ) {
$new_org_title = $org_title;
} else {
- $new_org_title =~ s/[\r|\n]//g;
+ $new_org_title =~ s/[\r\n]//g;
$new_org_title =~ s/\"/\'/g;
}
return $new_org_title;
if ( $new_signout_page eq "\n" ) {
$new_signout_page = $signout_page;
} else {
- $new_signout_page =~ s/[\r|\n]//g;
+ $new_signout_page =~ s/[\r\n]//g;
$new_signout_page =~ s/^\s+$//g;
}
return $new_signout_page;
if ( $new_frame_top eq "\n" ) {
$new_frame_top = '_top';
} else {
- $new_frame_top =~ s/[\r|\n]//g;
+ $new_frame_top =~ s/[\r\n]//g;
$new_frame_top =~ s/^\s+$//g;
}
return $new_frame_top;
if ( $new_provider_uri eq "\n" ) {
$new_provider_uri = 'http://www.squirrelmail.org/';
} else {
- $new_provider_uri =~ s/[\r|\n]//g;
+ $new_provider_uri =~ s/[\r\n]//g;
$new_provider_uri =~ s/^\s+$//g;
}
return $new_provider_uri;
if ( $new_provider_name eq "\n" ) {
$new_provider_name = 'SquirrelMail';
} else {
- $new_provider_name =~ s/[\r|\n]//g;
+ $new_provider_name =~ s/[\r\n]//g;
$new_provider_name =~ s/^\s+$//g;
}
return $new_provider_name;
if ( $new_domain eq "\n" ) {
$new_domain = $domain;
} else {
- $new_domain =~ s/[\r|\n]//g;
+ $new_domain =~ s/[\r\n]//g;
}
return $new_domain;
}
if ( $new_imapServerAddress eq "\n" ) {
$new_imapServerAddress = $imapServerAddress;
} else {
- $new_imapServerAddress =~ s/[\r|\n]//g;
+ $new_imapServerAddress =~ s/[\r\n]//g;
}
return $new_imapServerAddress;
}
if ( $new_imapPort eq "\n" ) {
$new_imapPort = $imapPort;
} else {
- $new_imapPort =~ s/[\r|\n]//g;
+ $new_imapPort =~ s/[\r\n]//g;
}
return $new_imapPort;
}
if ( $new_sendmail_path eq "\n" ) {
$new_sendmail_path = $sendmail_path;
} else {
- $new_sendmail_path =~ s/[\r|\n]//g;
+ $new_sendmail_path =~ s/[\r\n]//g;
}
return $new_sendmail_path;
}
if ( $new_smtpServerAddress eq "\n" ) {
$new_smtpServerAddress = $smtpServerAddress;
} else {
- $new_smtpServerAddress =~ s/[\r|\n]//g;
+ $new_smtpServerAddress =~ s/[\r\n]//g;
}
return $new_smtpServerAddress;
}
if ( $new_smtpPort eq "\n" ) {
$new_smtpPort = $smtpPort;
} else {
- $new_smtpPort =~ s/[\r|\n]//g;
+ $new_smtpPort =~ s/[\r\n]//g;
}
return $new_smtpPort;
}
if ( $new_imap_server_type eq "\n" ) {
$new_imap_server_type = $imap_server_type;
} else {
- $new_imap_server_type =~ s/[\r|\n]//g;
+ $new_imap_server_type =~ s/[\r\n]//g;
}
return $new_imap_server_type;
}
if ( $new_optional_delimiter eq "\n" ) {
$new_optional_delimiter = $optional_delimiter;
} else {
- $new_optional_delimiter =~ s/[\r|\n]//g;
+ $new_optional_delimiter =~ s/[\r\n]//g;
}
return $new_optional_delimiter;
}
do {
print "] ";
$line = <STDIN>;
- $line =~ s/[\r|\n]//g;
+ $line =~ s/[\r\n]//g;
if ( $line ne "@" ) {
$line =~ s/ /\ \ /g;
$line =~ s/\t/\ \ \ \ /g;
################# PLUGINS ###################
sub command81 {
- $command =~ s/[\s|\n|\r]*//g;
+ $command =~ s/[\s\n\r]*//g;
if ( $command > 0 ) {
$command = $command - 1;
if ( $command <= $#plugins ) {
if ( $new_trash_folder eq "\n" ) {
$new_trash_folder = $trash_folder;
} else {
- $new_trash_folder =~ s/[\r|\n]//g;
+ $new_trash_folder =~ s/[\r\n]//g;
}
return $new_trash_folder;
}
if ( $new_sent_folder eq "\n" ) {
$new_sent_folder = $sent_folder;
} else {
- $new_sent_folder =~ s/[\r|\n]//g;
+ $new_sent_folder =~ s/[\r\n]//g;
}
return $new_sent_folder;
}
if ( $new_draft_folder eq "\n" ) {
$new_draft_folder = $draft_folder;
} else {
- $new_draft_folder =~ s/[\r|\n]//g;
+ $new_draft_folder =~ s/[\r\n]//g;
}
return $new_draft_folder;
}
print "Which one should be default (1,2,3)? [$WHT$default_unseen_notify$NRM]: $WHT";
$new_show = <STDIN>;
- if ( $new_show =~ /^[1|2|3]\n/i ) {
+ if ( $new_show =~ /^[123]\n/i ) {
$default_unseen_notify = $new_show;
}
- $default_unseen_notify =~ s/[\r|\n]//g;
+ $default_unseen_notify =~ s/[\r\n]//g;
return $default_unseen_notify;
}
print "Which one should be default (1,2)? [$WHT$default_unseen_type$NRM]: $WHT";
$new_show = <STDIN>;
- if ( $new_show =~ /^[1|2]\n/i ) {
+ if ( $new_show =~ /^[12]\n/i ) {
$default_unseen_type = $new_show;
}
- $default_unseen_type =~ s/[\r|\n]//g;
+ $default_unseen_type =~ s/[\r\n]//g;
return $default_unseen_type;
}
if ( $new_data_dir eq "\n" ) {
$new_data_dir = $data_dir;
} else {
- $new_data_dir =~ s/[\r|\n]//g;
+ $new_data_dir =~ s/[\r\n]//g;
}
if ( $new_data_dir =~ /^\s*$/ ) {
$new_data_dir = "";
if ( $new_attachment_dir eq "\n" ) {
$new_attachment_dir = $attachment_dir;
} else {
- $new_attachment_dir =~ s/[\r|\n]//g;
+ $new_attachment_dir =~ s/[\r\n]//g;
}
if ( $new_attachment_dir =~ /^\s*$/ ) {
$new_attachment_dir = "";
if ( $new_dir_hash_level eq "\n" ) {
$new_dir_hash_level = $dir_hash_level;
} else {
- $new_dir_hash_level =~ s/[\r|\n]//g;
+ $new_dir_hash_level =~ s/[\r\n]//g;
}
if ( ( int($new_dir_hash_level) < 0 )
|| ( int($new_dir_hash_level) > 4 )
if ( $new_default_left_size eq "\n" ) {
$new_default_left_size = $default_left_size;
} else {
- $new_default_left_size =~ s/[\r|\n]//g;
+ $new_default_left_size =~ s/[\r\n]//g;
}
return $new_default_left_size;
}
# command315 (UID support) obsoleted.
+# advanced search option
sub command316 {
+ print "This option allows you to control the use of advanced search form.\n";
+ print " 0 = enable basic search only\n";
+ print " 1 = enable advanced search only\n";
+ print " 2 = enable both\n";
+ print "\n";
+
+ print "Allowed search (0,1,2)? [$WHT$allow_advanced_search$NRM]: $WHT";
+ $new_allow_advanced_search = <STDIN>;
+ if ( $new_allow_advanced_search =~ /^[012]\n/i ) {
+ $allow_advanced_search = $new_allow_advanced_search;
+ }
+ $allow_advanced_search =~ s/[\r\n]//g;
+ return $allow_advanced_search;
+}
+
+
+sub command317 {
print "This option allows you to change the name of the PHP session used\n";
print "by SquirrelMail. Unless you know what you are doing, you probably\n";
print "don't need or want to change this from the default of SQMSESSID.\n";
print "them. You can also change the default theme.\n";
print "[theme] command (?=help) > ";
$input = <STDIN>;
- $input =~ s/[\r|\n]//g;
+ $input =~ s/[\r\n]//g;
while ( $input ne "d" ) {
if ( $input =~ /^\s*l\s*/i ) {
$count = 0;
} elsif ( $input =~ /^\s*\+/ ) {
print "What is the name of this theme: ";
$name = <STDIN>;
- $name =~ s/[\r|\n]//g;
+ $name =~ s/[\r\n]//g;
$theme_name[ $#theme_name + 1 ] = $name;
print "Be sure to put ../themes/ before the filename.\n";
print "What file is this stored in (ex: ../themes/default_theme.php): ";
$name = <STDIN>;
- $name =~ s/[\r|\n]//g;
+ $name =~ s/[\r\n]//g;
$theme_path[ $#theme_path + 1 ] = $name;
} elsif ( $input =~ /^\s*-\s*[0-9]?/ ) {
if ( $input =~ /[0-9]+\s*$/ ) {
print "** Found theme: $filename\n";
print " What is its name? ";
$nm = <STDIN>;
- $nm =~ s/[\n|\r]//g;
+ $nm =~ s/[\n\r]//g;
$theme_name[ $#theme_name + 1 ] = $nm;
$theme_path[ $#theme_path + 1 ] = $filename;
}
}
print "[theme] command (?=help) > ";
$input = <STDIN>;
- $input =~ s/[\r|\n]//g;
+ $input =~ s/[\r\n]//g;
}
}
if ( $new_theme_css eq "\n" ) {
$new_theme_css = $theme_css;
} else {
- $new_theme_css =~ s/[\r|\n]//g;
+ $new_theme_css =~ s/[\r\n]//g;
}
$new_theme_css =~ s/^\s*//;
return $new_theme_css;
print "You can now define different LDAP servers.\n";
print "[ldap] command (?=help) > ";
$input = <STDIN>;
- $input =~ s/[\r|\n]//g;
+ $input =~ s/[\r\n]//g;
while ( $input ne "d" ) {
if ( $input =~ /^\s*l\s*/i ) {
$count = 0;
print "this LDAP server resides. Example: ldap.bigfoot.com\n";
print "hostname: ";
$name = <STDIN>;
- $name =~ s/[\r|\n]//g;
+ $name =~ s/[\r\n]//g;
$ldap_host[$sub] = $name;
print "\n";
print "Example: ou=member_directory,o=netcenter.com\n";
print "base: ";
$name = <STDIN>;
- $name =~ s/[\r|\n]//g;
+ $name =~ s/[\r\n]//g;
$ldap_base[$sub] = $name;
print "\n";
print "port is 389. This is optional. Press ENTER for default.\n";
print "port: ";
$name = <STDIN>;
- $name =~ s/[\r|\n]//g;
+ $name =~ s/[\r\n]//g;
$ldap_port[$sub] = $name;
print "\n";
print "is also optional. Press ENTER for default.\n";
print "charset: ";
$name = <STDIN>;
- $name =~ s/[\r|\n]//g;
+ $name =~ s/[\r\n]//g;
$ldap_charset[$sub] = $name;
print "\n";
print "the search. Default it \"LDAP: hostname\". Press ENTER for default\n";
print "name: ";
$name = <STDIN>;
- $name =~ s/[\r|\n]//g;
+ $name =~ s/[\r\n]//g;
$ldap_name[$sub] = $name;
print "\n";
print "Default is unlimited. Press ENTER for default.\n";
print "maxrows: ";
$name = <STDIN>;
- $name =~ s/[\r|\n]//g;
+ $name =~ s/[\r\n]//g;
$ldap_maxrows[$sub] = $name;
print "\n";
print "Default is none, anonymous bind. Press ENTER for default.\n";
print "binddn: ";
$name = <STDIN>;
- $name =~ s/[\r|\n]//g;
+ $name =~ s/[\r\n]//g;
$ldap_binddn[$sub] = $name;
print "\n";
print "Now, please specify password for that DN.\n";
print "bindpw: ";
$name = <STDIN>;
- $name =~ s/[\r|\n]//g;
+ $name =~ s/[\r\n]//g;
$ldap_bindpw[$sub] = $name;
print "\n";
print "Press ENTER for default.\n";
print "protocol: ";
$name = <STDIN>;
- $name =~ s/[\r|\n]//g;
+ $name =~ s/[\r\n]//g;
$ldap_protocol[$sub] = $name;
print "\n";
}
print "[ldap] command (?=help) > ";
$input = <STDIN>;
- $input =~ s/[\r|\n]//g;
+ $input =~ s/[\r\n]//g;
}
}
if ( $new_dsn eq "\n" ) {
$new_dsn = "";
} else {
- $new_dsn =~ s/[\r|\n]//g;
+ $new_dsn =~ s/[\r\n]//g;
$new_dsn =~ s/^\s+$//g;
}
return $new_dsn;
if ( $new_table eq "\n" ) {
$new_table = $addrbook_table;
} else {
- $new_table =~ s/[\r|\n]//g;
+ $new_table =~ s/[\r\n]//g;
}
return $new_table;
}
if ( $new_dsn eq "\n" ) {
$new_dsn = "";
} else {
- $new_dsn =~ s/[\r|\n]//g;
+ $new_dsn =~ s/[\r\n]//g;
$new_dsn =~ s/^\s+$//g;
}
return $new_dsn;
if ( $new_table eq "\n" ) {
$new_table = $prefs_table;
} else {
- $new_table =~ s/[\r|\n]//g;
+ $new_table =~ s/[\r\n]//g;
}
return $new_table;
}
if ( $new_field eq "\n" ) {
$new_field = $prefs_user_field;
} else {
- $new_field =~ s/[\r|\n]//g;
+ $new_field =~ s/[\r\n]//g;
}
return $new_field;
}
if ( $new_field eq "\n" ) {
$new_field = $prefs_key_field;
} else {
- $new_field =~ s/[\r|\n]//g;
+ $new_field =~ s/[\r\n]//g;
}
return $new_field;
}
if ( $new_field eq "\n" ) {
$new_field = $prefs_val_field;
} else {
- $new_field =~ s/[\r|\n]//g;
+ $new_field =~ s/[\r\n]//g;
}
return $new_field;
}
if ( $new_dsn eq "\n" ) {
$new_dsn = "";
} else {
- $new_dsn =~ s/[\r|\n]//g;
+ $new_dsn =~ s/[\r\n]//g;
$new_dsn =~ s/^\s+$//g;
}
return $new_dsn;
if ( $new_table eq "\n" ) {
$new_table = $addrbook_global_table;
} else {
- $new_table =~ s/[\r|\n]//g;
+ $new_table =~ s/[\r\n]//g;
}
return $new_table;
}
if ( $new_squirrelmail_default_language eq "\n" ) {
$new_squirrelmail_default_language = $squirrelmail_default_language;
} else {
- $new_squirrelmail_default_language =~ s/[\r|\n]//g;
+ $new_squirrelmail_default_language =~ s/[\r\n]//g;
$new_squirrelmail_default_language =~ s/^\s+$//g;
}
return $new_squirrelmail_default_language;
}
# Default Charset
sub commandA2 {
-# print "This option controls what character set is used when sending\n";
-# print "mail and when sending HTML to the browser. Do not set this\n";
-# print "to US-ASCII, use ISO-8859-1 instead. For cyrillic, it is best\n";
-# print "to use KOI8-R, since this implementation is faster than most\n";
-# print "of the alternatives\n";
- print "This option is obsolate. Default charset depends on language\n";
- print "you have selected in \"Default language\" option.\n";
+ print "This option controls what character set is used when sending\n";
+ print "mail and when sending HTML to the browser. Option works only\n";
+ print "with US English (en_US) translation. Other translations use\n";
+ print "charsets that are set in functions/i18n.php.\n";
print "\n";
print "[$WHT$default_charset$NRM]: $WHT";
if ( $new_default_charset eq "\n" ) {
$new_default_charset = $default_charset;
} else {
- $new_default_charset =~ s/[\r|\n]//g;
+ $new_default_charset =~ s/[\r\n]//g;
}
return $new_default_charset;
}
print "listed. If you enter special key \'none\' - user won't be able to change";
print "language and interface will use language set it \"Default language\" option.\n";
print "\n";
- print "Valid language names are:\n";
- print " ar (Arabic), bg_BG (Bulgarian), ca_ES (Catalan), cy_GB (Welsh)\n";
- print " cs_CZ (Chech), da_DK (Danish), de_DE (German), el_GR (Greek),\n";
- print " en_US (English), es_ES (Spanish), et_EE (Estonian), fi_FI (Finnish),\n";
- print " fo_FO (Faroese), fr_FR (French), he_IL (Hebrew), hr_HR (Croatian),\n";
- print " hu_HU (Hungarian), id_ID (Indonesian), is_IS (Icelandic), it_IT (Italian),\n";
- print " ja_JP (Japanese), ko_KR (Korean), lt_LT (Lithuanian), ms_MY (Malay),\n";
- print " nl_NL (Dutch), nn_NO (Norwegian (Nynorsk)), no_NO (Norwegian (Bokmal)),\n";
- print " pl_PL (Polish), pt_BR (Portuguese (Brazil)), pt_PT (Portuguese (Portugal)),\n";
- print " ro_RO (Romanian), ru_RU (Russian), sk_SK (Slovak), sl_SI (Slovenian),\n";
- print " sr_YU (Serbian), sv_SE (Swedish), th_TH (Thai), tr_TR (Turkish),\n";
- print " zh_CN (Chinese Simplified), zh_TW (Chinese Traditional).\n";
+ print "You can find valid language names in doc/i18n.txt.\n";
print "\n";
print "[$WHT$available_languages$NRM]: $WHT";
$new_available_languages = <STDIN>;
if ( $new_available_languages eq "\n" ) {
$new_available_languages = $available_languages;
} else {
- $new_available_languages =~ s/[\r|\n]//g;
+ $new_available_languages =~ s/[\r\n]//g;
$new_available_languages =~ s/^\s+$//g;
}
return $new_available_languages;
}
-# Agresive decoding
+# Aggressive decoding
sub commandA5 {
print "Enable this option if you want to use CPU and memory intensive decoding\n";
print "functions. This option allows reading multibyte charset, that are used\n";
print "even when you have disabled use of recode in Tweaks section.\n";
print "\n";
- if ( lc($agresive_decoding) eq 'true' ) {
+ if ( lc($aggressive_decoding) eq 'true' ) {
$default_value = "y";
} else {
$default_value = "n";
}
- print "Use agresive decoding? (y/n) [$WHT$default_value$NRM]: $WHT";
- $agresive_decoding = <STDIN>;
- if ( ( $agresive_decoding =~ /^y\n/i ) || ( ( $agresive_decoding =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
- $agresive_decoding = 'true';
+ print "Enable aggressive decoding? (y/n) [$WHT$default_value$NRM]: $WHT";
+ $aggressive_decoding = <STDIN>;
+ if ( ( $aggressive_decoding =~ /^y\n/i ) || ( ( $aggressive_decoding =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
+ $aggressive_decoding = 'true';
} else {
- $agresive_decoding = 'false';
+ $aggressive_decoding = 'false';
}
- return $agresive_decoding;
+ return $aggressive_decoding;
}
+# Lossy encoding
+sub commandA6 {
+ print "Enable this option if you want to allow lossy charset encoding in message\n";
+ print "composition pages. This option allows charset conversions when output\n";
+ print "charset does not support all symbols used in original charset. Symbols\n";
+ print "unsupported by output charset will be replaced with question marks.\n";
+ print "\n";
+
+ if ( lc($lossy_encoding) eq 'true' ) {
+ $default_value = "y";
+ } else {
+ $default_value = "n";
+ }
+ print "Enable lossy encoding? (y/n) [$WHT$default_value$NRM]: $WHT";
+ $lossy_encoding = <STDIN>;
+ if ( ( $lossy_encoding =~ /^y\n/i ) || ( ( $lossy_encoding =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
+ $lossy_encoding = 'true';
+ } else {
+ $lossy_encoding = 'false';
+ }
+ return $lossy_encoding;
+}
+
+
# Advanced tree
sub commandB1 {
print "Enable this option if you want to use DHTML based folder listing.\n";
# string
print CF "\$available_languages = '$available_languages';\n";
# boolean
- print CF "\$agresive_decoding = $agresive_decoding;\n";
+ print CF "\$aggressive_decoding = $aggressive_decoding;\n";
+ # boolean
+ print CF "\$lossy_encoding = $lossy_encoding;\n";
print CF "\n";
# string
print CF "\$allow_thread_sort = $allow_thread_sort;\n";
# boolean
print CF "\$allow_server_sort = $allow_server_sort;\n";
- # boolean
+ # boolean
print CF "\$allow_charset_search = $allow_charset_search;\n";
+ # integer
+ print CF "\$allow_advanced_search = $allow_advanced_search;\n";
print CF "\n";
# all plugins are strings
for ( $count = 0 ; $count <= $#theme_name ; $count++ ) {
print CF "\$theme[$count]['PATH'] = " . &change_to_SM_path($theme_path[$count]) . ";\n";
- print CF "\$theme[$count]['NAME'] = '$theme_name[$count]';\n";
+ # escape theme name so it can contain single quotes.
+ $esc_name = $theme_name[$count];
+ $esc_name =~ s/\\/\\\\/g;
+ $esc_name =~ s/'/\\'/g;
+ print CF "\$theme[$count]['NAME'] = '$esc_name';\n";
}
print CF "\n";
print " quit = Do not change anything\n";
print "Command >> ";
$server = <STDIN>;
- $server =~ s/[\r|\n]//g;
+ $server =~ s/[\r\n]//g;
print "\n";
if ( $server eq "cyrus" ) {