<?php
+
/**
* SquirrelMail NewMail plugin
*
* Script loads user's media file.
+ *
+ * @copyright © 2001-2007 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package plugins
* @subpackage newmail
*/
/**
- * define SM_PATH
+ * Path for SquirrelMail required files.
* @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');
$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) {
} // 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