<?php
/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
defined('IN_IA') or exit('Access Denied');


if (!($action == 'material' && $do == 'delete') && empty($_GPC['version_id'])) {
	$account_api = WeAccount::createByUniacid($_W['uniacid']);
	if (is_error($account_api)) {
		itoast('', url('account/display'));
	}
	$check_manange = $account_api->checkIntoManage();
	if (is_error($check_manange)) {
		$account_display_url = $account_api->accountDisplayUrl();
		itoast('', $account_display_url);
	}
}

if ($_GPC['account_type'] == ACCOUNT_TYPE_XZAPP_NORMAL || $_GPC['account_type'] == ACCOUNT_TYPE_XZAPP_AUTH) {
	define("FRAME", "xzapp");
} else {
	if ($action != 'material-post' && $_GPC['uniacid'] != FILE_NO_UNIACID) {
		define('FRAME', 'account');
	}
}
if ($action == 'qr') {
	$platform_qr_permission = permission_check_account_user('platform_qr', false);
	if ($platform_qr_permission ===  false) {
		header("Location: ". url('platform/url2qr'));
	}
}

if ($action == 'url2qr') {
	define('ACTIVE_FRAME_URL', url('platform/qr'));
}