* @copyright 2001 - 2011 Ampache.org * @license http://opensource.org/licenses/gpl-2.0 GPLv2 * @version PHP 5.2 * @link http://www.ampache.org/ * @since File available since Release 1.0 */ require_once '../lib/init.php'; if (!Access::check('interface','75')) { access_denied(); exit(); } show_header(); // Action switch switch ($_REQUEST['action']) { case 'send_mail': if (Config::get('demo_mode')) { access_denied(); exit; } // Multi-byte Character Mail if(function_exists('mb_language')) { ini_set("mbstring.internal_encoding","UTF-8"); mb_language("uni"); } $mailer = new AmpacheMail(); // Set the vars on the object $mailer->subject = scrub_in($_REQUEST['subject']); $mailer->message = scrub_in($_REQUEST['message']); if ($_REQUEST['from'] == 'system') { $mailer->set_default_sender(); } else { $mailer->sender = $GLOBALS['user']->email; $mailer->sender_name = $GLOBALS['user']->fullname; } if($mailer->send_to_group($_REQUEST['to'])) { $title = _('E-mail Sent'); $body = _('Your E-mail was successfully sent.'); } else { $title = _('E-mail Not Sent'); $body = _('Your E-mail was not sent.'); } $url = Config::get('web_path') . '/admin/mail.php'; show_confirmation($title,$body,$url); break; default: require_once Config::get('prefix') . '/templates/show_mail_users.inc.php'; break; } // end switch show_footer(); ?>