+# Theme - CSS file
+sub command42 {
+ print "You may specify a cascading style-sheet (CSS) file to be included\n";
+ print "on each html page generated by SquirrelMail. The CSS file is useful\n";
+ print "for specifying a site-wide font. If you're not familiar with CSS\n";
+ print "files, leave this blank.\n";
+ print "\n";
+ print "To clear out an existing value, just type a space for the input.\n";
+ print "\n";
+ print "[$WHT$theme_css$NRM]: $WHT";
+ $new_theme_css = <STDIN>;
+ if ($new_theme_css eq "\n") {
+ $new_theme_css = $theme_css;
+ } else {
+ $new_theme_css =~ s/[\r|\n]//g;
+ }
+ $new_theme_css =~ s/^\s*//;
+ return $new_theme_css;
+}
+
+
+sub command61 {
+ print "You can now define different LDAP servers.\n";
+ print "[ldap] command (?=help) > ";
+ $input = <STDIN>;
+ $input =~ s/[\r|\n]//g;
+ while ($input ne "d") {
+ if ($input =~ /^\s*l\s*/i) {
+ $count = 0;
+ while ($count <= $#ldap_host) {
+ print "$count. $ldap_host[$count]\n";
+ print " base: $ldap_base[$count]\n";
+ if ($ldap_charset[$count]) {
+ print " charset: $ldap_charset[$count]\n";
+ }
+ if ($ldap_port[$count]) {
+ print " port: $ldap_port[$count]\n";
+ }
+ if ($ldap_name[$count]) {
+ print " name: $ldap_name[$count]\n";
+ }
+ if ($ldap_maxrows[$count]) {
+ print " maxrows: $ldap_maxrows[$count]\n";
+ }
+ print "\n";
+ $count++;
+ }
+ } elsif ($input =~ /^\s*\+/) {
+ $sub = $#ldap_host + 1;
+
+ print "First, we need to have the hostname or the IP address where\n";
+ print "this LDAP server resides. Example: ldap.bigfoot.com\n";
+ print "hostname: ";
+ $name = <STDIN>;
+ $name =~ s/[\r|\n]//g;
+ $ldap_host[$sub] = $name;
+
+ print "\n";
+
+ print "Next, we need the server root (base dn). For this, an empty\n";
+ print "string is allowed.\n";
+ print "Example: ou=member_directory,o=netcenter.com\n";
+ print "base: ";
+ $name = <STDIN>;
+ $name =~ s/[\r|\n]//g;
+ $ldap_base[$sub] = $name;
+
+ print "\n";
+
+ print "This is the TCP/IP port number for the LDAP server. Default\n";
+ print "port is 389. This is optional. Press ENTER for default.\n";
+ print "port: ";
+ $name = <STDIN>;
+ $name =~ s/[\r|\n]//g;
+ $ldap_port[$sub] = $name;
+
+ print "\n";
+
+ print "This is the charset for the server. Default is utf-8. This\n";
+ print "is also optional. Press ENTER for default.\n";
+ print "charset: ";
+ $name = <STDIN>;
+ $name =~ s/[\r|\n]//g;
+ $ldap_charset[$sub] = $name;
+
+ print "\n";
+
+ print "This is the name for the server, used to tag the results of\n";
+ print "the search. Default it \"LDAP: hostname\". Press ENTER for default\n";
+ print "name: ";
+ $name = <STDIN>;
+ $name =~ s/[\r|\n]//g;
+ $ldap_name[$sub] = $name;
+
+ print "\n";
+
+ print "You can specify the maximum number of rows in the search result.\n";
+ print "Default is unlimited. Press ENTER for default.\n";
+ print "maxrows: ";
+ $name = <STDIN>;
+ $name =~ s/[\r|\n]//g;
+ $ldap_maxrows[$sub] = $name;
+
+ print "\n";
+
+ } elsif ($input =~ /^\s*-\s*[0-9]?/) {
+ if ($input =~ /[0-9]+\s*$/) {
+ $rem_num = $input;
+ $rem_num =~ s/^\s*-\s*//g;
+ $rem_num =~ s/\s*$//;
+ } else {
+ $rem_num = $#ldap_host;
+ }
+ $count = 0;
+ @new_ldap_host = ();
+ @new_ldap_base = ();
+ @new_ldap_port = ();
+ @new_ldap_name = ();
+ @new_ldap_charset = ();
+ @new_ldap_maxrows = ();
+ while ($count <= $#ldap_host) {
+ if ($count != $rem_num) {
+ @new_ldap_host = (@new_ldap_host, $ldap_host[$count]);
+ @new_ldap_base = (@new_ldap_base, $ldap_base[$count]);
+ @new_ldap_port = (@new_ldap_port, $ldap_port[$count]);
+ @new_ldap_name = (@new_ldap_name, $ldap_name[$count]);
+ @new_ldap_charset = (@new_ldap_charset, $ldap_charset[$count]);
+ @new_ldap_maxrows = (@new_ldap_maxrows, $ldap_maxrows[$count]);
+ }
+ $count++;
+ }
+ @ldap_host = @new_ldap_host;
+ @ldap_base = @new_ldap_base;
+ @ldap_port = @new_ldap_port;
+ @ldap_name = @new_ldap_name;
+ @ldap_charset = @new_ldap_charset;
+ @ldap_maxrows = @new_ldap_maxrows;
+ } elsif ($input =~ /^\s*\?\s*/) {
+ print ".-------------------------.\n";
+ print "| + (add host) |\n";
+ print "| - N (remove host) |\n";
+ print "| l (list hosts) |\n";
+ print "| d (done) |\n";
+ print "`-------------------------'\n";
+ }
+ print "[ldap] command (?=help) > ";
+ $input = <STDIN>;
+ $input =~ s/[\r|\n]//g;
+ }
+}
+
+sub command62 {
+ print "Some of our developers have come up with very good javascript interface\n";
+ print "for searching through address books, however, our original goals said\n";
+ print "that we would be 100% HTML. In order to make it possible to use their\n";
+ print "interface, and yet stick with our goals, we have also written a plain\n";
+ print "HTML version of the search. Here, you can choose which version to use.\n";
+ print "\n";
+ print "This is just the default value. It is also a user option that each\n";
+ print "user can configure individually\n";
+ print "\n";
+
+ if ($default_use_javascript_addr_book eq "true") {
+ $default_value = "y";
+ } else {
+ $default_use_javascript_addr_book = "false";
+ $default_value = "n";
+ }
+ print "Use javascript version by default (y/n) [$WHT$default_value$NRM]: $WHT";
+ $new_show = <STDIN>;
+ if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
+ $default_use_javascript_addr_book = "true";
+ } else {
+ $default_use_javascript_addr_book = "false";
+ }
+ return $default_use_javascript_addr_book;
+}
+