- $WHT = "";
- $NRM = "";
- $config_use_color = 2;
-}
-
-while (($command ne "q") && ($command ne "Q")) {
- system "clear";
- print $WHT."SquirrelMail Configuration : ".$NRM;
- if ($config == 1) { print "Read: config.php"; }
- elsif ($config == 2) { print "Read: config_default.php"; }
- print "\n";
- print "---------------------------------------------------------\n";
-
- if ($menu == 0) {
- print $WHT."Main Menu --\n".$NRM;
- print "1. Organization Preferences\n";
- print "2. Server Settings\n";
- print "3. Folder Defaults\n";
- print "4. General Options\n";
- print "5. Themes\n";
- print "6. Address Books (LDAP)\n";
- print "7. Message of the Day (MOTD)\n";
- print "8. Plugins\n";
- print "\n";
- print "D. Set pre-defined settings for specific IMAP servers\n";
- print "\n";
- } elsif ($menu == 1) {
- print $WHT."Organization Preferences\n".$NRM;
- print "1. Organization Name : $WHT$org_name$NRM\n";
- print "2. Organization Logo : $WHT$org_logo$NRM\n";
- print "3. Organization Title : $WHT$org_title$NRM\n";
- print "4. Signout Page : $WHT$signout_page$NRM\n";
- print "5. Default Language : $WHT$squirrelmail_default_language$NRM\n";
- print "\n";
- print "R Return to Main Menu\n";
- } elsif ($menu == 2) {
- print $WHT."Server Settings\n".$NRM;
- print "1. Domain : $WHT$domain$NRM\n";
- print "2. IMAP Server : $WHT$imapServerAddress$NRM\n";
- print "3. IMAP Port : $WHT$imapPort$NRM\n";
- print "4. Use Sendmail/SMTP : $WHT";
- if ($useSendmail eq "true") {
- print "Sendmail";
- } else {
- print "SMTP";
- }
- print "$NRM\n";
- if ($useSendmail eq "true") {
- print "5. Sendmail Path : $WHT$sendmail_path$NRM\n";
- } else {
- print "6. SMTP Server : $WHT$smtpServerAddress$NRM\n";
- print "7. SMTP Port : $WHT$smtpPort$NRM\n";
- print "8. Authenticated SMTP : $WHT$use_authenticated_smtp$NRM\n";
- }
- print "9. Server : $WHT$imap_server_type$NRM\n";
- print "10. Invert Time : $WHT$invert_time$NRM\n";
- print "11. Delimiter : $WHT$optional_delimiter$NRM\n";
- print "\n";
- print "R Return to Main Menu\n";
- } elsif ($menu == 3) {
- print $WHT."Folder Defaults\n".$NRM;
- print "1. Default Folder Prefix : $WHT$default_folder_prefix$NRM\n";
- print "2. Show Folder Prefix Option : $WHT$show_prefix_option$NRM\n";
- print "3. Trash Folder : $WHT$trash_folder$NRM\n";
- print "4. Sent Folder : $WHT$sent_folder$NRM\n";
- print "5. By default, move to trash : $WHT$default_move_to_trash$NRM\n";
- print "6. By default, move to sent : $WHT$default_move_to_sent$NRM\n";
- print "7. List Special Folders First : $WHT$list_special_folders_first$NRM\n";
- print "8. Show Special Folders Color : $WHT$use_special_folder_color$NRM\n";
- print "9. Auto Expunge : $WHT$auto_expunge$NRM\n";
- print "10. Default Sub. of INBOX : $WHT$default_sub_of_inbox$NRM\n";
- print "11. Show 'Contain Sub.' Option : $WHT$show_contain_subfolders_option$NRM\n";
- print "12. Default Unseen Notify : $WHT$default_unseen_notify$NRM\n";
- print "13. Default Unseen Type : $WHT$default_unseen_type$NRM\n";
- print "14. Auto create Sent and Trash : $WHT$auto_create_special$NRM\n";
- print "\n";
- print "R Return to Main Menu\n";
- } elsif ($menu == 4) {
- print $WHT."General Options\n".$NRM;
- print "1. Default Charset : $WHT$default_charset$NRM\n";
- print "2. Data Directory : $WHT$data_dir$NRM\n";
- print "3. Attachment Directory : $WHT$attachment_dir$NRM\n";
- print "4. Default Left Size : $WHT$default_left_size$NRM\n";
- print "5. Usernames in Lowercase : $WHT$force_username_lowercase$NRM\n";
- print "\n";
- print "R Return to Main Menu\n";
- } elsif ($menu == 5) {
- print $WHT."Themes\n".$NRM;
- print "1. Change Themes\n";
- for ($count = 0; $count <= $#theme_name; $count++) {
- print " > $theme_name[$count]\n";
- }
- print "2. CSS File : $WHT$theme_css$NRM\n";
- print "\n";
- print "R Return to Main Menu\n";
- } elsif ($menu == 6) {
- print $WHT."Address Books (LDAP)\n".$NRM;
- print "1. Change Servers\n";
- for ($count = 0; $count <= $#ldap_host; $count++) {
- print " > $ldap_host[$count]\n";
- }
- print "2. Use Javascript Address Book Search : $WHT$default_use_javascript_addr_book$NRM\n";
- print "\n";
- print "R Return to Main Menu\n";
- } elsif ($menu == 7) {
- print $WHT."Message of the Day (MOTD)\n".$NRM;
- print "\n$motd\n";
- print "\n";
- print "1 Edit the MOTD\n";
- print "\n";
- print "R Return to Main Menu\n";
- } elsif ($menu == 8) {
- print $WHT."Plugins\n".$NRM;
- print " Installed Plugins\n";
- $num = 0;
- for ($count = 0; $count <= $#plugins; $count++) {
- $num = $count + 1;
- print " $num. $plugins[$count]\n";
- }
- print "\n Available Plugins:\n";
- opendir(DIR, "../plugins");
- @files = readdir(DIR);
- $pos=0;
- @unused_plugins = ();
- for ($i=0; $i <= $#files; $i++) {
- if ( -d "../plugins/" . $files[$i] &&
- $files[$i] !~ /^\./ && $files[$i] ne "CVS") {
- $match = 0;
- for ($k=0; $k<=$#plugins; $k++) {
- if ($plugins[$k] eq $files[$i]) {
- $match = 1;
- }
+ $WHT = "";
+ $NRM = "";
+ $config_use_color = 2;
+}
+
+while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
+ system "clear";
+ print $WHT. "SquirrelMail Configuration : " . $NRM;
+ if ( $config == 1 ) { print "Read: config.php"; }
+ elsif ( $config == 2 ) { print "Read: config_default.php"; }
+ print " ($print_config_version)\n";
+ print "---------------------------------------------------------\n";
+
+ if ( $menu == 0 ) {
+ print $WHT. "Main Menu --\n" . $NRM;
+ print "1. Organization Preferences\n";
+ print "2. Server Settings\n";
+ print "3. Folder Defaults\n";
+ print "4. General Options\n";
+ print "5. Themes\n";
+ print "6. Address Books (LDAP)\n";
+ print "7. Message of the Day (MOTD)\n";
+ print "8. Plugins\n";
+ print "9. Database\n";
+ print "\n";
+ print "D. Set pre-defined settings for specific IMAP servers\n";
+ print "\n";
+ } elsif ( $menu == 1 ) {
+ print $WHT. "Organization Preferences\n" . $NRM;
+ print "1. Organization Name : $WHT$org_name$NRM\n";
+ print "2. Organization Logo : $WHT$org_logo$NRM\n";
+ print "3. Org. Logo Width/Height : $WHT($org_logo_width/$org_logo_height)$NRM\n";
+ print "4. Organization Title : $WHT$org_title$NRM\n";
+ print "5. Signout Page : $WHT$signout_page$NRM\n";
+ print "6. Default Language : $WHT$squirrelmail_default_language$NRM\n";
+ print "7. Top Frame : $WHT$frame_top$NRM\n";
+ print "8. Provider link : $WHT$provider_uri$NRM\n";
+ print "9. Provider name : $WHT$provider_name$NRM\n";
+
+ print "\n";
+ print "R Return to Main Menu\n";
+ } elsif ( $menu == 2 ) {
+ print $WHT. "Server Settings\n\n" . $NRM;
+ print $WHT . "General" . $NRM . "\n";
+ print "-------\n";
+ print "1. Domain : $WHT$domain$NRM\n";
+ print "2. Invert Time : $WHT$invert_time$NRM\n";
+ print "3. Sendmail or SMTP : $WHT";
+ if ( lc($useSendmail) eq "true" ) {
+ print "Sendmail";
+ } else {
+ print "SMTP";
+ }
+ print "$NRM\n";
+ print "\n";
+
+ if ( $show_imap_settings ) {
+ print $WHT . "IMAP Settings". $NRM . "\n--------------\n";
+ print "4. IMAP Server : $WHT$imapServerAddress$NRM\n";
+ print "5. IMAP Port : $WHT$imapPort$NRM\n";
+ print "6. Authentication type : $WHT$imap_auth_mech$NRM\n";
+ print "7. Secure IMAP (TLS) : $WHT$use_imap_tls$NRM\n";
+ print "8. Server software : $WHT$imap_server_type$NRM\n";
+ print "9. Delimiter : $WHT$optional_delimiter$NRM\n";
+ print "\n";
+ } elsif ( $show_smtp_settings ) {
+ if ( lc($useSendmail) eq "true" ) {
+ print $WHT . "Sendmail" . $NRM . "\n--------\n";
+ print "4. Sendmail Path : $WHT$sendmail_path$NRM\n";
+ print "\n";
+ } else {
+ print $WHT . "SMTP Settings" . $NRM . "\n-------------\n";
+ print "4. SMTP Server : $WHT$smtpServerAddress$NRM\n";
+ print "5. SMTP Port : $WHT$smtpPort$NRM\n";
+ print "6. POP before SMTP : $WHT$pop_before_smtp$NRM\n";
+ print "7. SMTP Authentication : $WHT$smtp_auth_mech$NRM\n";
+ print "8. Secure SMTP (TLS) : $WHT$use_smtp_tls$NRM\n";
+ print "\n";
+ }
+ }
+
+ if ($show_imap_settings == 0) {
+ print "A. Update IMAP Settings : ";
+ print "$WHT$imapServerAddress$NRM:";
+ print "$WHT$imapPort$NRM ";
+ print "($WHT$imap_server_type$NRM)\n";
+ }
+ if ($show_smtp_settings == 0) {
+ if ( lc($useSendmail) eq "true" ) {
+ print "B. Change Sendmail Config : $WHT$sendmail_path$NRM\n";
+ } else {
+ print "B. Update SMTP Settings : ";
+ print "$WHT$smtpServerAddress$NRM:";
+ print "$WHT$smtpPort$NRM\n";
+ }
+ }
+ if ( $show_smtp_settings || $show_imap_settings )
+ {
+ print "H. Hide " .
+ ($show_imap_settings ? "IMAP Server" :
+ (lc($useSendmail) eq "true") ? "Sendmail" : "SMTP") . " Settings\n";
+ }
+
+ print "\n";
+ print "R Return to Main Menu\n";
+ } elsif ( $menu == 3 ) {
+ print $WHT. "Folder Defaults\n" . $NRM;
+ print "1. Default Folder Prefix : $WHT$default_folder_prefix$NRM\n";
+ print "2. Show Folder Prefix Option : $WHT$show_prefix_option$NRM\n";
+ print "3. Trash Folder : $WHT$trash_folder$NRM\n";
+ print "4. Sent Folder : $WHT$sent_folder$NRM\n";
+ print "5. Drafts Folder : $WHT$draft_folder$NRM\n";
+ print "6. By default, move to trash : $WHT$default_move_to_trash$NRM\n";
+ print "7. By default, move to sent : $WHT$default_move_to_sent$NRM\n";
+ print "8. By default, save as draft : $WHT$default_save_as_draft$NRM\n";
+ print "9. List Special Folders First : $WHT$list_special_folders_first$NRM\n";
+ print "10. Show Special Folders Color : $WHT$use_special_folder_color$NRM\n";
+ print "11. Auto Expunge : $WHT$auto_expunge$NRM\n";
+ print "12. Default Sub. of INBOX : $WHT$default_sub_of_inbox$NRM\n";
+ print "13. Show 'Contain Sub.' Option : $WHT$show_contain_subfolders_option$NRM\n";
+ print "14. Default Unseen Notify : $WHT$default_unseen_notify$NRM\n";
+ print "15. Default Unseen Type : $WHT$default_unseen_type$NRM\n";
+ print "16. Auto Create Special Folders : $WHT$auto_create_special$NRM\n";
+ print "17. Don't move folders into Trash : $WHT$delete_folder$NRM\n";
+ print "18. Enable /NoSelect folder fix : $WHT$noselect_fix_enable$NRM\n";
+ print "\n";
+ print "R Return to Main Menu\n";
+ } elsif ( $menu == 4 ) {
+ print $WHT. "General Options\n" . $NRM;
+ print "1. Default Charset : $WHT$default_charset$NRM\n";
+ print "2. Data Directory : $WHT$data_dir$NRM\n";
+ print "3. Attachment Directory : $WHT$attachment_dir$NRM\n";
+ print "4. Directory Hash Level : $WHT$dir_hash_level$NRM\n";
+ print "5. Default Left Size : $WHT$default_left_size$NRM\n";
+ print "6. Usernames in Lowercase : $WHT$force_username_lowercase$NRM\n";
+ print "7. Allow use of priority : $WHT$default_use_priority$NRM\n";
+ print "8. Hide SM attributions : $WHT$hide_sm_attributions$NRM\n";
+ print "9. Allow use of receipts : $WHT$default_use_mdn$NRM\n";
+ print "10. Allow editing of identity : $WHT$edit_identity$NRM\n";
+ print "11. Allow server thread sort : $WHT$allow_thread_sort$NRM\n";
+ print "12. Allow server-side sorting : $WHT$allow_server_sort$NRM\n";
+ if ( lc($edit_identity) eq "false" ) {
+ print "13. Allow editing of name : $WHT$edit_name$NRM\n";
+ }
+ print "14. Allow server charset search : $WHT$allow_charset_search$NRM\n";
+ print "15. Enable UID support : $WHT$uid_support$NRM\n";
+ print "\n";
+ print "R Return to Main Menu\n";
+ } elsif ( $menu == 5 ) {
+ print $WHT. "Themes\n" . $NRM;
+ print "1. Change Themes\n";
+ for ( $count = 0 ; $count <= $#theme_name ; $count++ ) {
+ print " > $theme_name[$count]\n";
+ }
+ print "2. CSS File : $WHT$theme_css$NRM\n";
+ print "\n";
+ print "R Return to Main Menu\n";
+ } elsif ( $menu == 6 ) {
+ print $WHT. "Address Books (LDAP)\n" . $NRM;
+ print "1. Change Servers\n";
+ for ( $count = 0 ; $count <= $#ldap_host ; $count++ ) {
+ print " > $ldap_host[$count]\n";
+ }
+ print
+ "2. Use Javascript Address Book Search : $WHT$default_use_javascript_addr_book$NRM\n";
+ print "\n";
+ print "R Return to Main Menu\n";
+ } elsif ( $menu == 7 ) {
+ print $WHT. "Message of the Day (MOTD)\n" . $NRM;
+ print "\n$motd\n";
+ print "\n";
+ print "1 Edit the MOTD\n";
+ print "\n";
+ print "R Return to Main Menu\n";
+ } elsif ( $menu == 8 ) {
+ print $WHT. "Plugins\n" . $NRM;
+ print " Installed Plugins\n";
+ $num = 0;
+ for ( $count = 0 ; $count <= $#plugins ; $count++ ) {
+ $num = $count + 1;
+ print " $num. $plugins[$count]\n";
+ }
+ print "\n Available Plugins:\n";
+ opendir( DIR, "../plugins" );
+ @files = readdir(DIR);
+ $pos = 0;
+ @unused_plugins = ();
+ for ( $i = 0 ; $i <= $#files ; $i++ ) {
+ if ( -d "../plugins/" . $files[$i] && $files[$i] !~ /^\./ && $files[$i] ne "CVS" ) {
+ $match = 0;
+ for ( $k = 0 ; $k <= $#plugins ; $k++ ) {
+ if ( $plugins[$k] eq $files[$i] ) {
+ $match = 1;
+ }
+ }
+ if ( $match == 0 ) {
+ $unused_plugins[$pos] = $files[$i];
+ $pos++;
+ }