From a64f47e7fb6a11fb1896a85e15ada6e9a621466a Mon Sep 17 00:00:00 2001 From: tassium Date: Mon, 18 Nov 2002 19:02:54 +0000 Subject: [PATCH] Minor change to prevent the file attachment portion of the compose form from being displayed if PHP has file_uploads disabled. Also prints a warning, hopefully avoiding "Why don't I have a place to attach files?" bug reports. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4174 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/compose.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/compose.php b/src/compose.php index 57597f04..777ff239 100644 --- a/src/compose.php +++ b/src/compose.php @@ -985,6 +985,7 @@ function showInputForm ($session, $values=false) { } /* This code is for attachments */ + if ((bool) ini_get('file_uploads')) { echo ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n"; - + } // End of file_uploads if-block /* End of attachment code */ if ($compose_new_win == '1') { echo '
'."\n"; } + echo '' . "\n" . '\n" . '\n" . @@ -1051,6 +1053,14 @@ function showInputForm ($session, $values=false) { echo '\n"; echo '\n"; echo ''; + if (!(bool) ini_get('file_uploads')) { + /* File uploads are off, so we didn't show that part of the form. + To avoid bogus bug reports, tell the user why. */ + echo 'Because PHP file uploads are turned off, you can not attach files '; + echo "to this message. Please see your system administrator for details.\r\n"; + } + + do_hook('compose_bottom'); echo '' . "\n"; } -- 2.25.1