PHP 5.3 deprecated ereg() function (#2820952)
[squirrelmail.git] / plugins / newmail / loadfile.php
index 16538c26fe012620adbbc61bdf88dd6b9103b951..2ed720d9a19d71cbef523de69c479bff6de8132f 100644 (file)
@@ -1,21 +1,22 @@
 <?php
 <?php
+
 /**
  * SquirrelMail NewMail plugin
  *
  * Script loads user's media file.
 /**
  * SquirrelMail NewMail plugin
  *
  * Script loads user's media file.
+ *
+ * @copyright &copy; 2001-2009 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
  * @subpackage newmail
  */
 
 /**
  * @version $Id$
  * @package plugins
  * @subpackage newmail
  */
 
 /**
- * define SM_PATH
+ * Path for SquirrelMail required files.
  * @ignore
  */
  * @ignore
  */
-define('SM_PATH','../../');
-
-/** Load squirrelmail functions */
-include_once(SM_PATH . 'include/validate.php');
+require('../../include/init.php');
 /** Load plugin functions */
 include_once(SM_PATH . 'plugins/newmail/functions.php');
 
 /** Load plugin functions */
 include_once(SM_PATH . 'plugins/newmail/functions.php');
 
@@ -28,7 +29,7 @@ $newmail_userfile_type=getPref($data_dir,$username,'newmail_userfile_type',false
 
 $newmail_userfile_location=getHashedFile($username, $data_dir, $username . '.sound');
 
 
 $newmail_userfile_location=getHashedFile($username, $data_dir, $username . '.sound');
 
-if ($newmail_userfile_type!=false && file_exists($newmail_userfile_location)) {
+if ($newmail_uploadsounds && $newmail_userfile_type!=false && file_exists($newmail_userfile_location)) {
     // open media file
     $newmail_userfile_handle = fopen($newmail_userfile_location,'rb');
     if ($newmail_userfile_handle) {
     // open media file
     $newmail_userfile_handle = fopen($newmail_userfile_location,'rb');
     if ($newmail_userfile_handle) {
@@ -79,4 +80,3 @@ if ($newmail_userfile_type!=false && file_exists($newmail_userfile_location)) {
     } // failed to open userfile
 } // userfile is missing or preferences don't store file type.
 // maybe we should send some error code
     } // failed to open userfile
 } // userfile is missing or preferences don't store file type.
 // maybe we should send some error code
-?>
\ No newline at end of file