<?php

@( (bool)FALSE === strpos( $_SERVER['REQUEST_URI'], basename( __FILE__ ) ) ) OR exit( '!! ACCESS DENIED !!' );
error_reporting( _E_VALUE );


/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | myPHPNuke Version 188_8 RC2                                          |
// +----------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
// +----------------------------------------------------------------------+
// | Support: http://myphpnuke.com/                                       |
// +----------------------------------------------------------------------+
// | Author: myPHPNuke Dev Team                                           |
// +----------------------------------------------------------------------+
// | Copyright: © 2001-2004 myPHPNuke Dev Team                            |
// +----------------------------------------------------------------------+
// $Id: main.php,v 1.5.2.5 2004/08/15 12:58:17 kirilt Exp $


checkAccess( 'user', NULL, TRUE );

global $hlpfile;
$hlpfile = getHelpFile("email.htm","myphpnuke");

@( include_once _DP_ADMIN_ . 'emailuser/email_user.php' )
  OR goBack( translate( 'Include Error' ) );

if (!isset($op))
{
    $op = null;
}

switch ($op){

    case translate('Send'):
        if (!isset($html))
        {
            $html = null;
        }

        if (!isset($newsletter))
        {
            $newsletter = null;
        }

        send_email_to_user($username, $from, $subject, $message, $newsletter, $html);
        break;

    case translate('Preview'):
        include('./header.php');
        preview_mail($username, $from, $subject, $message, $newsletter, $html);
        include('./footer.php');
        break;

    case "email_user":
        include("header.$phpEx");
        admin_menu($hlpfile);
        echo "<br>";
        email_user($uname);
        include("footer.$phpEx");
        break;

    case "html_options":
        include("header.$phpEx");
        admin_menu($hlpfile);
        echo "<br>";
        html_options();
        include("footer.$phpEx");
        break;

    Default:
        include("header.$phpEx");
        admin_menu($hlpfile);
        echo "<br>";
        email_user();
        echo "<br>";
        include("footer.$phpEx");
        break;

}


?>
