<?php

/*
  MailBeez Automatic Trigger Email Campaigns
  http://www.mailbeez.com

  Copyright (c) 2010, 2011 MailBeez

  inspired and in parts based on
  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License

  v2.9.2

 */

///////////////////////////////////////////////////////////////////////////////
///																			 //
///                 MailBeez Core file - do not edit                         //
///                                                                          //
///////////////////////////////////////////////////////////////////////////////

// config_admin_rights must be installed
function mh_check_admin_rights($class)
{
    if (!file_exists(MH_DIR_CONFIG . 'config_admin_rights.php')) {
        return true;
    }
    require_once(MH_DIR_CONFIG . 'config_admin_rights.php');
    if (class_exists('config_admin_rights')) {
        $config_admin_rights = new config_admin_rights;
        // check admin module rights
        if (class_exists($class)) {
            if (is_object($GLOBALS[$class])) {
                list($admin_rights, $other_value) = $config_admin_rights->check_admin_rights($GLOBALS[$class]->module, $GLOBALS[$class]->code);
                return $admin_rights;
            }
        }
    }
    return true;
}

// config_admin_rights must be installed
function mh_check_admin_rights_hook($module, $code, $hook)
{
    if (!file_exists(MH_DIR_CONFIG . 'config_admin_rights.php')) {
        return array(true, '');
    }
    require_once(MH_DIR_CONFIG . 'config_admin_rights.php');
    if (class_exists('config_admin_rights')) {
        $config_admin_rights = new config_admin_rights;
        return $config_admin_rights->check_admin_rights($module, $code, $hook);
    }
    return array(true, '');
}

