function displayErrorNotAllRequiredDataPresentInPost($missingPostParameters)
{
    $currentLocation = getCurrentLocation();
    $errorMessage = "Not all required data present missing: " . implode(",", $missingPostParameters);
    $url = addErrorMessageToUrl($currentLocation, $errorMessage);
    header("Location: {$url}");
    die("Redirecting to: {$currentLocation} not all required data present");
}
Exemple #2
0
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * MMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require_once 'modules/imaging/includes/includes.php';
require_once 'modules/imaging/includes/xmlrpc.inc.php';
require_once 'modules/imaging/includes/web_def.inc.php';
$location = getCurrentLocation();
if (isset($_POST["bconfirm"])) {
    $params = getParams();
    $item_uuid = $_POST['itemid'];
    $label = urldecode($_POST['itemlabel']);
    $ret = xmlrpc_delServiceToLocation($item_uuid, $location, $params);
    // goto images list
    if ($ret[0] and !isXMLRPCError()) {
        $str = sprintf(_T("Service <strong>%s</strong> removed from default boot menu", "imaging"), $label);
        new NotifyWidgetSuccess($str);
        // Synchronize boot menu
        $ret = xmlrpc_synchroLocation($location);
        if (isXMLRPCError()) {
            new NotifyWidgetFailure(sprintf(_T("Boot menu generation failed for package server: %s", "imaging"), implode(', ', $ret[1])));
        }
        header("Location: " . urlStrRedirect("imaging/manage/service", $params));
Exemple #3
0
		public function SetPanelSettings()
		{
			$GLOBALS['FooterScripts'] = '';

			$GLOBALS['HideLogoutLink'] = 'display: none';
			if(CustomerIsSignedIn()) {
				$GLOBALS['HideLogoutLink'] = '';
			}

			if($_SERVER['REQUEST_METHOD'] == 'POST') {
				$baseURL = getConfig('ShopPathNormal');
			}
			else {
				$baseURL = getCurrentLocation();
			}

			if(strpos($baseURL, '?') === false) {
				$baseURL .= '?';
			}
			else {
				$baseURL .= '&';
			}

			$fullSiteLink = $baseURL.'fullSite=1';
			$GLOBALS['ISC_CLASS_TEMPLATE']->assign('FullSiteLink', $fullSiteLink);

			// Show Mobile Site link
			if(canViewMobileSite()) {
				$mobileSiteURL = preg_replace('/(&)?fullSite=\d*/i', '', $baseURL);
				$GLOBALS['MobileSiteURL'] = $mobileSiteURL.'fullSite=0';
				$GLOBALS['MobileSiteLink'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('MobileSiteLink');
			}

			// Show "All prices are in [currency code]"
			$currency = GetCurrencyById($GLOBALS['CurrentCurrency']);
			if(is_array($currency) && $currency['currencycode']) {
				$GLOBALS['AllPricesAreInCurrency'] = sprintf(GetLang('AllPricesAreInCurrency'), isc_html_escape($currency['currencyname']), isc_html_escape($currency['currencycode']));
			}

			if(GetConfig('DebugMode') == 1) {
				$end_time = microtime_float();
				$GLOBALS['ScriptTime'] = number_format($end_time - ISC_START_TIME, 4);
				$GLOBALS['QueryCount'] = $GLOBALS['ISC_CLASS_DB']->NumQueries;
				if (function_exists('memory_get_peak_usage')) {
					$GLOBALS['MemoryPeak'] = "Memory usage peaked at ".Store_Number::niceSize(memory_get_peak_usage(true));
				} else {
					$GLOBALS['MemoryPeak'] = '';
				}

				if (isset($_REQUEST['debug'])) {
					$GLOBALS['QueryList'] = "<ol class='QueryList' style='font-size: 13px;'>\n";
					foreach($GLOBALS['ISC_CLASS_DB']->QueryList as $query) {
						$GLOBALS['QueryList'] .= "<li style='line-height: 1.4; margin-bottom: 4px;'>".isc_html_escape($query['Query'])." &mdash; <em>".number_format($query['ExecutionTime'], 4)."seconds</em></li>\n";
					}
					$GLOBALS['QueryList'] .= "</ol>";
				}
				$GLOBALS['DebugDetails'] = "<p>Page built in ".$GLOBALS['ScriptTime']."s with ".$GLOBALS['QueryCount']." queries. ".$GLOBALS['MemoryPeak']."</p>";
			}
			else {
				$GLOBALS['DebugDetails'] = '';
			}

			// Do we have any live chat service code to show in the footer
			$modules = GetConfig('LiveChatModules');
			if(!empty($modules)) {
				$liveChatClass = GetClass('ISC_LIVECHAT');
				$GLOBALS['LiveChatFooterCode'] = $liveChatClass->GetPageTrackingCode('footer');
			}

			// Load our whitelabel file for the front end
			require_once ISC_BASE_PATH.'/includes/whitelabel.php';

			// Load the configuration file for this template
			$poweredBy = 0;
			require_once ISC_BASE_PATH.'/templates/'.GetConfig('template').'/config.php';
			if(isset($GLOBALS['TPL_CFG']['PoweredBy'])) {
				if(!isset($GLOBALS['ISC_CFG']['TemplatePoweredByLines'][$GLOBALS['TPL_CFG']['PoweredBy']])) {
					$GLOBALS['TPL_CFG']['PoweredBy'] = 0;
				}
				$poweredBy = $GLOBALS['TPL_CFG']['PoweredBy'];
			}

			// Showing the powered by?
			$GLOBALS['PoweredBy'] = '';
			if($GLOBALS['ISC_CFG']['DisableFrontEndPoweredBy'] == false && isset($GLOBALS['ISC_CFG']['TemplatePoweredByLines'][$poweredBy])) {
				$GLOBALS['PoweredBy'] = $GLOBALS['ISC_CFG']['TemplatePoweredByLines'][$poweredBy];
			}

			if(empty($GLOBALS['OptimizerConversionScript']) && empty($GLOBALS['OptimizerTrackingScript']) && empty($GLOBALS['OptimizerControlScript'])) {
				$this->setGwoCookieCrossDomain();
			}

			$GLOBALS['SitemapURL_HTML'] = isc_html_escape(SitemapLink());
			$GLOBALS['SNIPPETS']['SitemapLink'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('SitemapLink');

			if (Interspire_TaskManager::hasTasks()) {
				// hasTasks is only implemented for Internal so this will (should) never run for Resque-based task manager
				$GLOBALS['FooterScripts'] .= Interspire_TaskManager::getTriggerHtml('json');
			}

			if (ISC_CATEGORY::areCategoryFlyoutsEnabled()) {
				// this needs to be output from php into the body since it's based on config vars
				// @todo use the stuff gaston is working on instead

				// bgiframe fixes some IE-related issues with CSS menus (like hovering over SELECT elements)
				$GLOBALS['FooterScripts'] .= '<script type="text/javascript" src="'
					. GetConfig('AppPath') . '/javascript/superfish/js/jquery.bgiframe.min.js?'
					. GetConfig('JSCacheToken') . '"></script>' . "\n";
				$GLOBALS['FooterScripts'] .= '<script type="text/javascript" src="'
					. GetConfig('AppPath') . '/javascript/superfish/js/superfish.js?'
					. GetConfig('JSCacheToken') . '"></script>' . "\n";
				$GLOBALS['FooterScripts'] .= '<script type="text/javascript">
	$(function(){
		if (typeof $.fn.superfish == "function") {
			$("ul.sf-menu").superfish({
				delay: ' . ((float)GetConfig('categoryFlyoutMouseOutDelay') * 1000) . ',
				dropShadows: ' . isc_json_encode(GetConfig('categoryFlyoutDropShadow')) . ',
				speed: "fast"
			})
			.find("ul")
			.bgIframe();
		}
	})
</script>
';
			}

			if (GetConfig('FastCartAction') == 'popup' && GetConfig('ShowCartSuggestions')) {
				$GLOBALS['SNIPPETS']['FastCartThickBoxJs'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('FastCartThickBoxJs');
			}
		}
Exemple #4
0
function SetupSSLOptions()
{
	$ShopPath = GetConfig('ShopPath');
	$GLOBALS['ISC_CFG']['ShopPathNormal'] = $ShopPath;

	$useSSL = GetConfig('UseSSL');

	// Is SSL enabled for the checkout process? If so setup the checkout links as such
	if($useSSL != SSL_NONE) {
		// determine which url we should be on
		if ($useSSL == SSL_NORMAL) {
			$ShopPathSSL = $ShopPath;
		}
		else if ($useSSL == SSL_SHARED) {
			$ShopPathSSL = GetConfig("SharedSSLPath");
		}
		elseif ($useSSL == SSL_SUBDOMAIN) {
			$ShopPathSSL = GetConfig("SubdomainSSLPath");
		}

		$ShopPathSSL = str_replace("http://", "https://", $ShopPathSSL);

		// Are we on a page that should use SSL?
		$ssl_pages = array (
			"account.php",
			"checkout.php",
			"login.php"
		);

		$uri = explode("/", $_SERVER['PHP_SELF']);
		$page = $uri[count($uri)-1];

		if (in_array($page, $ssl_pages)) {
			$ShopPath = $ShopPathSSL;
			// If we're not accessing this page via HTTPS then we need to redirect the user to the HTTPS version
			if($_SERVER['HTTPS'] == "off" && $_SERVER['REQUEST_METHOD'] == "GET") {
				$location = getCurrentLocation(true);
				// for shared ssl we need to transfer the session to the new site; append the the session token to the url
				if ($useSSL == SSL_SHARED && isset($_COOKIE['SHOP_SESSION_TOKEN']) && !isset($_GET['tk'])) {
					if(!empty($_GET)) {
						$location .= "&";
					}
					else {
						$location .= "?";
					}

					$location .= "tk=" . $_COOKIE['SHOP_SESSION_TOKEN'];
				}


				header("Location: " . $ShopPathSSL . '/' . $location);
				exit;
			}
		}

		$GLOBALS['ISC_CFG']['ShopPathSSL'] = $ShopPathSSL;
	}
	else {
		$GLOBALS['ISC_CFG']['ShopPathSSL'] = $ShopPath;
	}

	// If we're still on a HTTPS link (maybe this page requires it for a certain checkout module)
	// override the shop path with the HTTPS version
	if($_SERVER['HTTPS'] == "on") {
		$GLOBALS['ISC_CFG']['ShopPath'] = GetConfig('ShopPathSSL');
	}

	// Now that the variables are stored in the config section, we just map them back to the existing globals we had
	$GLOBALS['ShopPath'] = GetConfig('ShopPath');
	$GLOBALS['ShopPathSSL'] = GetConfig('ShopPathSSL');
	$GLOBALS['ShopPathNormal'] = GetConfig('ShopPathNormal');
}
Exemple #5
0
    $f->push(new Table());
    $f->add(new HiddenTpl("itemid"), array("value" => $id, "hide" => True));
    $f->add(new TrFormElement(_T("Label", "imaging"), new InputTpl("image_label")), array("value" => $label));
    $f->add(new TrFormElement(_T("Description", "imaging"), new InputTpl("image_description")), array("value" => $desc));
    $f->pop();
    list($count, $post_installs) = xmlrpc_getAllPostInstallScripts($location);
    if (isset($master['post_install_scripts'])) {
        $f = get_post_install_scripts($f, $master['post_install_scripts'], $post_installs);
    } else {
        $f = get_post_install_scripts($f, array(), $post_installs);
    }
    $f->addButton("bvalid", _T("Validate"));
    $f->display();
} else {
    $item_uuid = $_POST['itemid'];
    $loc_uuid = getCurrentLocation();
    $params = array();
    $params['name'] = $_POST['image_label'];
    $params['desc'] = $_POST['image_description'];
    $params['post_install_script'] = $_POST['post_install'];
    $params['is_master'] = True;
    $p_order = array();
    foreach ($_POST as $post_key => $post_value) {
        if (ereg('order_', $post_key)) {
            $post_key = str_replace("order_", "", $post_key);
            $p_order[$post_key] = $post_value;
        }
    }
    $params['post_install_scripts'] = $p_order;
    $ret = xmlrpc_editImageLocation($item_uuid, $loc_uuid, $params);
    if ($ret[0] and !isXMLRPCError()) {