Minor patch allowing admin to disable use of $org_logo on login page.
authortassium <tassium@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 3 Jan 2003 14:14:31 +0000 (14:14 +0000)
committertassium <tassium@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 3 Jan 2003 14:14:31 +0000 (14:14 +0000)
Thanks to O'Shaughnessy Evans <shaug-sqm@wumpus.org> for the patch.

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

src/login.php

index 3d0f0159fd145164b8fd556755b5dd713d5d1a83..d60f77d282b79b3f2dca0fa4198235cd14b5bd25 100644 (file)
@@ -71,13 +71,18 @@ do_hook('login_top');
 
 $loginname_value = (isset($loginname) ? htmlspecialchars($loginname) : '');
 
-/* Display width and height like good little people */
-$width_and_height = '';
-if (isset($org_logo_width) && is_numeric($org_logo_width) && $org_logo_width>0) {
-    $width_and_height = " width=\"$org_logo_width\"";
-}
-if (isset($org_logo_height) && is_numeric($org_logo_height) && $org_logo_height>0) {
-    $width_and_height .= " height=\"$org_logo_height\"";
+/* If they don't have a logo, don't bother.. */
+if (isset($org_logo) && $org_logo) {
+    /* Display width and height like good little people */
+    $width_and_height = '';
+    if (isset($org_logo_width) && is_numeric($org_logo_width) &&
+     $org_logo_width>0) {
+        $width_and_height = " width=\"$org_logo_width\"";
+    }
+    if (isset($org_logo_height) && is_numeric($org_logo_height) &&
+     $org_logo_height>0) {
+        $width_and_height .= " height=\"$org_logo_height\"";
+    }
 }
 
 echo "\n" . '<form action="redirect.php" method="post">' . "\n" .
@@ -85,8 +90,11 @@ html_tag( 'table',
     html_tag( 'tr',
         html_tag( 'td',
             '<center>'.
-            '<img src="' . $org_logo . '" alt="' . sprintf(_("%s Logo"), $org_name) .'"' .
-            $width_and_height .' /><br />' . "\n".
+            ( isset($org_logo) && $org_logo
+              ? '<img src="' . $org_logo . '" alt="' .
+                sprintf(_("%s Logo"), $org_name) .'"' . $width_and_height .
+                ' /><br />' . "\n"
+              : '' ).
             ( $hide_sm_attributions ? '' :
             '<small>' . sprintf (_("SquirrelMail version %s"), $version) . '<br />' ."\n".
             '  ' . _("By the SquirrelMail Development Team") . '<br /></small>' . "\n" ) .