18 include_once (
"Lib.Common.php");
22 include_once (
'Class.Action.php');
23 include_once (
'Class.Application.php');
24 include_once (
'Class.Session.php');
25 include_once (
'Lib.Http.php');
26 include_once (
'Class.Log.php');
27 include_once (
'Class.Domain.php');
28 include_once (
'Class.DbObj.php');
29 $indexphp = basename(
$_SERVER[
"SCRIPT_NAME"]);
39 if (!getHttpVars(
"app")) {
41 $_GET[
"app"] =
"CORE";
43 $_GET[
"app"] =
$_SERVER[
"FREEDOM_ACCESS"];
47 $_GET[
"action"] =
"INVALID";
51 if (isset($_COOKIE[
'freedom_param'])) $sess_num = $_COOKIE[
'freedom_param'];
54 if (!$session->Set($sess_num)) {
65 $core->SetSession($session);
67 if ($defaultapp &&
$core->GetParam(
"CORE_START_APP")) {
68 $_GET[
"app"] =
$core->GetParam(
"CORE_START_APP");
70 $limit = ini_get(
"memory_limit");
71 if (is_string($limit)) {
72 $limitNum = intval(substr($limit, 0, -1));
74 if (strcmp(substr($limit, -1),
"G") == 0) {
77 if ($limitNum >= 0 && ($limitNum * $multipli) < intval(
$core->GetParam(
"MEMORY_LIMIT",
"64"))) {
78 ini_set(
"memory_limit",
$core->GetParam(
"MEMORY_LIMIT",
"64") .
"M");
82 $CORE_LOGLEVEL =
$core->GetParam(
"CORE_LOGLEVEL",
"IWEF");
85 $pattern = preg_quote($indexphp);
86 if (preg_match(
"|(.*)/$pattern|",
$_SERVER[
'SCRIPT_NAME'], $reg)) {
96 if (array_key_exists(
'authtype', $_GET)) {
97 $add_args.=
"&authtype=" . $_GET[
'authtype'];
100 $urlindex =
$core->getParam(
"CORE_URLINDEX");
101 if ($urlindex)
$core->SetVolatileParam(
"CORE_EXTERNURL", $urlindex);
102 else $core->SetVolatileParam(
"CORE_EXTERNURL",
$puburl .
"/");
104 $core->SetVolatileParam(
"CORE_PUBURL",
".");
106 $core->SetVolatileParam(
"CORE_JSURL",
"WHAT/Layout");
107 $core->SetVolatileParam(
"CORE_ROOTURL",
"?sole=R$add_args&");
108 $core->SetVolatileParam(
"CORE_BASEURL",
"?sole=A$add_args&");
109 $core->SetVolatileParam(
"CORE_SBASEURL",
"?sole=A&freedom_param={$session->id}$add_args&");
110 $core->SetVolatileParam(
"CORE_STANDURL",
"?sole=Y$add_args&");
111 $core->SetVolatileParam(
"CORE_SSTANDURL",
"?sole=Y&freedom_param={$session->id}$add_args&");
112 $core->SetVolatileParam(
"CORE_ASTANDURL",
"$puburl/$indexphp?sole=Y$add_args&");
115 if (($standalone ==
"") || ($standalone ==
"N")) {
127 if (substr(
$_SERVER[
'REQUEST_URI'], 0, 6) ==
"http:/") {
128 $aquest = parse_url(
$_SERVER[
'REQUEST_URI']);
129 $aquest[
'host'] =
$appl->machine;
135 Header(
"Location: $puburl");
141 if (
$appl->ssl ==
"Y") {
145 Header(
"Location: $sslurl");
149 $core->SetVolatileParam(
"CORE_BGCOLOR",
$core->GetParam(
"CORE_SSLBGCOLOR"));
157 $core_lang = $auth->getSessionVar(
'CORE_LANG');
158 if ($core_lang !=
'') {
159 $action->setParamU(
'CORE_LANG', $core_lang);
160 $auth->setSessionVar(
'CORE_LANG',
'');
163 $core->SetVolatileParam(
"CORE_BASICAUTH",
'&authtype=basic');
164 }
else $core->SetVolatileParam(
"CORE_BASICAUTH",
'');
167 $pos = strpos($nav,
"MSIE");
168 if (
$action->Read(
"navigator",
"") ==
"") {
169 if ($pos !==
false) {
170 $action->Register(
"navigator",
"EXPLORER");
171 if (preg_match(
"/MSIE ([0-9.]+).*/", $nav, $reg)) {
172 $action->Register(
"navversion", $reg[1]);
175 $action->Register(
"navigator",
"NETSCAPE");
176 if (preg_match(
"|([a-zA-Z]+)/([0-9.]+).*|", $nav, $reg)) {
177 $action->Register(
"navversion", $reg[2]);
185 $ISAPPLEWEBKIT =
false;
188 if (preg_match(
'/MSIE ([0-9]+).*/', $nav, $match)) {
202 } elseif (preg_match(
'|\bAppleWebKit/(.*?)\b|', $nav, $match)) {
203 $ISAPPLEWEBKIT =
true;
204 if (preg_match(
'|\bSafari/(.*?)\b|', $nav, $match)) {
206 if (preg_match(
'|\bChrome/(.*?)\b|', $nav, $match)) {
212 $core->SetVolatileParam(
"ISIE", (
$action->read(
"navigator") ==
"EXPLORER"));
213 $core->SetVolatileParam(
"ISIE6", ($ISIE6 ===
true));
214 $core->SetVolatileParam(
"ISIE7", ($ISIE7 ===
true));
215 $core->SetVolatileParam(
"ISIE8", ($ISIE8 ===
true));
216 $core->SetVolatileParam(
"ISAPPLEWEBKIT", ($ISAPPLEWEBKIT ===
true));
217 $core->SetVolatileParam(
"ISSAFARI", ($ISSAFARI ===
true));
218 $core->SetVolatileParam(
"ISCHROME", ($ISCHROME ===
true));
233 if (($standalone ==
"Y") || ($standalone ==
"N") || ($standalone ==
"")) {
235 else echo (
$action->execute());
236 }
else if ($standalone ==
"R") {
242 while (list($k, $v) = each($_GET)) {
243 if (($k !=
"freedom_param") && ($k !=
"app") && ($k !=
"sole") && ($k !=
"action")) $getargs.=
"&" . $k .
"=" . $v;
245 redirect(
$action,
"CORE",
"MAIN&appd=${app}&actd=${act}" . urlencode($getargs) ,
$action->GetParam(
"CORE_STANDURL"));
246 }
else if ($standalone ==
"A") {
247 if ((isset(
$action->parent)) && (
$action->parent->with_frame !=
"Y")) {
255 $head->jsref =
$action->parent->GetJsRef();
256 $head->jscode =
$action->parent->GetJsCode();
257 $head->set(
"TITLE", _(
$action->parent->short_name));
274 else echo (
$action->execute());