<?php
// $Id: website_widget.php,v 1.7 2007/10/08 19:59:44 bwoolley Exp $
// +----------------------------------------------------------------------+
// | ModernBill [TM] .:. Client Billing System                            |
// +----------------------------------------------------------------------+
// | Copyright (c) 2001-2006 ModernGigabyte, LLC                          |
// +----------------------------------------------------------------------+
// | This source file is subject to the ModernBill End User License       |
// | Agreement (EULA), that is bundled with this package in the file      |
// | LICENSE, and is available at through the world-wide-web at           |
// | http://www.modernbill.com/extranet/LICENSE.txt                       |
// | If you did not receive a copy of the ModernBill license and are      |
// | unable to obtain it through the world-wide-web, please send a note   |
// | to license@modernbill.com so we can email you a copy immediately.    |
// +----------------------------------------------------------------------+
// | Authors: ModernGigabyte, LLC <info@moderngigabyte.com>               |
// | Support: http://www.modernsupport.com/modernbill/                    |
// +----------------------------------------------------------------------+
// | ModernGigabyte and ModernBill are trademarks of ModernGigabyte, LLC. |
// +----------------------------------------------------------------------+

chdir(dirname(__FILE__));
require_once(dirname(__FILE__)."/path.php");
if (!$_REQUEST["sid"]){
	if ($_REQUEST["mb_shopping_session"]){
		$_REQUEST["sid"] = $_REQUEST["mb_shopping_session"];
	}
}
if (!$_REQUEST["wwid"]){
	$_REQUEST["wwid"] = 1;
}
if (!file_exists(mb_path("/app-modernbill-order/config.php"))) {
    die("<tt>Error: Unable to locate system files.</tt>");
} else {
    require mb_path("/app-modernbill-order/config.php");
}
//define("ACCESS_HASH", $CONF["remoteAccessHash"]);
define("INTERNAL_ADMIN", "order");

define("DEBUG", 0);


// define the access type
define("ACCESS_TYPE", NON_LOGIN_APP);

require_once mb_path("/lib-tk/include/common.php");
require mb_path("/app-modernbill-order/config.php");

if ($_REQUEST["mb_shopping_session"]!=$_REQUEST["sid"]){
	if (!headers_sent())setcookie("mb_shopping_session", $_REQUEST["sid"], (24*60*60*30)+time(), "/");
	$_REQUEST["mb_shopping_session"] = $_REQUEST["sid"];
}

if ((int)$_REQUEST["whoisWidget"] && (int)$_REQUEST["multiDomain"]){
	dispatchAction("shopping", "ShowMultiDomainWhois", 2);
} elseif ((int)$_REQUEST["whoisWidget"]){
	dispatchAction("shopping", "AddCartDomain", 2);
} else {
	dispatchAction("website_widgets", "ShowWebsiteWidget", 2);
}
