Delete move next fix. Includes strings translation and move folders fix.
[squirrelmail.git] / config / conf.pl
CommitLineData
23afd0bd 1#!/usr/bin/env perl
bbd30ac8 2# conf.pl
8beafbbc 3# Luke Ehresman (luke@squirrelmail.org)
bbd30ac8 4#
5# A simple configure script to configure squirrelmail
245a6892 6#
7# $Id$
ccfb2029 8############################################################
a3439b27 9$conf_pl_version = "1.2.0";
bbd30ac8 10
38b69acb 11############################################################
12# Check what directory we're supposed to be running in, and
13# change there if necessary. File::Basename has been in
14# Perl since at least 5.003_7, and nobody sane runs anything
15# before that, but just in case.
16############################################################
17
18if (eval q{require "File/Basename.pm"}) {
19 my $dir = File::Basename::dirname($0);
20 chdir($dir);
21}
22
23
ccfb2029 24############################################################
d595e32e 25# Some people try to run this as a CGI. That's wrong!
26############################################################
27if(defined($ENV{'PATH_INFO'}) || defined($ENV{'QUERY_STRING'}) ||
28 defined($ENV{'REQUEST_METHOD'})) {
29 print "Content-Type: text/html\n\n";
30 print "You must run this script from the command line.";
31 exit;
32}
33
34############################################################
bbd30ac8 35# First, lets read in the data already in there...
ccfb2029 36############################################################
bbd30ac8 37if ( -e "config.php") {
4011c3ca 38 open (FILE, "config.php");
39 while ($line = <FILE>) {
a3439b27 40 $line =~ s/^\s+//;
41 $line =~ s/^\$//;
42 $var = $line;
4011c3ca 43
a3439b27 44 $var =~ s/=/EQUALS/;
45 if ($var =~ /^([a-z]|[A-Z])/) {
46 @o = split(/\s*EQUALS\s*/, $var);
47 if ($o[0] eq "config_version") {
48 $o[1] =~ s/[\n|\r]//g;
49 $o[1] =~ s/[\'|\"];\s*$//;
50 $o[1] =~ s/;$//;
51 $o[1] =~ s/^[\'|\"]//;
52
53 $config_version = $o[1];
54 close (FILE);
4011c3ca 55 }
56 }
57 }
58 close (FILE);
59
60 if ($config_version ne $conf_pl_version) {
61 system "clear";
62 print $WHT."WARNING:\n".$NRM;
a3439b27 63 print " The file \"config/config.php\" was found, but it is for\n";
64 print " an older version of SquirrelMail. It is possible to still\n";
65 print " read the defaults from this file but be warned that many\n";
66 print " preferences change between versions. It is recommended that\n";
67 print " you start with a clean config.php for each upgrade that you\n";
68 print " do. To do this, just move config/config.php out of the way.\n";
69 print "\n";
f0bc4d36 70 print "Continue loading with the old config.php [y/N]? ";
4011c3ca 71 $ctu = <STDIN>;
f0bc4d36 72 if (($ctu !~ /^y\n/i) || ($ctu =~ /^\n/)) {
4011c3ca 73 exit;
74 }
75
f0bc4d36 76 print "\nDo you want me to stop warning you [y/N]? ";
4011c3ca 77 $ctu = <STDIN>;
78 if ($ctu =~ /^y\n/i) {
79 $print_config_version = $conf_pl_version;
80 } else {
81 $print_config_version = $config_version;
82 }
83 } else {
84 $print_config_version = $config_version;
85 }
86
a93b12ba 87 $config = 1;
ccfb2029 88 open (FILE, "config.php");
1e0628fb 89} elsif (-e "config_default.php") {
4011c3ca 90 open (FILE, "config_default.php");
91 while ($line = <FILE>) {
a3439b27 92 $line =~ s/^\s+//;
93 $line =~ s/^\$//;
94 $var = $line;
4011c3ca 95
a3439b27 96 $var =~ s/=/EQUALS/;
97 if ($var =~ /^([a-z]|[A-Z])/) {
98 @o = split(/\s*EQUALS\s*/, $var);
99 if ($o[0] eq "config_version") {
100 $o[1] =~ s/[\n|\r]//g;
101 $o[1] =~ s/[\'|\"];\s*$//;
102 $o[1] =~ s/;$//;
103 $o[1] =~ s/^[\'|\"]//;
104
105 $config_version = $o[1];
106 close (FILE);
4011c3ca 107 }
108 }
109 }
110 close (FILE);
111
112 if ($config_version ne $conf_pl_version) {
113 system "clear";
114 print $WHT."WARNING:\n".$NRM;
a3439b27 115 print " You are trying to use a 'config_default.php' from an older\n";
116 print " version of SquirrelMail. This is HIGHLY unrecommended. You\n";
117 print " should get the 'config_default.php' that matches the version\n";
118 print " of SquirrelMail that you are running. You can get this from\n";
119 print " the SquirrelMail web page by going to the following URL:\n";
120 print " http://www.squirrelmail.org.\n";
121 print "\n";
122 print "Continue loading with old config_default.php (a bad idea) [y/N]? ";
4011c3ca 123 $ctu = <STDIN>;
f0bc4d36 124 if (($ctu !~ /^y\n/i) || ($ctu =~ /^\n/)) {
4011c3ca 125 exit;
126 }
127
f0bc4d36 128 print "\nDo you want me to stop warning you [y/N]? ";
4011c3ca 129 $ctu = <STDIN>;
130 if ($ctu =~ /^y\n/i) {
131 $print_config_version = $conf_pl_version;
132 } else {
133 $print_config_version = $config_version;
134 }
135 } else {
136 $print_config_version = $config_version;
137 }
a93b12ba 138 $config = 2;
ccfb2029 139 open (FILE, "config_default.php");
1e0628fb 140} else {
a3439b27 141 print "No configuration file found. Please get config_default.php\n";
142 print "or config.php before running this again. This program needs\n";
143 print "a default config file to get default values.\n";
a93b12ba 144 exit;
bbd30ac8 145}
146
a3439b27 147# Read and parse the current configuration file
148# (either config.php or config_default.php).
bbd30ac8 149while ($line = <FILE>) {
a3439b27 150 $line =~ s/^\s+//;
151 $line =~ s/^\$//;
152 $var = $line;
ccfb2029 153
a3439b27 154 $var =~ s/=/EQUALS/;
155 if ($var =~ /^([a-z]|[A-Z])/) {
156 @options = split(/\s*EQUALS\s*/, $var);
157 $options[1] =~ s/[\n|\r]//g;
158 $options[1] =~ s/[\'|\"];\s*$//;
159 $options[1] =~ s/;$//;
160 $options[1] =~ s/^[\'|\"]//;
161
162 if ($options[0] =~ /^theme\[[0-9]+\]\[['|"]PATH['|"]\]/) {
163 $sub = $options[0];
164 $sub =~ s/\]\[['|"]PATH['|"]\]//;
165 $sub =~ s/.*\[//;
166 if (-e "../themes") {
167 $options[1] =~ s/^\.\.\/config/\.\.\/themes/;
ccfb2029 168 }
a3439b27 169 $theme_path[$sub] = $options[1];
170 } elsif ($options[0] =~ /^theme\[[0-9]+\]\[['|"]NAME['|"]\]/) {
171 $sub = $options[0];
172 $sub =~ s/\]\[['|"]NAME['|"]\]//;
173 $sub =~ s/.*\[//;
174 $theme_name[$sub] = $options[1];
175 } elsif ($options[0] =~ /^plugins\[[0-9]+\]/) {
176 $sub = $options[0];
177 $sub =~ s/\]//;
178 $sub =~ s/^plugins\[//;
179 $plugins[$sub] = $options[1];
180 } elsif ($options[0] =~ /^ldap_server\[[0-9]+\]/) {
181 $sub = $options[0];
182 $sub =~ s/\]//;
183 $sub =~ s/^ldap_server\[//;
184 $continue = 0;
185 while (($tmp = <FILE>) && ($continue != 1)) {
186 if ($tmp =~ /\);\s*$/) {
187 $continue = 1;
188 }
189
190 if ($tmp =~ /^\s*[\'|\"]host[\'|\"]/i) {
191 $tmp =~ s/^\s*[\'|\"]host[\'|\"]\s*=>\s*[\'|\"]//i;
192 $tmp =~ s/[\'|\"],?\s*$//;
193 $tmp =~ s/[\'|\"]\);\s*$//;
194 $host = $tmp;
195 } elsif ($tmp =~ /^\s*[\'|\"]base[\'|\"]/i) {
196 $tmp =~ s/^\s*[\'|\"]base[\'|\"]\s*=>\s*[\'|\"]//i;
197 $tmp =~ s/[\'|\"],?\s*$//;
198 $tmp =~ s/[\'|\"]\);\s*$//;
199 $base = $tmp;
200 } elsif ($tmp =~ /^\s*[\'|\"]charset[\'|\"]/i) {
201 $tmp =~ s/^\s*[\'|\"]charset[\'|\"]\s*=>\s*[\'|\"]//i;
202 $tmp =~ s/[\'|\"],?\s*$//;
203 $tmp =~ s/[\'|\"]\);\s*$//;
204 $charset = $tmp;
205 } elsif ($tmp =~ /^\s*[\'|\"]port[\'|\"]/i) {
206 $tmp =~ s/^\s*[\'|\"]port[\'|\"]\s*=>\s*[\'|\"]//i;
207 $tmp =~ s/[\'|\"],?\s*$//;
208 $tmp =~ s/[\'|\"]\);\s*$//;
209 $port = $tmp;
210 } elsif ($tmp =~ /^\s*[\'|\"]maxrows[\'|\"]/i) {
211 $tmp =~ s/^\s*[\'|\"]maxrows[\'|\"]\s*=>\s*[\'|\"]//i;
212 $tmp =~ s/[\'|\"],?\s*$//;
213 $tmp =~ s/[\'|\"]\);\s*$//;
214 $maxrows = $tmp;
215 } elsif ($tmp =~ /^\s*[\'|\"]name[\'|\"]/i) {
216 $tmp =~ s/^\s*[\'|\"]name[\'|\"]\s*=>\s*[\'|\"]//i;
217 $tmp =~ s/[\'|\"],?\s*$//;
218 $tmp =~ s/[\'|\"]\);\s*$//;
219 $name = $tmp;
220 }
221 }
222 $ldap_host[$sub] = $host;
223 $ldap_base[$sub] = $base;
224 $ldap_name[$sub] = $name;
225 $ldap_port[$sub] = $port;
226 $ldap_maxrows[$sub] = $maxrows;
227 $ldap_charset[$sub] = $charset;
228 } else {
229 ${$options[0]} = $options[1];
ccfb2029 230 }
a3439b27 231 }
bbd30ac8 232}
1a7a2fcc 233close FILE;
828b4753 234if ($useSendmail ne "true") {
ccfb2029 235 $useSendmail = "false";
828b4753 236}
237if (!$sendmail_path) {
ccfb2029 238 $sendmail_path = "/usr/sbin/sendmail";
828b4753 239}
24fc5dd2 240if (!$default_unseen_notify) {
241 $default_unseen_notify = 2;
242}
243if (!$default_unseen_type) {
244 $default_unseen_type = 1;
245}
0ecb47e5 246if (!$config_use_color) {
a15af05b 247 $config_use_color = 0;
0ecb47e5 248}
a1f1f9bc 249if (!$invert_time) {
250 $invert_time = "false";
251}
23a8095f 252if (!$force_username_lowercase) {
a3439b27 253 $force_username_lowercase = "false";
23a8095f 254}
40ba4d36 255if (!$optional_delimiter) {
a3439b27 256 $optional_delimiter = "detect";
40ba4d36 257}
d2f4c914 258if (!$use_authenticated_smtp) {
259 $use_authenticated_smtp = "false";
260}
f7bfc9de 261if (!$auto_create_special) {
a3439b27 262 $auto_create_special = "false";
f7bfc9de 263}
0d15cd19 264if(!$default_use_priority) {
a3439b27 265 $default_use_priority = "true";
0d15cd19 266}
826b7f71 267if(!$hide_sm_attributions) {
a3439b27 268 $hide_sm_attributions = "false";
826b7f71 269}
8c21da0c 270if(!$default_use_mdn) {
271 $default_use_mdn = "true";
272}
3d043efc 273if(!$frame_top) {
274 $frame_top = "_top";
275}
8a7d0669 276if(!$edit_identity) {
277 $edit_identity = "true";
278}
279if(!$edit_name) {
280 $edit_name = "true";
281}
bbd30ac8 282
ebd13f55 283if ($ARGV[0] eq '--install-plugin') {
284 print "Activating plugin " . $ARGV[1]
285 . "\n";
286 push @plugins, $ARGV[1];
287 save_data();
288 exit(0);
289}
290elsif ($ARGV[0] eq '--remove-plugin') {
291 print "Removing plugin " . $ARGV[1]
292 . "\n";
293 foreach $plugin (@plugins) {
294 if ($plugin ne $ARGV[1]) {
295 push @newplugins, $plugin;
296 }
297 }
298 @plugins = @newplugins;
299 save_data();
300 exit(0);
301}
302
303
5b6ae78a 304#####################################################################################
0ecb47e5 305if ($config_use_color == 1) {
306 $WHT = "\x1B[37;1m";
307 $NRM = "\x1B[0m";
308} else {
309 $WHT = "";
310 $NRM = "";
311 $config_use_color = 2;
312}
5b6ae78a 313
828b4753 314while (($command ne "q") && ($command ne "Q")) {
ccfb2029 315 system "clear";
612eda0a 316 print $WHT."SquirrelMail Configuration : ".$NRM;
317 if ($config == 1) { print "Read: config.php"; }
318 elsif ($config == 2) { print "Read: config_default.php"; }
a3439b27 319 print " ($print_config_version)\n";
612eda0a 320 print "---------------------------------------------------------\n";
1e0628fb 321
612eda0a 322 if ($menu == 0) {
ccfb2029 323 print $WHT."Main Menu --\n".$NRM;
324 print "1. Organization Preferences\n";
325 print "2. Server Settings\n";
326 print "3. Folder Defaults\n";
327 print "4. General Options\n";
328 print "5. Themes\n";
329 print "6. Address Books (LDAP)\n";
330 print "7. Message of the Day (MOTD)\n";
9d0c7bee 331 print "8. Plugins\n";
497203d4 332 print "9. Database\n";
ccfb2029 333 print "\n";
a93b12ba 334 print "D. Set pre-defined settings for specific IMAP servers\n";
335 print "\n";
ccfb2029 336 } elsif ($menu == 1) {
337 print $WHT."Organization Preferences\n".$NRM;
338 print "1. Organization Name : $WHT$org_name$NRM\n";
339 print "2. Organization Logo : $WHT$org_logo$NRM\n";
340 print "3. Organization Title : $WHT$org_title$NRM\n";
f923b93d 341 print "4. Signout Page : $WHT$signout_page$NRM\n";
6ef7145f 342 print "5. Default Language : $WHT$squirrelmail_default_language$NRM\n";
80e86e94 343 print "6. Top Frame : $WHT$frame_top$NRM\n";
ccfb2029 344 print "\n";
345 print "R Return to Main Menu\n";
346 } elsif ($menu == 2) {
347 print $WHT."Server Settings\n".$NRM;
348 print "1. Domain : $WHT$domain$NRM\n";
349 print "2. IMAP Server : $WHT$imapServerAddress$NRM\n";
350 print "3. IMAP Port : $WHT$imapPort$NRM\n";
996d34de 351 print "4. Use Sendmail/SMTP : $WHT";
26301d64 352 if (lc($useSendmail) eq "true") {
996d34de 353 print "Sendmail";
354 } else {
355 print "SMTP";
356 }
357 print "$NRM\n";
26301d64 358 if (lc($useSendmail) eq "true") {
ccfb2029 359 print "5. Sendmail Path : $WHT$sendmail_path$NRM\n";
360 } else {
361 print "6. SMTP Server : $WHT$smtpServerAddress$NRM\n";
362 print "7. SMTP Port : $WHT$smtpPort$NRM\n";
d2f4c914 363 print "8. Authenticated SMTP : $WHT$use_authenticated_smtp$NRM\n";
ccfb2029 364 }
d2f4c914 365 print "9. Server : $WHT$imap_server_type$NRM\n";
366 print "10. Invert Time : $WHT$invert_time$NRM\n";
367 print "11. Delimiter : $WHT$optional_delimiter$NRM\n";
ccfb2029 368 print "\n";
369 print "R Return to Main Menu\n";
370 } elsif ($menu == 3) {
371 print $WHT."Folder Defaults\n".$NRM;
4e85a37f 372 print "1. Default Folder Prefix : $WHT$default_folder_prefix$NRM\n";
373 print "2. Show Folder Prefix Option : $WHT$show_prefix_option$NRM\n";
374 print "3. Trash Folder : $WHT$trash_folder$NRM\n";
375 print "4. Sent Folder : $WHT$sent_folder$NRM\n";
376 print "5. Drafts Folder : $WHT$draft_folder$NRM\n";
377 print "6. By default, move to trash : $WHT$default_move_to_trash$NRM\n";
378 print "7. By default, move to sent : $WHT$default_move_to_sent$NRM\n";
379 print "8. By default, save as draft : $WHT$default_save_as_draft$NRM\n";
380 print "9. List Special Folders First : $WHT$list_special_folders_first$NRM\n";
381 print "10. Show Special Folders Color : $WHT$use_special_folder_color$NRM\n";
382 print "11. Auto Expunge : $WHT$auto_expunge$NRM\n";
383 print "12. Default Sub. of INBOX : $WHT$default_sub_of_inbox$NRM\n";
384 print "13. Show 'Contain Sub.' Option : $WHT$show_contain_subfolders_option$NRM\n";
385 print "14. Default Unseen Notify : $WHT$default_unseen_notify$NRM\n";
386 print "15. Default Unseen Type : $WHT$default_unseen_type$NRM\n";
387 print "16. Auto Create Special Folders : $WHT$auto_create_special$NRM\n";
388 print "17. Don't move folders into Trash : $WHT$delete_folder$NRM\n";
ccfb2029 389 print "\n";
390 print "R Return to Main Menu\n";
391 } elsif ($menu == 4) {
392 print $WHT."General Options\n".$NRM;
8a7d0669 393 print "1. Default Charset : $WHT$default_charset$NRM\n";
394 print "2. Data Directory : $WHT$data_dir$NRM\n";
395 print "3. Attachment Directory : $WHT$attachment_dir$NRM\n";
396 print "4. Directory Hash Level : $WHT$dir_hash_level$NRM\n";
397 print "5. Default Left Size : $WHT$default_left_size$NRM\n";
398 print "6. Usernames in Lowercase : $WHT$force_username_lowercase$NRM\n";
399 print "7. Allow use of priority : $WHT$default_use_priority$NRM\n";
400 print "8. Hide SM attributions : $WHT$hide_sm_attributions$NRM\n";
401 print "9. Allow use of receipts : $WHT$default_use_mdn$NRM\n";
402 print "10. Allow editing of identity : $WHT$edit_identity$NRM\n";
403 if (lc($edit_identity) eq "false") {
404 print "11. Allow editing of name : $WHT$edit_name$NRM\n";
405 }
ccfb2029 406 print "\n";
407 print "R Return to Main Menu\n";
408 } elsif ($menu == 5) {
409 print $WHT."Themes\n".$NRM;
410 print "1. Change Themes\n";
411 for ($count = 0; $count <= $#theme_name; $count++) {
70391dd0 412 print " > $theme_name[$count]\n";
ccfb2029 413 }
6f3bfa54 414 print "2. CSS File : $WHT$theme_css$NRM\n";
ccfb2029 415 print "\n";
416 print "R Return to Main Menu\n";
417 } elsif ($menu == 6) {
418 print $WHT."Address Books (LDAP)\n".$NRM;
1e0628fb 419 print "1. Change Servers\n";
420 for ($count = 0; $count <= $#ldap_host; $count++) {
421 print " > $ldap_host[$count]\n";
422 }
3806fa52 423 print "2. Use Javascript Address Book Search : $WHT$default_use_javascript_addr_book$NRM\n";
ccfb2029 424 print "\n";
425 print "R Return to Main Menu\n";
426 } elsif ($menu == 7) {
427 print $WHT."Message of the Day (MOTD)\n".$NRM;
428 print "\n$motd\n";
429 print "\n";
430 print "1 Edit the MOTD\n";
431 print "\n";
432 print "R Return to Main Menu\n";
9d0c7bee 433 } elsif ($menu == 8) {
434 print $WHT."Plugins\n".$NRM;
1a7a2fcc 435 print " Installed Plugins\n";
436 $num = 0;
9d0c7bee 437 for ($count = 0; $count <= $#plugins; $count++) {
1a7a2fcc 438 $num = $count + 1;
439 print " $num. $plugins[$count]\n";
9d0c7bee 440 }
1a7a2fcc 441 print "\n Available Plugins:\n";
442 opendir(DIR, "../plugins");
443 @files = readdir(DIR);
444 $pos=0;
445 @unused_plugins = ();
1a7a2fcc 446 for ($i=0; $i <= $#files; $i++) {
f0bc4d36 447 if ( -d "../plugins/" . $files[$i] &&
2a15d00c 448 $files[$i] !~ /^\./ && $files[$i] ne "CVS") {
1a7a2fcc 449 $match = 0;
450 for ($k=0; $k<=$#plugins; $k++) {
451 if ($plugins[$k] eq $files[$i]) {
452 $match = 1;
453 }
454 }
455 if ($match == 0) {
456 $unused_plugins[$pos] = $files[$i];
457 $pos++;
458 }
459 }
460 }
1a7a2fcc 461
462 for ($i=0; $i<=$#unused_plugins; $i++) {
463 $num = $num + 1;
464 print " $num. $unused_plugins[$i]\n";
465 }
466 closedir DIR;
467
9d0c7bee 468 print "\n";
f526c4fe 469 print "A Sanitize all plugins for use with Squirrelmail 1.2\n";
470 print "\n";
9d0c7bee 471 print "R Return to Main Menu\n";
497203d4 472 } elsif ($menu == 9) {
473 print $WHT."Database\n".$NRM;
4f40a59d 474 print "1. DSN for Address Book : $WHT$addrbook_dsn$NRM\n";
475 print "2. Table for Address Book : $WHT$addrbook_table$NRM\n";
3499f99f 476 print "3. DSN for Preferences : $WHT$prefs_dsn$NRM\n";
477 print "4. Table for Preferences : $WHT$prefs_table$NRM\n";
497203d4 478 print "\n";
479 print "S Save data\n";
480 print "R Return to Main Menu\n";
ccfb2029 481 }
3ed2faff 482 if ($config_use_color == 1) {
483 print "C. Turn color off\n";
484 } else {
485 print "C. Turn color on\n";
486 }
ccfb2029 487 print "S Save data\n";
488 print "Q Quit\n";
489
490 print "\n";
491 print "Command >> ".$WHT;
492 $command = <STDIN>;
f0bc4d36 493 $command =~ s/[\n|\r]//g;
494 $command =~ tr/A-Z/a-z/;
ccfb2029 495 print "$NRM\n";
496
497 # Read the commands they entered.
f0bc4d36 498 if ($command eq "r") {
ccfb2029 499 $menu = 0;
f0bc4d36 500 } elsif ($command eq "s") {
ccfb2029 501 save_data ();
f0bc4d36 502 print "Press enter to continue...";
ccfb2029 503 $tmp = <STDIN>;
504 $saved = 1;
f0bc4d36 505 } elsif (($command eq "q") && ($saved == 0)) {
ccfb2029 506 print "You have not saved your data.\n";
f0bc4d36 507 print "Save? [".$WHT."Y".$NRM."/n]: ";
ccfb2029 508 $save = <STDIN>;
509 if (($save =~ /^y/i) || ($save =~ /^\s*$/)) {
510 save_data ();
511 }
f0bc4d36 512 } elsif ($command eq "c") {
0ecb47e5 513 if ($config_use_color == 1) {
514 $config_use_color = 2;
515 $WHT = "";
516 $NRM = "";
517 } else {
518 $config_use_color = 1;
519 $WHT = "\x1B[37;1m";
520 $NRM = "\x1B[0m";
521 }
f0bc4d36 522 } elsif ($command eq "d" && $menu == 0) {
a93b12ba 523 set_defaults ();
ccfb2029 524 } else {
525 $saved = 0;
526 if ($menu == 0) {
497203d4 527 if (($command > 0) && ($command < 10)) {
ccfb2029 528 $menu = $command;
529 }
530 } elsif ($menu == 1) {
531 if ($command == 1) { $org_name = command1 (); }
532 elsif ($command == 2) { $org_logo = command2 (); }
533 elsif ($command == 3) { $org_title = command3 (); }
f923b93d 534 elsif ($command == 4) { $signout_page = command4 (); }
80e86e94 535 elsif ($command == 5) { $squirrelmail_default_language = command5(); }
536 elsif ($command == 6) { $frame_top = command6(); }
ccfb2029 537 } elsif ($menu == 2) {
f7b1b3b1 538 if ($command == 1) { $domain = command11 (); }
539 elsif ($command == 2) { $imapServerAddress = command12 (); }
540 elsif ($command == 3) { $imapPort = command13 (); }
541 elsif ($command == 4) { $useSendmail = command14 (); }
542 elsif ($command == 5) { $sendmail_path = command15 (); }
543 elsif ($command == 6) { $smtpServerAddress = command16 (); }
544 elsif ($command == 7) { $smtpPort = command17 (); }
545 elsif ($command == 8) { $use_authenticated_smtp = command18 (); }
546 elsif ($command == 9) { $imap_server_type = command19 (); }
547 elsif ($command == 10) { $invert_time = command110 (); }
548 elsif ($command == 11) { $optional_delimiter = command111 (); }
ccfb2029 549 } elsif ($menu == 3) {
f7b1b3b1 550 if ($command == 1) { $default_folder_prefix = command21 (); }
551 elsif ($command == 2) { $show_prefix_option = command22 (); }
552 elsif ($command == 3) { $trash_folder = command23a (); }
553 elsif ($command == 4) { $sent_folder = command23b (); }
554 elsif ($command == 5) { $draft_folder = command23c (); }
555 elsif ($command == 6) { $default_move_to_trash = command24a (); }
556 elsif ($command == 7) { $default_move_to_sent = command24b (); }
557 elsif ($command == 8) { $default_save_as_draft = command24c (); }
558 elsif ($command == 9) { $list_special_folders_first = command27 (); }
559 elsif ($command == 10) { $use_special_folder_color = command28 (); }
560 elsif ($command == 11) { $auto_expunge = command29 (); }
561 elsif ($command == 12) { $default_sub_of_inbox = command210(); }
562 elsif ($command == 13) { $show_contain_subfolders_option = command211(); }
563 elsif ($command == 14) { $default_unseen_notify = command212(); }
564 elsif ($command == 15) { $default_unseen_type = command213(); }
565 elsif ($command == 16) { $auto_create_special = command214(); }
4e85a37f 566 elsif ($command == 17) { $delete_folder = command215(); }
ccfb2029 567 } elsif ($menu == 4) {
3d043efc 568 if ($command == 1) { $default_charset = command31 (); }
569 elsif ($command == 2) { $data_dir = command33a (); }
570 elsif ($command == 3) { $attachment_dir = command33b (); }
571 elsif ($command == 4) { $dir_hash_level = command33c (); }
572 elsif ($command == 5) { $default_left_size = command35 (); }
573 elsif ($command == 6) { $force_username_lowercase = command36 (); }
574 elsif ($command == 7) { $default_use_priority = command37 (); }
575 elsif ($command == 8) { $hide_sm_attributions = command38 (); }
576 elsif ($command == 9) { $default_use_mdn = command39 (); }
8a7d0669 577 elsif ($command == 10) { $edit_identity = command310 (); }
578 elsif ($command == 11) { $edit_name = command311 (); }
ccfb2029 579 } elsif ($menu == 5) {
6f3bfa54 580 if ($command == 1) { command41 (); }
581 elsif ($command == 2) { $theme_css = command42 (); }
ccfb2029 582 } elsif ($menu == 6) {
3806fa52 583 if ($command == 1) { command61(); }
584 elsif ($command == 2) { command62(); }
ccfb2029 585 } elsif ($menu == 7) {
a37f3771 586 if ($command == 1) { $motd = command71(); }
9d0c7bee 587 } elsif ($menu == 8) {
1a7a2fcc 588 if ($command =~ /^[0-9]+/) { @plugins = command81(); }
f526c4fe 589 elsif ($command eq "a") { command8s(); }
497203d4 590 } elsif ($menu == 9) {
4f40a59d 591 if ($command == 1) { $addrbook_dsn = command91(); }
592 elsif ($command == 2) { $addrbook_table = command92(); }
3499f99f 593 elsif ($command == 3) { $prefs_dsn = command93(); }
594 elsif ($command == 4) { $prefs_table = command94(); }
ccfb2029 595 }
596 }
828b4753 597}
598
599####################################################################################
600
5b6ae78a 601# org_name
602sub command1 {
603 print "We have tried to make the name SquirrelMail as transparent as\n";
604 print "possible. If you set up an organization name, most places where\n";
605 print "SquirrelMail would take credit will be credited to your organization.\n";
606 print "\n";
828b4753 607 print "[$WHT$org_name$NRM]: $WHT";
608 $new_org_name = <STDIN>;
609 if ($new_org_name eq "\n") {
610 $new_org_name = $org_name;
611 } else {
612 $new_org_name =~ s/[\r|\n]//g;
613 }
5b6ae78a 614 return $new_org_name;
615}
616
828b4753 617
5b6ae78a 618# org_logo
619sub command2 {
620 print "Your organization's logo is an image that will be displayed at\n";
621 print "different times throughout SquirrelMail. This is asking for the\n";
622 print "literal (/usr/local/squirrelmail/images/logo.jpg) or relative\n";
623 print "(../images/logo.jpg) path to your logo.\n";
624 print "\n";
828b4753 625 print "[$WHT$org_logo$NRM]: $WHT";
5b6ae78a 626 $new_org_logo = <STDIN>;
627 if ($new_org_logo eq "\n") {
628 $new_org_logo = $org_logo;
bbd30ac8 629 } else {
5b6ae78a 630 $new_org_logo =~ s/[\r|\n]//g;
bbd30ac8 631 }
5b6ae78a 632 return $new_org_logo;
633}
634
635# org_title
636sub command3 {
637 print "A title is what is displayed at the top of the browser window in\n";
638 print "the titlebar. Usually this will end up looking something like:\n";
639 print "\"Netscape: $org_title\"\n";
640 print "\n";
828b4753 641 print "[$WHT$org_title$NRM]: $WHT";
5b6ae78a 642 $new_org_title = <STDIN>;
643 if ($new_org_title eq "\n") {
644 $new_org_title = $org_title;
bbd30ac8 645 } else {
5b6ae78a 646 $new_org_title =~ s/[\r|\n]//g;
bbd30ac8 647 }
5b6ae78a 648 return $new_org_title;
649}
5b6ae78a 650
f923b93d 651# signout_page
652sub command4 {
653 print "When users click the Sign Out button they will be logged out and\n";
654 print "then sent to signout_page. If signout_page is left empty,\n";
655 print "(hit space and then return) they will be taken, as normal,\n";
656 print "to the default and rather sparse SquirrelMail signout page.\n";
657 print "\n";
658 print "[$WHT$signout_page$NRM]: $WHT";
659 $new_signout_page = <STDIN>;
660 if ($new_signout_page eq "\n") {
661 $new_signout_page = $signout_page;
662 } else {
6ef7145f 663 $new_signout_page =~ s/[\r|\n]//g;
664 $new_signout_page =~ s/^\s+$//g;
665 }
666 return $new_signout_page;
667}
668
669# Default language
670sub command5 {
671 print "SquirrelMail attempts to set the language in many ways. If it\n";
672 print "can not figure it out in another way, it will default to this\n";
673 print "language. Please use the two-letter code for the desired language.\n";
674 print "\n";
675 print "[$WHT$squirrelmail_default_language$NRM]: $WHT";
676 $new_signout_page = <STDIN>;
677 if ($new_signout_page eq "\n") {
678 $new_signout_page = $squirrelmail_default_language;
679 } else {
f923b93d 680 $new_signout_page =~ s/[\r|\n]//g;
681 $new_signout_page =~ s/^\s+$//g;
682 }
683 return $new_signout_page;
684}
685
80e86e94 686# Default top frame
687sub command6 {
688 print "SquirrelMail defaults to using the whole of the browser window.\n";
689 print "This allows you to keep it within a specified frame. The default\n";
690 print "is '_top'\n";
691 print "\n";
692 print "[$WHT$frame_top$NRM]: $WHT";
693 $new_frame_top = <STDIN>;
694 if ($new_frame_top eq "\n") {
695 $new_frame_top = '_top';
696 } else {
697 $new_frame_top =~ s/[\r|\n]//g;
698 $new_frame_top =~ s/^\s+$//g;
699 }
700 return $new_frame_top;
701}
702
828b4753 703####################################################################################
5b6ae78a 704
828b4753 705# domain
706sub command11 {
ccfb2029 707 print "The domain name is the suffix at the end of all email messages. If\n";
708 print "for example, your email address is jdoe\@myorg.com, then your domain\n";
709 print "would be myorg.com.\n";
710 print "\n";
711 print "[$WHT$domain$NRM]: $WHT";
712 $new_domain = <STDIN>;
713 if ($new_domain eq "\n") {
714 $new_domain = $domain;
715 } else {
716 $new_domain =~ s/[\r|\n]//g;
717 }
718 return $new_domain;
828b4753 719}
5b6ae78a 720
828b4753 721# imapServerAddress
722sub command12 {
ccfb2029 723 print "This is the address where your IMAP server resides.\n";
724 print "[$WHT$imapServerAddress$NRM]: $WHT";
725 $new_imapServerAddress = <STDIN>;
726 if ($new_imapServerAddress eq "\n") {
727 $new_imapServerAddress = $imapServerAddress;
728 } else {
729 $new_imapServerAddress =~ s/[\r|\n]//g;
730 }
731 return $new_imapServerAddress;
828b4753 732}
5b6ae78a 733
828b4753 734# imapPort
735sub command13 {
ccfb2029 736 print "This is the port that your IMAP server is on. Usually this is 143.\n";
737 print "[$WHT$imapPort$NRM]: $WHT";
738 $new_imapPort = <STDIN>;
739 if ($new_imapPort eq "\n") {
740 $new_imapPort = $imapPort;
741 } else {
742 $new_imapPort =~ s/[\r|\n]//g;
743 }
744 return $new_imapPort;
828b4753 745}
746
747# useSendmail
748sub command14 {
ccfb2029 749 print "You now need to choose the method that you will use for sending\n";
750 print "messages in SquirrelMail. You can either connect to an SMTP server\n";
751 print "or use sendmail directly.\n";
26301d64 752 if (lc($useSendmail) eq "true") {
996d34de 753 $default_value = "1";
ccfb2029 754 } else {
996d34de 755 $default_value = "2";
ccfb2029 756 }
757 print "\n";
996d34de 758 print " 1. Sendmail\n";
759 print " 2. SMTP\n";
760 print "Your choice [1/2] [$WHT$default_value$NRM]: $WHT";
ccfb2029 761 $use_sendmail = <STDIN>;
996d34de 762 if (($use_sendmail =~ /^1\n/i) || (($use_sendmail =~ /^\n/) && ($default_value eq "1"))) {
ccfb2029 763 $useSendmail = "true";
764 } else {
765 $useSendmail = "false";
766 }
767 return $useSendmail;
828b4753 768}
5b6ae78a 769
828b4753 770# sendmail_path
771sub command15 {
772 if ($sendmail_path[0] !~ /./) {
773 $sendmail_path = "/usr/sbin/sendmail";
774 }
ccfb2029 775 print "Specify where the sendmail executable is located. Usually /usr/sbin/sendmail\n";
828b4753 776 print "[$WHT$sendmail_path$NRM]: $WHT";
777 $new_sendmail_path = <STDIN>;
778 if ($new_sendmail_path eq "\n") {
779 $new_sendmail_path = $sendmail_path;
780 } else {
781 $new_sendmail_path =~ s/[\r|\n]//g;
782 }
ccfb2029 783 return $new_sendmail_path;
828b4753 784}
5b6ae78a 785
828b4753 786# smtpServerAddress
787sub command16 {
ccfb2029 788 print "This is the location of your SMTP server.\n";
828b4753 789 print "[$WHT$smtpServerAddress$NRM]: $WHT";
790 $new_smtpServerAddress = <STDIN>;
791 if ($new_smtpServerAddress eq "\n") {
792 $new_smtpServerAddress = $smtpServerAddress;
793 } else {
794 $new_smtpServerAddress =~ s/[\r|\n]//g;
795 }
ccfb2029 796 return $new_smtpServerAddress;
828b4753 797}
798
799# smtpPort
800sub command17 {
ccfb2029 801 print "This is the port to connect to for SMTP. Usually 25.\n";
828b4753 802 print "[$WHT$smtpPort$NRM]: $WHT";
803 $new_smtpPort = <STDIN>;
804 if ($new_smtpPort eq "\n") {
805 $new_smtpPort = $smtpPort;
806 } else {
807 $new_smtpPort =~ s/[\r|\n]//g;
808 }
ccfb2029 809 return $new_smtpPort;
bbd30ac8 810}
d2f4c914 811
812# authenticated server
a93b12ba 813sub command18 {
d2f4c914 814 print "Do you wish to use an authenticated SMTP server? Your server must\n";
815 print "support this in order for SquirrelMail to work with it. We implemented\n";
816 print "it according to RFC 2554.\n";
817
818 $YesNo = 'n';
26301d64 819 $YesNo = 'y' if (lc($use_authenticated_smtp) eq "true");
d2f4c914 820
821 print "Use authenticated SMTP server (y/n) [$WHT$YesNo$NRM]: $WHT";
822
823 $new_use_authenticated_smtp = <STDIN>;
824 $new_use_authenticated_smtp =~ tr/yn//cd;
825 return "true" if ($new_use_authenticated_smtp eq "y");
826 return "false" if ($new_use_authenticated_smtp eq "n");
827 return $use_authenticated_smtp;
828}
829
830# imap_server_type
831sub command19 {
d47b2518 832 print "Each IMAP server has its own quirks. As much as we tried to stick\n";
a93b12ba 833 print "to standards, it doesn't help much if the IMAP server doesn't follow\n";
834 print "the same principles. We have made some work-arounds for some of\n";
835 print "these servers. If you would like to use them, please select your\n";
836 print "IMAP server. If you do not wish to use these work-arounds, you can\n";
837 print "set this to \"other\", and none will be used.\n";
838 print " cyrus = Cyrus IMAP server\n";
839 print " uw = University of Washington's IMAP server\n";
840 print " exchange = Microsoft Exchange IMAP server\n";
841 print " courier = Courier IMAP server\n";
ce1ff5ba 842 print " other = Not one of the above servers\n";
a93b12ba 843 print "[$WHT$imap_server_type$NRM]: $WHT";
844 $new_imap_server_type = <STDIN>;
845 if ($new_imap_server_type eq "\n") {
846 $new_imap_server_type = $imap_server_type;
847 } else {
848 $new_imap_server_type =~ s/[\r|\n]//g;
849 }
850 return $new_imap_server_type;
851}
3f8fe68e 852
d47b2518 853# invert_time
d2f4c914 854sub command110 {
d47b2518 855 print "Sometimes the date of messages sent is messed up (off by a few hours\n";
856 print "on some machines). Typically this happens if the system doesn't support\n";
857 print "tm_gmtoff. It will happen only if your time zone is \"negative\".\n";
858 print "This most often occurs on Solaris 7 machines in the United States.\n";
859 print "By default, this is off. It should be kept off unless problems surface\n";
860 print "about the time that messages are sent.\n";
861 print " no = Do NOT fix time -- almost always correct\n";
862 print " yes = Fix the time for this system\n";
863
864 $YesNo = 'n';
26301d64 865 $YesNo = 'y' if (lc($invert_time) eq "true");
d47b2518 866
867 print "Fix the time for this system (y/n) [$WHT$YesNo$NRM]: $WHT";
868
869 $new_invert_time = <STDIN>;
870 $new_invert_time =~ tr/yn//cd;
871 return "true" if ($new_invert_time eq "y");
872 return "false" if ($new_invert_time eq "n");
873 return $invert_time;
874}
875
d2f4c914 876sub command111 {
40ba4d36 877 print "This is the delimiter that your IMAP server uses to distinguish between\n";
878 print "folders. For example, Cyrus uses '.' as the delimiter and a complete\n";
879 print "folder would look like 'INBOX.Friends.Bob', while UW uses '/' and would\n";
880 print "look like 'INBOX/Friends/Bob'. Normally this should be left at 'detect'\n";
a3439b27 881 print "but if you are sure you know what delimiter your server uses, you can\n";
40ba4d36 882 print "specify it here.\n";
883 print "\nTo have it autodetect the delimiter, set it to 'detect'.\n\n";
884 print "[$WHT$optional_delimiter$NRM]: $WHT";
885 $new_optional_delimiter = <STDIN>;
886 if ($new_optional_delimiter eq "\n") {
887 $new_optional_delimiter = $optional_delimiter;
888 } else {
889 $new_optional_delimiter =~ s/[\r|\n]//g;
890 }
891 return $new_optional_delimiter;
892}
893
3f8fe68e 894# MOTD
895sub command71 {
ccfb2029 896 print "\nYou can now create the welcome message that is displayed\n";
897 print "every time a user logs on. You can use HTML or just plain\n";
a37f3771 898 print "text. If you do not wish to have one, just make it blank.\n\n(Type @ on a blank line to exit)\n";
c4809aca 899
e9f8ea4e 900 $new_motd = "";
ccfb2029 901 do {
902 print "] ";
903 $line = <STDIN>;
904 $line =~ s/[\r|\n]//g;
ccfb2029 905 if ($line ne "@") {
c4809aca 906 $line =~ s/ /\&nbsp;\&nbsp;/g;
907 $line =~ s/\t/\&nbsp;\&nbsp;\&nbsp;\&nbsp;/g;
908 $line =~ s/$/ /;
a73da327 909 $line =~ s/\'/\\\'/g;
c4809aca 910
ccfb2029 911 $new_motd = $new_motd . $line;
912 }
913 } while ($line ne "@");
914 return $new_motd;
3f8fe68e 915}
911ad01c 916
9d0c7bee 917################# PLUGINS ###################
918
919sub command81 {
1a7a2fcc 920 $command =~ s/[\s|\n|\r]*//g;
921 if ($command > 0) {
922 $command = $command - 1;
923 if ($command <= $#plugins) {
924 @newplugins = ();
925 $ct=0;
926 while ($ct <= $#plugins) {
927 if ($ct != $command) {
928 @newplugins = (@newplugins, $plugins[$ct]);
9d0c7bee 929 }
1a7a2fcc 930 $ct++;
9d0c7bee 931 }
1a7a2fcc 932 @plugins = @newplugins;
933 } elsif ($command <= $#plugins + $#unused_plugins + 1) {
934 $num = $command - $#plugins - 1;
935 @newplugins = @plugins;
936 $ct=0;
937 while ($ct <= $#unused_plugins) {
938 if ($ct == $num) {
939 @newplugins = (@newplugins, $unused_plugins[$ct]);
f526c4fe 940 # sanitize the plugin
941 $dir = $unused_plugins[$ct];
942 `./ri_once.pl ../plugins/$dir`;
9d0c7bee 943 }
1a7a2fcc 944 $ct++;
9d0c7bee 945 }
1a7a2fcc 946 @plugins = @newplugins;
9d0c7bee 947 }
1a7a2fcc 948 }
949 return @plugins;
9d0c7bee 950}
951
f526c4fe 952sub command8s {
953 print "This command will sanitize all plugins for use with\n";
954 print "Squirrelmail 1.2. That is, it will rewrite some php-\n";
955 print "constructs that are *incompatible* with the 1.2 design\n";
956 print "into ones that are *compatible*\n";
957 print "Do you wish to issue this command [y/N]? ";
958 $ctu = <STDIN>;
959 if ($ctu =~ /^y\n/i) {
960 `./ri_once.pl ../plugins`;
961 }
962}
963
911ad01c 964################# FOLDERS ###################
965
966# default_folder_prefix
967sub command21 {
ccfb2029 968 print "Some IMAP servers (UW, for example) store mail and folders in\n";
969 print "your user space in a separate subdirectory. This is where you\n";
970 print "specify what that directory is.\n";
971 print "\n";
972 print "EXAMPLE: mail/";
973 print "\n";
974 print "NOTE: If you use Cyrus, or some server that would not use this\n";
975 print " option, you must set this to 'none'.\n";
976 print "\n";
911ad01c 977 print "[$WHT$default_folder_prefix$NRM]: $WHT";
978 $new_default_folder_prefix = <STDIN>;
979 if ($new_default_folder_prefix eq "\n") {
980 $new_default_folder_prefix = $default_folder_prefix;
981 } else {
982 $new_default_folder_prefix =~ s/[\r|\n]//g;
983 }
ccfb2029 984 if (($new_default_folder_prefix =~ /^\s*$/) || ($new_default_folder_prefix =~ /none/i)) {
985 $new_default_folder_prefix = "";
986 } else {
987 $new_default_folder_prefix =~ s/\/*$//g;
988 $new_default_folder_prefix =~ s/$/\//g;
989 }
911ad01c 990 return $new_default_folder_prefix;
991}
992
993# Show Folder Prefix
994sub command22 {
ccfb2029 995 print "It is possible to set up the default folder prefix as a user\n";
996 print "specific option, where each user can specify what their mail\n";
997 print "folder is. If you set this to false, they will never see the\n";
998 print "option, but if it is true, this option will appear in the\n";
999 print "'options' section.\n";
1000 print "\n";
1001 print "NOTE: You set the default folder prefix in option '1' of this\n";
1002 print " section. That will be the default if the user doesn't\n";
1003 print " specify anything different.\n";
1004 print "\n";
1005
26301d64 1006 if (lc($show_prefix_option) eq "true") {
ccfb2029 1007 $default_value = "y";
1008 } else {
1009 $default_value = "n";
1010 }
1011 print "\n";
1012 print "Show option (y/n) [$WHT$default_value$NRM]: $WHT";
1013 $new_show = <STDIN>;
1014 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1015 $show_prefix_option = "true";
1016 } else {
1017 $show_prefix_option = "false";
1018 }
1019 return $show_prefix_option;
911ad01c 1020}
1021
1022# Trash Folder
f7b1b3b1 1023sub command23a {
ccfb2029 1024 print "You can now specify where the default trash folder is located.\n";
1025 print "On servers where you do not want this, you can set it to anything\n";
a301f0d8 1026 print "and set option 6 to false.\n";
ccfb2029 1027 print "\n";
1028 print "This is relative to where the rest of your email is kept. You do\n";
1029 print "not need to worry about their mail directory. If this folder\n";
1030 print "would be ~/mail/trash on the filesystem, you only need to specify\n";
1031 print "that this is 'trash', and be sure to put 'mail/' in option 1.\n";
1032 print "\n";
911ad01c 1033
1034 print "[$WHT$trash_folder$NRM]: $WHT";
1035 $new_trash_folder = <STDIN>;
1036 if ($new_trash_folder eq "\n") {
1037 $new_trash_folder = $trash_folder;
1038 } else {
1039 $new_trash_folder =~ s/[\r|\n]//g;
1040 }
ccfb2029 1041 return $new_trash_folder;
911ad01c 1042}
1043
1044# Sent Folder
f7b1b3b1 1045sub command23b {
ccfb2029 1046 print "This is where messages that are sent will be stored. SquirrelMail\n";
1047 print "by default puts a copy of all outgoing messages in this folder.\n";
1048 print "\n";
1049 print "This is relative to where the rest of your email is kept. You do\n";
1050 print "not need to worry about their mail directory. If this folder\n";
1051 print "would be ~/mail/sent on the filesystem, you only need to specify\n";
1052 print "that this is 'sent', and be sure to put 'mail/' in option 1.\n";
1053 print "\n";
911ad01c 1054
1055 print "[$WHT$sent_folder$NRM]: $WHT";
1056 $new_sent_folder = <STDIN>;
1057 if ($new_sent_folder eq "\n") {
1058 $new_sent_folder = $sent_folder;
1059 } else {
1060 $new_sent_folder =~ s/[\r|\n]//g;
1061 }
ccfb2029 1062 return $new_sent_folder;
911ad01c 1063}
1064
f7b1b3b1 1065# Draft Folder
1066sub command23c {
1067 print "You can now specify where the default draft folder is located.\n";
1068 print "On servers where you do not want this, you can set it to anything\n";
1069 print "and set option 9 to false.\n";
1070 print "\n";
1071 print "This is relative to where the rest of your email is kept. You do\n";
1072 print "not need to worry about their mail directory. If this folder\n";
1073 print "would be ~/mail/drafts on the filesystem, you only need to specify\n";
1074 print "that this is 'drafts', and be sure to put 'mail/' in option 1.\n";
1075 print "\n";
1076
1077 print "[$WHT$draft_folder$NRM]: $WHT";
1078 $new_draft_folder = <STDIN>;
1079 if ($new_draft_folder eq "\n") {
1080 $new_draft_folder = $draft_folder;
1081 } else {
1082 $new_draft_folder =~ s/[\r|\n]//g;
1083 }
1084 return $new_draft_folder;
1085}
1086
2f287147 1087# default move to trash
f7b1b3b1 1088sub command24a {
2f287147 1089 print "By default, should messages get moved to the trash folder? You\n";
1090 print "can specify the default trash folder in option 3. If this is set\n";
1091 print "to false, messages will get deleted immediately without moving\n";
1092 print "to the trash folder.\n";
1093 print "\n";
1094 print "Trash folder is currently: $trash_folder\n";
1095 print "\n";
1096
26301d64 1097 if (lc($default_move_to_trash) eq "true") {
2f287147 1098 $default_value = "y";
1099 } else {
1100 $default_value = "n";
1101 }
1102 print "By default, move to trash (y/n) [$WHT$default_value$NRM]: $WHT";
1103 $new_show = <STDIN>;
1104 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1105 $default_move_to_trash = "true";
1106 } else {
1107 $default_move_to_trash = "false";
1108 }
1109 return $default_move_to_trash;
1110}
1111
1112# default move to sent
f7b1b3b1 1113sub command24b {
2f287147 1114 print "By default, should messages get moved to the sent folder? You\n";
1115 print "can specify the default sent folder in option 4. If this is set\n";
15c5a98c 1116 print "to false, messages will get sent and no copy will be made.\n";
2f287147 1117 print "\n";
1118 print "Trash folder is currently: $sent_folder\n";
1119 print "\n";
1120
26301d64 1121 if (lc($default_move_to_sent) eq "true") {
2f287147 1122 $default_value = "y";
1123 } else {
1124 $default_value = "n";
1125 }
1126 print "By default, move to sent (y/n) [$WHT$default_value$NRM]: $WHT";
1127 $new_show = <STDIN>;
1128 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1129 $default_move_to_sent = "true";
1130 } else {
1131 $default_move_to_sent = "false";
1132 }
1133 return $default_move_to_sent;
1134}
1135
f7b1b3b1 1136# default save as draft
1137sub command24c {
1138 print "By default, should the save to draft option be shown? You can\n";
1139 print "specify the default drafts folder in option 5. If this is set\n";
1140 print "to false, users will not be shown the save to draft option.\n";
1141 print "\n";
1142 print "Drafts folder is currently: $draft_folder\n";
1143 print "\n";
1144
26301d64 1145 if (lc($default_move_to_draft) eq "true") {
f7b1b3b1 1146 $default_value = "y";
1147 } else {
1148 $default_value = "n";
1149 }
1150 print "By default, save as draft (y/n) [$WHT$default_value$NRM]: $WHT";
1151 $new_show = <STDIN>;
1152 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1153 $default_save_as_draft = "true";
1154 } else {
1155 $default_save_as_draft = "false";
1156 }
1157 return $default_save_as_draft;
1158}
1159
2f287147 1160# List special folders first
1161sub command27 {
ccfb2029 1162 print "SquirrelMail has what we call 'special folders' that are not\n";
1163 print "manipulated and viewed like normal folders. Some examples of\n";
1164 print "these folders would be INBOX, Trash, Sent, etc. This option\n";
1165 print "Simply asks if you want these folders listed first in the folder\n";
1166 print "listing.\n";
1167 print "\n";
1168
26301d64 1169 if (lc($list_special_folders_first) eq "true") {
ccfb2029 1170 $default_value = "y";
1171 } else {
1172 $default_value = "n";
1173 }
1174 print "\n";
1175 print "List first (y/n) [$WHT$default_value$NRM]: $WHT";
1176 $new_show = <STDIN>;
1177 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1178 $list_special_folders_first = "true";
1179 } else {
1180 $list_special_folders_first = "false";
1181 }
1182 return $list_special_folders_first;
911ad01c 1183}
1184
1185# Show special folders color
2f287147 1186sub command28 {
ccfb2029 1187 print "SquirrelMail has what we call 'special folders' that are not\n";
1188 print "manipulated and viewed like normal folders. Some examples of\n";
1189 print "these folders would be INBOX, Trash, Sent, etc. This option\n";
1190 print "wants to know if we should display special folders in a\n";
1191 print "color than the other folders.\n";
1192 print "\n";
1193
26301d64 1194 if (lc($use_special_folder_color) eq "true") {
ccfb2029 1195 $default_value = "y";
1196 } else {
1197 $default_value = "n";
1198 }
1199 print "\n";
1200 print "Show color (y/n) [$WHT$default_value$NRM]: $WHT";
1201 $new_show = <STDIN>;
1202 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1203 $use_special_folder_color = "true";
1204 } else {
1205 $use_special_folder_color = "false";
1206 }
1207 return $use_special_folder_color;
911ad01c 1208}
1209
911ad01c 1210# Auto expunge
2f287147 1211sub command29 {
ccfb2029 1212 print "The way that IMAP handles deleting messages is as follows. You\n";
1213 print "mark the message as deleted, and then to 'really' delete it, you\n";
1214 print "expunge it. This option asks if you want to just have messages\n";
1215 print "marked as deleted, or if you want SquirrelMail to expunge the \n";
1216 print "messages too.\n";
1217 print "\n";
1218
26301d64 1219 if (lc($auto_expunge) eq "true") {
ccfb2029 1220 $default_value = "y";
1221 } else {
1222 $default_value = "n";
1223 }
1224 print "Auto expunge (y/n) [$WHT$default_value$NRM]: $WHT";
1225 $new_show = <STDIN>;
1226 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1227 $auto_expunge = "true";
1228 } else {
1229 $auto_expunge = "false";
1230 }
1231 return $auto_expunge;
911ad01c 1232}
1233
1234# Default sub of inbox
2f287147 1235sub command210 {
ccfb2029 1236 print "Some IMAP servers (Cyrus) have all folders as subfolders of INBOX.\n";
1237 print "This can cause some confusion in folder creation for users when\n";
1238 print "they try to create folders and don't put it as a subfolder of INBOX\n";
1239 print "and get permission errors. This option asks if you want folders\n";
1240 print "to be subfolders of INBOX by default.\n";
1241 print "\n";
1242
26301d64 1243 if (lc($default_sub_of_inbox) eq "true") {
ccfb2029 1244 $default_value = "y";
1245 } else {
1246 $default_value = "n";
1247 }
1248 print "Default sub of INBOX (y/n) [$WHT$default_value$NRM]: $WHT";
1249 $new_show = <STDIN>;
1250 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1251 $default_sub_of_inbox = "true";
1252 } else {
1253 $default_sub_of_inbox = "false";
1254 }
1255 return $default_sub_of_inbox;
911ad01c 1256}
1257
1258# Show contain subfolder option
2f287147 1259sub command211 {
ccfb2029 1260 print "Some IMAP servers (UW) make it so that there are two types of\n";
1261 print "folders. Those that contain messages, and those that contain\n";
1262 print "subfolders. If this is the case for your server, set this to\n";
1263 print "true, and it will ask the user whether the folder they are\n";
1264 print "creating contains subfolders or messages.\n";
1265 print "\n";
1266
26301d64 1267 if (lc($show_contain_subfolders_option) eq "true") {
ccfb2029 1268 $default_value = "y";
1269 } else {
1270 $default_value = "n";
1271 }
1272 print "Show option (y/n) [$WHT$default_value$NRM]: $WHT";
1273 $new_show = <STDIN>;
1274 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1275 $show_contain_subfolders_option = "true";
1276 } else {
1277 $show_contain_subfolders_option = "false";
1278 }
1279 return $show_contain_subfolders_option;
911ad01c 1280}
1281
24fc5dd2 1282# Default Unseen Notify
1283sub command212 {
1284 print "This option specifies where the users will receive notification\n";
1285 print "about unseen messages by default. This is of course an option that\n";
1286 print "can be changed on a user level.\n";
1287 print " 1 = No notification\n";
1288 print " 2 = Only on the INBOX\n";
1289 print " 3 = On all folders\n";
1290 print "\n";
1291
1292 print "Which one should be default (1,2,3)? [$WHT$default_unseen_notify$NRM]: $WHT";
1293 $new_show = <STDIN>;
1294 if ($new_show =~ /^[1|2|3]\n/i) {
1295 $default_unseen_notify = $new_show;
1296 }
1297 $default_unseen_notify =~ s/[\r|\n]//g;
1298 return $default_unseen_notify;
1299}
1300
1301# Default Unseen Type
1302sub command213 {
1303 print "Here you can define the default way that unseen messages will be displayed\n";
1304 print "to the user in the folder listing on the left side.\n";
1305 print " 1 = Only unseen messages (4)\n";
1306 print " 2 = Unseen and Total messages (4/27)\n";
1307 print "\n";
1308
1309 print "Which one should be default (1,2)? [$WHT$default_unseen_type$NRM]: $WHT";
1310 $new_show = <STDIN>;
1311 if ($new_show =~ /^[1|2]\n/i) {
1312 $default_unseen_type = $new_show;
1313 }
1314 $default_unseen_type =~ s/[\r|\n]//g;
1315 return $default_unseen_type;
1316}
1317
f7bfc9de 1318# Auto create special folders
1319sub command214 {
f7b1b3b1 1320 print "Would you like the Sent, Trash, and Drafts folders to be created\n";
1321 print "automatically print for you when a user logs in? If the user\n";
1322 print "accidentally deletes their special folders, this option will\n";
1323 print "automatically create it again for them.\n";
f7bfc9de 1324 print "\n";
1325
26301d64 1326 if (lc($auto_create_special) eq "true") {
f7bfc9de 1327 $default_value = "y";
1328 } else {
1329 $default_value = "n";
1330 }
1331 print "Auto create special folders? (y/n) [$WHT$default_value$NRM]: $WHT";
1332 $new_show = <STDIN>;
1333 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1334 $auto_create_special = "true";
1335 } else {
1336 $auto_create_special = "false";
1337 }
1338 return $auto_create_special;
1339}
1340
4e85a37f 1341# Auto create special folders
1342sub command215 {
1343 print "Would you like to automatically completely delete any deleted\n";
1344 print "folders? If not then they will be moved to the Trash folder\n";
1345 print "and can be deleted from there\n";
1346 print "\n";
1347
26301d64 1348 if (lc($delete_folder) eq "true") {
4e85a37f 1349 $default_value = "y";
1350 } else {
1351 $default_value = "n";
1352 }
1353 print "Auto delete folders? (y/n) [$WHT$default_value$NRM]: $WHT";
1354 $new_delete = <STDIN>;
1355 if (($new_delete =~ /^y\n/i) || (($new_delete =~ /^\n/) && ($default_value eq "y"))) {
1356 $delete_folder = "true";
1357 } else {
1358 $delete_folder = "false";
1359 }
1360 return $delete_folder;
1361}
1362
24fc5dd2 1363
ccfb2029 1364############# GENERAL OPTIONS #####################
1365
1366# Default Charset
1367sub command31 {
1368 print "This option controls what character set is used when sending\n";
1369 print "mail and when sending HTML to the browser. Do not set this\n";
1370 print "to US-ASCII, use ISO-8859-1 instead. For cyrillic, it is best\n";
1371 print "to use KOI8-R, since this implementation is faster than most\n";
1372 print "of the alternatives\n";
1373 print "\n";
1374
1375 print "[$WHT$default_charset$NRM]: $WHT";
1376 $new_default_charset = <STDIN>;
1377 if ($new_default_charset eq "\n") {
1378 $new_default_charset = $default_charset;
1379 } else {
1380 $new_default_charset =~ s/[\r|\n]//g;
1381 }
1382 return $new_default_charset;
1383}
1384
ccfb2029 1385# Data directory
3392dc86 1386sub command33a {
ccfb2029 1387 print "It is a possible security hole to have a writable directory\n";
1388 print "under the web server's root directory (ex: /home/httpd/html).\n";
1389 print "For this reason, it is possible to put the data directory\n";
1390 print "anywhere you would like. The path name can be absolute or\n";
1391 print "relative (to the config directory). It doesn't matter. Here\n";
1392 print "are two examples:\n";
1393 print " Absolute: /usr/local/squirrelmail/data/\n";
1394 print " Relative: ../data/\n";
1395 print "\n";
1396
1397 print "[$WHT$data_dir$NRM]: $WHT";
1398 $new_data_dir = <STDIN>;
1399 if ($new_data_dir eq "\n") {
1400 $new_data_dir = $data_dir;
1401 } else {
1402 $new_data_dir =~ s/[\r|\n]//g;
1403 }
1404 if ($new_data_dir =~ /^\s*$/) {
1405 $new_data_dir = "";
1406 } else {
1407 $new_data_dir =~ s/\/*$//g;
1408 $new_data_dir =~ s/$/\//g;
1409 }
1410 return $new_data_dir;
1411}
1412
1413# Attachment directory
3392dc86 1414sub command33b {
ccfb2029 1415 print "Path to directory used for storing attachments while a mail is\n";
1416 print "being sent. There are a few security considerations regarding this\n";
1417 print "directory:\n";
1418 print " 1. It should have the permission 733 (rwx-wx-wx) to make it\n";
1419 print " impossible for a random person with access to the webserver\n";
1420 print " to list files in this directory. Confidential data might\n";
1421 print " be laying around in there.\n";
1422 print " 2. Since the webserver is not able to list the files in the\n";
1423 print " content is also impossible for the webserver to delete files\n";
1424 print " lying around there for too long.\n";
1425 print " 3. It should probably be another directory than the data\n";
1426 print " directory specified in option 3.\n";
1427 print "\n";
1428
1429 print "[$WHT$attachment_dir$NRM]: $WHT";
1430 $new_attachment_dir = <STDIN>;
1431 if ($new_attachment_dir eq "\n") {
1432 $new_attachment_dir = $attachment_dir;
1433 } else {
1434 $new_attachment_dir =~ s/[\r|\n]//g;
1435 }
1436 if ($new_attachment_dir =~ /^\s*$/) {
1437 $new_attachment_dir = "";
1438 } else {
1439 $new_attachment_dir =~ s/\/*$//g;
1440 $new_attachment_dir =~ s/$/\//g;
1441 }
1442 return $new_attachment_dir;
1443}
1444
3392dc86 1445sub command33c {
1446 print "The directory hash level setting allows you to configure the level\n";
1447 print "of hashing that Squirremail employs in your data and attachment\n";
1448 print "directories. This value must be an integer ranging from 0 to 4.\n";
1449 print "When this value is set to 0, Squirrelmail will simply store all\n";
1450 print "files as normal in the data and attachment directories. However,\n";
1451 print "when set to a value from 1 to 4, a simple hashing scheme will be\n";
1452 print "used to organize the files in this directory. In short, the crc32\n";
1453 print "value for a username will be computed. Then, up to the first 4\n";
1454 print "digits of the hash, as set by this configuration value, will be\n";
1455 print "used to directory hash the files for that user in the data and\n";
1456 print "attachment directory. This allows for better performance on\n";
1457 print "servers with larger numbers of users.\n";
1458 print "\n";
1459
1460 print "[$WHT$dir_hash_level$NRM]: $WHT";
1461 $new_dir_hash_level = <STDIN>;
1462 if ($new_dir_hash_level eq "\n") {
1463 $new_dir_hash_level = $dir_hash_level;
1464 } else {
1465 $new_dir_hash_level =~ s/[\r|\n]//g;
1466 }
63717a85 1467 if ((int($new_dir_hash_level) < 0) ||
1468 (int($new_dir_hash_level) > 4) ||
1469 !(int($new_dir_hash_level) eq $new_dir_hash_level )) {
3392dc86 1470 print "Invalid Directory Hash Level.\n";
1471 print "Value must be an integer ranging from 0 to 4\n";
1472 print "Hit enter to continue.\n";
1473 $enter_key = <STDIN>;
1474
1475 $new_dir_hash_level = $dir_hash_level;
1476 }
1477
1478 return $new_dir_hash_level;
1479}
ccfb2029 1480
1481sub command35 {
1482 print "This is the default size (in pixels) of the left folder list.\n";
1483 print "Default is 200, but you can set it to whatever you wish. This\n";
1484 print "is a user preference, so this will only show up as their default.\n";
1485 print "\n";
1486 print "[$WHT$default_left_size$NRM]: $WHT";
1487 $new_default_left_size = <STDIN>;
1488 if ($new_default_left_size eq "\n") {
1489 $new_default_left_size = $default_left_size;
1490 } else {
1491 $new_default_left_size =~ s/[\r|\n]//g;
1492 }
1493 return $new_default_left_size;
1494}
1495
1496
985f7c88 1497sub command36 {
1498 print "Some IMAP servers only have lowercase letters in the usernames\n";
1499 print "but they still allow people with uppercase to log in. This\n";
1500 print "causes a problem with the user's preference files. This option\n";
1501 print "transparently changes all usernames to lowercase.";
1502 print "\n";
1503
26301d64 1504 if (lc($force_username_lowercase) eq "true") {
985f7c88 1505 $default_value = "y";
1506 } else {
1507 $default_value = "n";
1508 }
1509 print "Convert usernames to lowercase (y/n) [$WHT$default_value$NRM]: $WHT";
1510 $new_show = <STDIN>;
1511 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1512 return "true";
1513 }
1514 return "false";
1515}
1516
0d15cd19 1517sub command37 {
1518 print "";
1519 print "\n";
1520
26301d64 1521 if (lc($default_use_priority) eq "true") {
0d15cd19 1522 $default_value = "y";
1523 } else {
1524 $default_value = "n";
1525 }
1526
1527 print "Allow users to specify priority of outgoing mail (y/n) [$WHT$default_value$NRM]: $WHT";
1528 $new_show = <STDIN>;
1529 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1530 return "true";
1531 }
1532 return "false";
1533}
1534
985f7c88 1535
826b7f71 1536sub command38 {
1537 print "";
1538 print "\n";
1539
26301d64 1540 if (lc($default_hide_attribution) eq "true") {
826b7f71 1541 $default_value = "y";
1542 } else {
1543 $default_value = "n";
1544 }
1545
1546 print "Hide SM attributions (y/n) [$WHT$default_value$NRM]: $WHT";
1547 $new_show = <STDIN>;
1548 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1549 return "true";
1550 }
1551 return "false";
1552}
1553
1554
8c21da0c 1555sub command39 {
1556 print "";
1557 print "\n";
1558
26301d64 1559 if (lc($default_use_mdn) eq "true") {
8c21da0c 1560 $default_value = "y";
1561 } else {
1562 $default_value = "n";
1563 }
1564
ae25968c 1565 print "Enable support for read/delivery receipt support (y/n) [$WHT$default_value$NRM]: $WHT";
8c21da0c 1566 $new_show = <STDIN>;
1567 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1568 return "true";
1569 }
1570 return "false";
1571}
1572
8a7d0669 1573sub command310 {
1574 print "This allows you to prevent the editing of the users name and";
1575 print "email address. This is mainly useful when used with the";
1576 print "retrieveuserdata plugin\n";
1577 print "\n";
1578
1579 if (lc($edit_identity) eq "true") {
1580 $default_value = "y";
1581 } else {
1582 $default_value = "n";
1583 }
1584 print "Allow editing? (y/n) [$WHT$default_value$NRM]: $WHT";
1585 $new_edit = <STDIN>;
1586 if (($new_edit =~ /^y\n/i) || (($new_edit =~ /^\n/) && ($default_value eq "y"))) {
1587 $edit_identity = "true";
1588 } else {
1589 $edit_identity = "false";
1590 }
1591 return $edit_identity;
1592}
1593
1594sub command311 {
1595 print "This option allows you to choose if the user can edit their full name";
1596 print "even when you don't want them to change their username\n";
1597 print "\n";
1598
1599 if (lc($edit_name) eq "true") {
1600 $default_value = "y";
1601 } else {
1602 $default_value = "n";
1603 }
1604 print "Allow editing of the users full name? (y/n) [$WHT$default_value$NRM]: $WHT";
1605 $new_edit = <STDIN>;
1606 if (($new_edit =~ /^y\n/i) || (($new_edit =~ /^\n/) && ($default_value eq "y"))) {
1607 $edit_name = "true";
1608 } else {
1609 $edit_name = "false";
1610 }
1611 return $edit_name;
1612}
8c21da0c 1613
ccfb2029 1614sub command41 {
1615 print "\nNow we will define the themes that you wish to use. If you have added\n";
1616 print "a theme of your own, just follow the instructions (?) about how to add\n";
1617 print "them. You can also change the default theme.\n";
1618 print "[theme] command (?=help) > ";
1619 $input = <STDIN>;
1620 $input =~ s/[\r|\n]//g;
1621 while ($input ne "d") {
1622 if ($input =~ /^\s*l\s*/i) {
1623 $count = 0;
1624 while ($count <= $#theme_name) {
1625 if ($count == $theme_default) {
1626 print " *";
1627 } else {
1628 print " ";
1629 }
1630 $name = $theme_name[$count];
1631 $num_spaces = 25 - length($name);
1632 for ($i = 0; $i < $num_spaces;$i++) {
1633 $name = $name . " ";
1634 }
1635
1636 print " $count. $name";
1637 print "($theme_path[$count])\n";
1638
1639 $count++;
1640 }
1641 } elsif ($input =~ /^\s*m\s*[0-9]+/i) {
1642 $old_def = $theme_default;
1643 $theme_default = $input;
1644 $theme_default =~ s/^\s*m\s*//;
1645 if (($theme_default > $#theme_name) || ($theme_default < 0)) {
1646 print "Cannot set default theme to $theme_default. That theme does not exist.\n";
1647 $theme_default = $old_def;
1648 }
1649 } elsif ($input =~ /^\s*\+/) {
1650 print "What is the name of this theme: ";
1651 $name = <STDIN>;
1652 $name =~ s/[\r|\n]//g;
1653 $theme_name[$#theme_name+1] = $name;
390372b4 1654 print "Be sure to put ../themes/ before the filename.\n";
1655 print "What file is this stored in (ex: ../themes/default_theme.php): ";
ccfb2029 1656 $name = <STDIN>;
1657 $name =~ s/[\r|\n]//g;
1658 $theme_path[$#theme_path+1] = $name;
1659 } elsif ($input =~ /^\s*-\s*[0-9]?/) {
1660 if ($input =~ /[0-9]+\s*$/) {
1661 $rem_num = $input;
1662 $rem_num =~ s/^\s*-\s*//g;
1663 $rem_num =~ s/\s*$//;
1664 } else {
1665 $rem_num = $#theme_name;
1666 }
1667 if ($rem_num == $theme_default) {
1668 print "You cannot remove the default theme!\n";
1669 } else {
1670 $count = 0;
1671 @new_theme_name = ();
1672 @new_theme_path = ();
1673 while ($count <= $#theme_name) {
1674 if ($count != $rem_num) {
1675 @new_theme_name = (@new_theme_name, $theme_name[$count]);
1676 @new_theme_path = (@new_theme_path, $theme_path[$count]);
1677 }
1678 $count++;
1679 }
1680 @theme_name = @new_theme_name;
1681 @theme_path = @new_theme_path;
1682 if ($theme_default > $rem_num) {
1683 $theme_default--;
1684 }
1685 }
8442ac08 1686 } elsif ($input =~ /^\s*t\s*/i) {
1687 print "\nStarting detection...\n\n";
1688
1689 opendir(DIR, "../themes");
1690 @files = grep { /\.php$/i } readdir(DIR);
1691 $cnt = 0;
1692 while ($cnt <= $#files) {
1693 $filename = "../themes/" . $files[$cnt];
5cb1d69b 1694 if ($filename ne "../themes/index.php") {
1695 $found = 0;
1696 for ($x=0; $x <= $#theme_path; $x++) {
1697 if ($theme_path[$x] eq $filename) {
1698 $found = 1;
1699 }
1700 }
1701 if ($found != 1) {
1702 print "** Found theme: $filename\n";
1703 print " What is its name? ";
1704 $nm = <STDIN>;
1705 $nm =~ s/[\n|\r]//g;
1706 $theme_name[$#theme_name+1] = $nm;
1707 $theme_path[$#theme_path+1] = $filename;
8442ac08 1708 }
8442ac08 1709 }
1710 $cnt++;
1711 }
1712 print "\n";
1713 for ($cnt=0; $cnt <= $#theme_path; $cnt++) {
1714 $filename = $theme_path[$cnt];
1715 if (! (-e $filename)) {
1716 print " Removing $filename (file not found)\n";
1717 $offset = 0;
1718 @new_theme_name = ();
1719 @new_theme_path = ();
1720 for ($x=0; $x < $#theme_path; $x++) {
1721 if ($theme_path[$x] eq $filename) {
1722 $offset = 1;
1723 }
1724 if ($offset == 1) {
1725 $new_theme_name[$x] = $theme_name[$x+1];
1726 $new_theme_path[$x] = $theme_path[$x+1];
1727 } else {
1728 $new_theme_name[$x] = $theme_name[$x];
1729 $new_theme_path[$x] = $theme_path[$x];
1730 }
1731 }
1732 @theme_name = @new_theme_name;
1733 @theme_path = @new_theme_path;
1734 }
1735 }
1736 print "\nDetection complete!\n\n";
1737
1738 closedir DIR;
ccfb2029 1739 } elsif ($input =~ /^\s*\?\s*/) {
1740 print ".-------------------------.\n";
8442ac08 1741 print "| t (detect themes) |\n";
ccfb2029 1742 print "| + (add theme) |\n";
1743 print "| - N (remove theme) |\n";
1744 print "| m N (mark default) |\n";
1745 print "| l (list themes) |\n";
1746 print "| d (done) |\n";
1747 print "`-------------------------'\n";
1748 }
1749 print "[theme] command (?=help) > ";
1750 $input = <STDIN>;
1751 $input =~ s/[\r|\n]//g;
1752 }
1753}
1754
1755
6f3bfa54 1756# Theme - CSS file
1757sub command42 {
1758 print "You may specify a cascading style-sheet (CSS) file to be included\n";
1759 print "on each html page generated by SquirrelMail. The CSS file is useful\n";
1760 print "for specifying a site-wide font. If you're not familiar with CSS\n";
1761 print "files, leave this blank.\n";
1762 print "\n";
1763 print "To clear out an existing value, just type a space for the input.\n";
1764 print "\n";
1765 print "[$WHT$theme_css$NRM]: $WHT";
1766 $new_theme_css = <STDIN>;
1767 if ($new_theme_css eq "\n") {
1768 $new_theme_css = $theme_css;
1769 } else {
1770 $new_theme_css =~ s/[\r|\n]//g;
1771 }
1772 $new_theme_css =~ s/^\s*//;
1773 return $new_theme_css;
1774}
1775
1776
1e0628fb 1777sub command61 {
a93b12ba 1778 print "You can now define different LDAP servers.\n";
1e0628fb 1779 print "[ldap] command (?=help) > ";
1780 $input = <STDIN>;
1781 $input =~ s/[\r|\n]//g;
1782 while ($input ne "d") {
1783 if ($input =~ /^\s*l\s*/i) {
1784 $count = 0;
1785 while ($count <= $#ldap_host) {
a93b12ba 1786 print "$count. $ldap_host[$count]\n";
1787 print " base: $ldap_base[$count]\n";
1788 if ($ldap_charset[$count]) {
1789 print " charset: $ldap_charset[$count]\n";
1790 }
1791 if ($ldap_port[$count]) {
1792 print " port: $ldap_port[$count]\n";
1793 }
1794 if ($ldap_name[$count]) {
1795 print " name: $ldap_name[$count]\n";
1796 }
1797 if ($ldap_maxrows[$count]) {
1798 print " maxrows: $ldap_maxrows[$count]\n";
1799 }
1800 print "\n";
1e0628fb 1801 $count++;
1802 }
1803 } elsif ($input =~ /^\s*\+/) {
a93b12ba 1804 $sub = $#ldap_host + 1;
1e0628fb 1805
a93b12ba 1806 print "First, we need to have the hostname or the IP address where\n";
1807 print "this LDAP server resides. Example: ldap.bigfoot.com\n";
1808 print "hostname: ";
1e0628fb 1809 $name = <STDIN>;
1810 $name =~ s/[\r|\n]//g;
1811 $ldap_host[$sub] = $name;
a93b12ba 1812
1813 print "\n";
1e0628fb 1814
a93b12ba 1815 print "Next, we need the server root (base dn). For this, an empty\n";
1816 print "string is allowed.\n";
1817 print "Example: ou=member_directory,o=netcenter.com\n";
1818 print "base: ";
1e0628fb 1819 $name = <STDIN>;
1820 $name =~ s/[\r|\n]//g;
1821 $ldap_base[$sub] = $name;
1822
a93b12ba 1823 print "\n";
1e0628fb 1824
a93b12ba 1825 print "This is the TCP/IP port number for the LDAP server. Default\n";
1826 print "port is 389. This is optional. Press ENTER for default.\n";
1827 print "port: ";
1e0628fb 1828 $name = <STDIN>;
1829 $name =~ s/[\r|\n]//g;
1830 $ldap_port[$sub] = $name;
1831
a93b12ba 1832 print "\n";
1e0628fb 1833
a93b12ba 1834 print "This is the charset for the server. Default is utf-8. This\n";
1835 print "is also optional. Press ENTER for default.\n";
1836 print "charset: ";
1e0628fb 1837 $name = <STDIN>;
1838 $name =~ s/[\r|\n]//g;
1839 $ldap_charset[$sub] = $name;
1840
a93b12ba 1841 print "\n";
1e0628fb 1842
a93b12ba 1843 print "This is the name for the server, used to tag the results of\n";
1844 print "the search. Default it \"LDAP: hostname\". Press ENTER for default\n";
1845 print "name: ";
1e0628fb 1846 $name = <STDIN>;
1847 $name =~ s/[\r|\n]//g;
1848 $ldap_name[$sub] = $name;
1849
a93b12ba 1850 print "\n";
1e0628fb 1851
a93b12ba 1852 print "You can specify the maximum number of rows in the search result.\n";
1853 print "Default is unlimited. Press ENTER for default.\n";
1854 print "maxrows: ";
1e0628fb 1855 $name = <STDIN>;
1856 $name =~ s/[\r|\n]//g;
1857 $ldap_maxrows[$sub] = $name;
1858
a93b12ba 1859 print "\n";
1e0628fb 1860
1861 } elsif ($input =~ /^\s*-\s*[0-9]?/) {
1862 if ($input =~ /[0-9]+\s*$/) {
1863 $rem_num = $input;
1864 $rem_num =~ s/^\s*-\s*//g;
1865 $rem_num =~ s/\s*$//;
1866 } else {
1867 $rem_num = $#ldap_host;
1868 }
1869 $count = 0;
1870 @new_ldap_host = ();
1871 @new_ldap_base = ();
1872 @new_ldap_port = ();
1873 @new_ldap_name = ();
1874 @new_ldap_charset = ();
1875 @new_ldap_maxrows = ();
1876 while ($count <= $#ldap_host) {
1877 if ($count != $rem_num) {
1878 @new_ldap_host = (@new_ldap_host, $ldap_host[$count]);
1879 @new_ldap_base = (@new_ldap_base, $ldap_base[$count]);
1880 @new_ldap_port = (@new_ldap_port, $ldap_port[$count]);
1881 @new_ldap_name = (@new_ldap_name, $ldap_name[$count]);
1882 @new_ldap_charset = (@new_ldap_charset, $ldap_charset[$count]);
1883 @new_ldap_maxrows = (@new_ldap_maxrows, $ldap_maxrows[$count]);
1884 }
1885 $count++;
1886 }
1887 @ldap_host = @new_ldap_host;
1888 @ldap_base = @new_ldap_base;
1889 @ldap_port = @new_ldap_port;
1890 @ldap_name = @new_ldap_name;
1891 @ldap_charset = @new_ldap_charset;
1892 @ldap_maxrows = @new_ldap_maxrows;
1893 } elsif ($input =~ /^\s*\?\s*/) {
1894 print ".-------------------------.\n";
1895 print "| + (add host) |\n";
1896 print "| - N (remove host) |\n";
1897 print "| l (list hosts) |\n";
1898 print "| d (done) |\n";
1899 print "`-------------------------'\n";
1900 }
1901 print "[ldap] command (?=help) > ";
1902 $input = <STDIN>;
1903 $input =~ s/[\r|\n]//g;
1904 }
1905}
1906
3806fa52 1907sub command62 {
591000ec 1908 print "Some of our developers have come up with very good javascript interface\n";
1909 print "for searching through address books, however, our original goals said\n";
1910 print "that we would be 100% HTML. In order to make it possible to use their\n";
1911 print "interface, and yet stick with our goals, we have also written a plain\n";
1912 print "HTML version of the search. Here, you can choose which version to use.\n";
3806fa52 1913 print "\n";
1914 print "This is just the default value. It is also a user option that each\n";
1915 print "user can configure individually\n";
1916 print "\n";
1917
26301d64 1918 if (lc($default_use_javascript_addr_book) eq "true") {
3806fa52 1919 $default_value = "y";
1920 } else {
1921 $default_use_javascript_addr_book = "false";
1922 $default_value = "n";
1923 }
c4809aca 1924 print "Use javascript version by default (y/n) [$WHT$default_value$NRM]: $WHT";
3806fa52 1925 $new_show = <STDIN>;
1926 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1927 $default_use_javascript_addr_book = "true";
1928 } else {
1929 $default_use_javascript_addr_book = "false";
1930 }
1931 return $default_use_javascript_addr_book;
1932}
1e0628fb 1933
497203d4 1934sub command91 {
1935 print "If you want to store your users address book details in a database then\n";
1936 print "you need to set this DSN to a valid value. The format for this is:\n";
1937 print "mysql://user:pass\@hostname/dbname\n";
1938 print "Where mysql can be one of the databases PHP supports, the most common\n";
1939 print "of these are mysql, msql and pgsql\n";
1940 print "If the DSN is left empty (hit space and then return) the database\n";
1941 print "related code for address books will not be used\n";
1942 print "\n";
1943
1944 if ($addrbook_dsn eq "") {
1945 $default_value = "Disabled";
1946 } else {
1947 $default_value = $addrbook_dsn;
1948 }
1949 print "[$WHT$addrbook_dsn$NRM]: $WHT";
1950 $new_dsn = <STDIN>;
1951 if ($new_dsn eq "\n") {
1952 $new_dsn = "";
1953 } else {
1954 $new_dsn =~ s/[\r|\n]//g;
1955 $new_dsn =~ s/^\s+$//g;
1956 }
1957 return $new_dsn;
1958}
ccfb2029 1959
4f40a59d 1960sub command92 {
1961 print "This is the name of the table you want to store the address book\n";
1962 print "data in, it defaults to 'address'\n";
1963 print "\n";
1964 print "[$WHT$addrbook_table$NRM]: $WHT";
1965 $new_table = <STDIN>;
1966 if ($new_table eq "\n") {
1967 $new_table = $addrbook_table;
1968 } else {
1969 $new_table =~ s/[\r|\n]//g;
1970 }
1971 return $new_table;
1972}
1973
3499f99f 1974sub command93 {
1975 print "If you want to store your users preferences in a database then\n";
1976 print "you need to set this DSN to a valid value. The format for this is:\n";
1977 print "mysql://user:pass\@hostname/dbname\n";
1978 print "Where mysql can be one of the databases PHP supports, the most common\n";
1979 print "of these are mysql, msql and pgsql\n";
1980 print "If the DSN is left empty (hit space and then return) the database\n";
1981 print "related code for address books will not be used\n";
1982 print "\n";
1983
1984 if ($prefs_dsn eq "") {
1985 $default_value = "Disabled";
1986 } else {
1987 $default_value = $prefs_dsn;
1988 }
1989 print "[$WHT$prefs_dsn$NRM]: $WHT";
1990 $new_dsn = <STDIN>;
1991 if ($new_dsn eq "\n") {
1992 $new_dsn = "";
1993 } else {
1994 $new_dsn =~ s/[\r|\n]//g;
1995 $new_dsn =~ s/^\s+$//g;
1996 }
1997 return $new_dsn;
1998}
1999
2000sub command94 {
2001 print "This is the name of the table you want to store the preferences\n";
2002 print "data in, it defaults to 'address'\n";
2003 print "\n";
2004 print "[$WHT$prefs_table$NRM]: $WHT";
2005 $new_table = <STDIN>;
2006 if ($new_table eq "\n") {
2007 $new_table = $prefs_table;
2008 } else {
2009 $new_table =~ s/[\r|\n]//g;
2010 }
2011 return $new_table;
2012}
2013
ccfb2029 2014sub save_data {
ebd13f55 2015 $tab = " ";
2016 if(open (CF, ">config.php"))
2017 {
2018 print CF "<?php\n";
2019 print CF "\n";
2020
2021 print CF "/**\n";
2022 print CF " * SquirrelMail Configuration File\n";
2023 print CF " * Created using the configure script, conf.pl\n";
2024 print CF " */\n";
2025 print CF "\n";
2026
ebd13f55 2027 if ($print_config_version) {
2028 print CF "\$config_version = '$print_config_version';\n";
2029 }
2030 print CF "\$config_use_color = $config_use_color;\n";
2031 print CF "\n";
2032
ebd13f55 2033 print CF "\$org_name = \"$org_name\";\n";
2034 print CF "\$org_logo = '$org_logo';\n";
2035 print CF "\$org_title = \"$org_title\";\n";
2036 print CF "\$signout_page = '$signout_page';\n";
3d043efc 2037 print CF "\$frame_top = '$frame_top';\n";
ebd13f55 2038 print CF "\n";
2039
ebd13f55 2040 print CF "\$motd = '$motd';\n";
2041 print CF "\n";
2042
ebd13f55 2043 print CF "\$squirrelmail_default_language = '$squirrelmail_default_language';\n";
2044 print CF "\n";
2045
ebd13f55 2046 print CF "\$domain = '$domain';\n";
2047 print CF "\$imapServerAddress = '$imapServerAddress';\n";
2048 print CF "\$imapPort = $imapPort;\n";
2049 print CF "\$useSendmail = $useSendmail;\n";
2050 print CF "\$smtpServerAddress = '$smtpServerAddress';\n";
2051 print CF "\$smtpPort = $smtpPort;\n";
2052 print CF "\$sendmail_path = '$sendmail_path';\n";
2053 print CF "\$use_authenticated_smtp = $use_authenticated_smtp;\n";
2054 print CF "\$imap_server_type = '$imap_server_type';\n";
2055 print CF "\$invert_time = $invert_time;\n";
2056 print CF "\$optional_delimiter = '$optional_delimiter';\n";
2057 print CF "\n";
2058
ebd13f55 2059 print CF "\$default_folder_prefix = '$default_folder_prefix';\n";
2060 print CF "\$trash_folder = '$trash_folder';\n";
2061 print CF "\$sent_folder = '$sent_folder';\n";
2062 print CF "\$draft_folder = '$draft_folder';\n";
2063 print CF "\$default_move_to_trash = $default_move_to_trash;\n";
2064 print CF "\$default_move_to_sent = $default_move_to_sent;\n";
2065 print CF "\$default_save_as_draft = $default_save_as_draft;\n";
2066 print CF "\$show_prefix_option = $show_prefix_option;\n";
2067 print CF "\$list_special_folders_first = $list_special_folders_first;\n";
2068 print CF "\$use_special_folder_color = $use_special_folder_color;\n";
2069 print CF "\$auto_expunge = $auto_expunge;\n";
2070 print CF "\$default_sub_of_inbox = $default_sub_of_inbox;\n";
2071 print CF "\$show_contain_subfolders_option = $show_contain_subfolders_option;\n";
2072 print CF "\$default_unseen_notify = $default_unseen_notify;\n";
2073 print CF "\$default_unseen_type = $default_unseen_type;\n";
2074 print CF "\$auto_create_special = $auto_create_special;\n";
4e85a37f 2075 print CF "\$delete_folder = $delete_folder;\n";
ebd13f55 2076 print CF "\n";
2077
ebd13f55 2078 print CF "\$default_charset = '$default_charset';\n";
2079 print CF "\$data_dir = '$data_dir';\n";
2080 print CF "\$attachment_dir = \"$attachment_dir\";\n";
2081 print CF "\$dir_hash_level = $dir_hash_level;\n";
2082 print CF "\$default_left_size = $default_left_size;\n";
2083 print CF "\$force_username_lowercase = $force_username_lowercase;\n";
2084 print CF "\$default_use_priority = $default_use_priority;\n";
2085 print CF "\$hide_sm_attributions = $hide_sm_attributions;\n";
8c21da0c 2086 print CF "\$default_use_mdn = $default_use_mdn;\n";
8a7d0669 2087 print CF "\$edit_identity = $edit_identity;\n";
2088 print CF "\$edit_name = $edit_name;\n";
ebd13f55 2089 print CF "\n";
2090
ebd13f55 2091 for ($ct=0; $ct <= $#plugins; $ct++) {
2092 print CF "\$plugins[$ct] = '$plugins[$ct]';\n";
2093 }
2094 print CF "\n";
2095
ebd13f55 2096 print CF "\$theme_css = '$theme_css';\n";
2097 for ($count=0; $count <= $#theme_name; $count++) {
2098 print CF "\$theme[$count]['PATH'] = '$theme_path[$count]';\n";
2099 print CF "\$theme[$count]['NAME'] = '$theme_name[$count]';\n";
2100 }
2101 print CF "\n";
2102
2103 if ($default_use_javascript_addr_book ne "true") {
2104 $default_use_javascript_addr_book = "false";
2105 }
ebd13f55 2106 print CF "\$default_use_javascript_addr_book = $default_use_javascript_addr_book;\n";
2107 for ($count=0; $count <= $#ldap_host; $count++) {
2108 print CF "\$ldap_server[$count] = array(\n";
2109 print CF " 'host' => '$ldap_host[$count]',\n";
2110 print CF " 'base' => '$ldap_base[$count]'";
2111 if ($ldap_name[$count]) {
2112 print CF ",\n";
2113 print CF " 'name' => '$ldap_name[$count]'";
2114 }
2115 if ($ldap_port[$count]) {
2116 print CF ",\n";
2117 print CF " 'port' => '$ldap_port[$count]'";
2118 }
2119 if ($ldap_charset[$count]) {
2120 print CF ",\n";
2121 print CF " 'charset' => '$ldap_charset[$count]'";
2122 }
2123 if ($ldap_maxrows[$count]) {
2124 print CF ",\n";
2125 print CF " 'maxrows' => '$ldap_maxrows[$count]'";
2126 }
2127 print CF "\n";
2128 print CF ");\n";
2129 print CF "\n";
2130 }
b622e1b8 2131
4f40a59d 2132 print CF "\$addrbook_dsn = '$addrbook_dsn';\n";
2133 print CF "\$addrbook_table = '$addrbook_table';\n\n";
3499f99f 2134 print CF "\$prefs_dsn = '$prefs_dsn';\n";
3d043efc 2135 print CF "\$prefs_table = '$prefs_table';\n\n";
2136
ebd13f55 2137 print CF "/**\n";
2138 print CF " * Make sure there are no characters after the PHP closing\n";
2139 print CF " * tag below (including newline characters and whitespace).\n";
2140 print CF " * Otherwise, that character will cause the headers to be\n";
2141 print CF " * sent and regular output to begin, which will majorly screw\n";
2142 print CF " * things up when we try to send more headers later.\n";
2143 print CF " */\n";
2144 print CF "?>";
2145
2146 close CF;
2147
2148 print "Data saved in config.php\n";
2149 } else {
2150 print "Error saving config.php: $!\n";
2151 }
911ad01c 2152}
a93b12ba 2153
2154sub set_defaults {
2155 system "clear";
612eda0a 2156 print $WHT."SquirrelMail Configuration : ".$NRM;
2157 if ($config == 1) { print "Read: config.php"; }
2158 elsif ($config == 2) { print "Read: config_default.php"; }
2159 print "\n";
2160 print "---------------------------------------------------------\n";
2161
a93b12ba 2162 print "While we have been building SquirrelMail, we have discovered some\n";
2163 print "preferences that work better with some servers that don't work so\n";
2164 print "well with others. If you select your IMAP server, this option will\n";
2165 print "set some pre-defined settings for that server.\n";
2166 print "\n";
2167 print "Please note that you will still need to go through and make sure\n";
2168 print "everything is correct. This does not change everything. There are\n";
e9f8ea4e 2169 print "only a few settings that this will change.\n";
a93b12ba 2170 print "\n";
2171
2172 $continue = 0;
2173 while ($continue != 1) {
2174 print "Please select your IMAP server:\n";
2175 print " cyrus = Cyrus IMAP server\n";
2176 print " uw = University of Washington's IMAP server\n";
2177 print " exchange = Microsoft Exchange IMAP server\n";
2178 print " courier = Courier IMAP server\n";
2179 print " quit = Do not change anything\n";
2180 print "Command >> ";
2181 $server = <STDIN>;
2182 $server =~ s/[\r|\n]//g;
2183
c4809aca 2184 print "\n";
2185 if ($server eq "cyrus") {
dbcc5ca3 2186 $imap_server_type = "cyrus";
3a94810f 2187 $default_folder_prefix = "";
2188 $trash_folder = "INBOX.Trash";
2189 $sent_folder = "INBOX.Sent";
2190 $draft_folder = "INBOX.Drafts";
2191 $show_prefix_option = false;
2192 $default_sub_of_inbox = true;
2193 $show_contain_subfolders_option = false;
dbcc5ca3 2194 $optional_delimiter = ".";
3a94810f 2195 $disp_default_folder_prefix = "<none>";
c4809aca 2196
a93b12ba 2197 $continue = 1;
2198 } elsif ($server eq "uw") {
dbcc5ca3 2199 $imap_server_type = "uw";
3a94810f 2200 $default_folder_prefix = "mail/";
2201 $trash_folder = "Trash";
2202 $sent_folder = "Sent";
2203 $draft_folder = "Drafts";
2204 $show_prefix_option = true;
2205 $default_sub_of_inbox = false;
2206 $show_contain_subfolders_option = true;
dbcc5ca3 2207 $optional_delimiter = "/";
3a94810f 2208 $disp_default_folder_prefix = $default_folder_prefix;
2209
a93b12ba 2210 $continue = 1;
2211 } elsif ($server eq "exchange") {
dbcc5ca3 2212 $imap_server_type = "exchange";
3a94810f 2213 $default_folder_prefix = "";
2214 $default_sub_of_inbox = true;
2215 $trash_folder = "INBOX/Deleted Items";
2216 $sent_folder = "INBOX/Sent Items";
2217 $drafts_folder = "INBOX/Drafts";
2218 $show_prefix_option = false;
2219 $show_contain_subfolders_option = false;
dbcc5ca3 2220 $optional_delimiter = "detect";
3a94810f 2221 $disp_default_folder_prefix = "<none>";
612eda0a 2222
3a94810f 2223 $continue = 1;
a93b12ba 2224 } elsif ($server eq "courier") {
dbcc5ca3 2225 $imap_server_type = "courier";
0f529285 2226 $default_folder_prefix = "INBOX.";
3a94810f 2227 $trash_folder = "Trash";
2228 $sent_folder = "Sent";
2229 $draft_folder = "Drafts";
0f529285 2230 $show_prefix_option = false;
3a94810f 2231 $default_sub_of_inbox = false;
0f529285 2232 $show_contain_subfolders_option = false;
dbcc5ca3 2233 $optional_delimiter = ".";
3a94810f 2234 $disp_default_folder_prefix = $default_folder_prefix;
612eda0a 2235
a93b12ba 2236 $continue = 1;
3a94810f 2237 } elsif ($server eq "quit") {
2238 $continue = 1;
a93b12ba 2239 } else {
3a94810f 2240 $disp_default_folder_prefix = $default_folder_prefix;
a93b12ba 2241 print "Unrecognized server: $server\n";
3a94810f 2242 print "\n";
a93b12ba 2243 }
3a94810f 2244
dbcc5ca3 2245 print " imap_server_type = $imap_server_type\n";
3a94810f 2246 print " default_folder_prefix = $disp_default_folder_prefix\n";
2247 print " trash_folder = $trash_folder\n";
2248 print " sent_folder = $sent_folder\n";
2249 print " draft_folder = $draft_folder\n";
2250 print " show_prefix_option = $show_prefix_option\n";
2251 print " default_sub_of_inbox = $default_sub_of_inbox\n";
2252 print "show_contain_subfolders_option = $show_contain_subfolders_option\n";
dbcc5ca3 2253 print " optional_delimiter = $optional_delimiter\n";
a93b12ba 2254 }
c4809aca 2255 print "\nPress any key to continue...";
2256 $tmp = <STDIN>;
a93b12ba 2257}