This closes my feature request #474658
authorantipode <antipode@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 11 Nov 2001 19:31:18 +0000 (19:31 +0000)
committerantipode <antipode@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 11 Nov 2001 19:31:18 +0000 (19:31 +0000)
- Added option 7 under "General Options" in conf.pl
- In the login screen, this option hides attribution to the SM development
  team.
- In every page's header, this option hides the link to SM's website.
- By default, this option ($hide_sm_attributions) is set to FALSE,
  so the attributions *are* displayed by default.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1728 7612ce4b-ef26-0410-bec9-ea0150e637f0

config/conf.pl
functions/page_header.php
src/login.php

index 058d627f5811e638ddeea04ed1b872e6f98fa59c..12fa4c77fcafc0f7e53bd372e793c5f115301fbf 100755 (executable)
@@ -35,7 +35,7 @@ if ( -e "config.php") {
                $o[1] =~ s/[\n|\r]//g;
                $o[1] =~ s/\";\s*$//;
                $o[1] =~ s/;$//;
-               $o[1] =~ s/^"//;
+               $o[1] =~ s/^\"//;
 
                $config_version = $o[1];
                close (FILE);
@@ -86,7 +86,7 @@ if ( -e "config.php") {
                $o[1] =~ s/[\n|\r]//g;
                $o[1] =~ s/\";\s*$//;
                $o[1] =~ s/;$//;
-               $o[1] =~ s/^"//;
+               $o[1] =~ s/^\"//;
 
                $config_version = $o[1];
                close (FILE);
@@ -251,6 +251,9 @@ if (!$auto_create_special) {
 if(!$default_use_priority) {
         $default_use_priority = "true";
 }
+if(!$hide_sm_attributions) {
+        $hide_sm_attributions = "false";
+}
 
 #####################################################################################
 if ($config_use_color == 1) {
@@ -344,6 +347,7 @@ while (($command ne "q") && ($command ne "Q")) {
       print "4.  Default Left Size      : $WHT$default_left_size$NRM\n";
       print "5.  Usernames in Lowercase : $WHT$force_username_lowercase$NRM\n";
       print "6.  Allow use of priority  : $WHT$default_use_priority$NRM\n";
+      print "7.  Hide SM attributions   : $WHT$hide_sm_attributions$NRM\n";
       print "\n";
       print "R   Return to Main Menu\n";
    } elsif ($menu == 5) {
@@ -502,6 +506,7 @@ while (($command ne "q") && ($command ne "Q")) {
          elsif ($command == 4) { $default_left_size        = command35 (); }
         elsif ($command == 5) { $force_username_lowercase = command36 (); }
         elsif ($command == 6) { $default_use_priority     = command37 (); }
+         elsif ($command == 7) { $hide_sm_attributions     = command38 (); }
       } elsif ($menu == 5) {
          if    ($command == 1) { command41 (); }
          elsif ($command == 2) { $theme_css = command42 (); }
@@ -1380,6 +1385,25 @@ sub command37 {
 }
                                                         
 
+sub command38 {
+   print "";
+   print "\n";
+   
+   if ($default_hide_attribution eq "true") {
+      $default_value = "y";
+   } else {
+      $default_value = "n";
+   }
+   
+   print "Hide SM attributions (y/n) [$WHT$default_value$NRM]: $WHT";
+      $new_show = <STDIN>;
+      if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
+         return "true";
+      }
+      return "false";
+}
+
+
 sub command41 {
    print "\nNow we will define the themes that you wish to use.  If you have added\n";
    print "a theme of your own, just follow the instructions (?) about how to add\n";
@@ -1772,13 +1796,14 @@ sub save_data {
 
    print FILE "\tglobal \$default_charset, \$data_dir, \$attachment_dir;\n";
    print FILE "\tglobal \$default_left_size, \$force_username_lowercase;\n";
-   print FILE "\tglobal \$default_use_priority;\n";
+   print FILE "\tglobal \$default_use_priority, \$hide_sm_attributions;\n";
    print FILE "\t\$default_charset          = \"$default_charset\";\n";
    print FILE "\t\$data_dir                 = \"$data_dir\";\n";
    print FILE "\t\$attachment_dir           = \"$attachment_dir\";\n";
    print FILE "\t\$default_left_size        =  $default_left_size;\n";
    print FILE "\t\$force_username_lowercase = $force_username_lowercase;\n";
    print FILE "\t\$default_use_priority     = $default_use_priority;\n";
+   print FILE "\t\$hide_sm_attributions     = $hide_sm_attributions;\n";
 
    print FILE "\n";
 
index 98b916884ff95d3791e2c3b5bcc173c55eff3ff7..ff964481c186dfa03ef8461aa219c31adaaac23d 100644 (file)
@@ -38,7 +38,7 @@
    }
 
    function displayPageHeader($color, $mailbox) {
-      global $delimiter;
+      global $delimiter, $hide_sm_attributions;
       displayHtmlHeader ();
 
       echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\" onLoad='if ( ( document.forms.length > 0 ) && ( document.forms[0].elements[0].type == \"text\" ) ) { document.forms[0].elements[0].focus(); }'>\n\n";
@@ -74,7 +74,8 @@
       do_hook("menuline");
 
       echo "      </TD><TD ALIGN=right>\n";
-      echo "         <A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n";
+      echo ($hide_sm_attributions ? '&nbsp;' :
+            "<A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n");
       echo "      </TD>\n";
       echo "   </TR>\n";
       echo "</TABLE>\n\n";
index 53e1625802d7cc8e59b7fa2f820b5e5e674da3d5..c1b91df648440c68ba694008e305c48c64fbcf67 100644 (file)
 
     $loginname_value = (isset($loginname) ? htmlspecialchars($loginname) : '');
 
-    echo "<CENTER><SMALL>".
+    echo "<CENTER>".
          "  <IMG SRC=\"$org_logo\"><BR>\n".
-         '  ' . sprintf (_("SquirrelMail version %s"), $version) . "<BR>\n".
-         '  ' . _("By the SquirrelMail Development Team") . "<BR>\n".
-         "</SMALL><CENTER>\n".
+         ( $hide_sm_attributions ? '' :
+           '<SMALL>' . sprintf (_("SquirrelMail version %s"), $version) . "<BR>\n".
+           '  ' . _("By the SquirrelMail Development Team") . "<BR></SMALL>\n" ) .
+         "</CENTER>\n".
 
+         "<CENTER>\n".
          "<TABLE COLS=1 WIDTH=350>\n".
          "   <TR><TD BGCOLOR=#DCDCDC>\n".
          '      <B><CENTER>' . sprintf (_("%s Login"), $org_name) . "</CENTER></B>\n".
          "   <TR><TD>\n".
          '      <CENTER><INPUT TYPE=SUBMIT VALUE="' . _("Login") . "\"></CENTER>\n".
          "   </TD></TR>\n".
-         "</TABLE>\n";
+         "</TABLE>\n".
+         "</CENTER>\n";
 
     do_hook('login_form');
     echo "</FORM>\n";
     do_hook('login_bottom');
     echo "</BODY>\n".
          "</HTML>\n";
-?>
\ No newline at end of file
+?>