function outputFile($path, $media) { if ($media) { $newPath = dirname($path) . '/' . basename($path, '.tpl') . ".{$media}.tpl"; if (file_exists($newPath)) { $path = $newPath; } } $module =& system_buildin_load('system'); return $module->getOuterContent($path); }
public function outputFile($path) { if (array_key_exists('media', $_REQUEST) && strlen($_REQUEST['media']) > 0) { $media = $_REQUEST['media']; $newPath = dirname($path) . '/' . basename($path, '.tpl') . ".{$media}.tpl"; if (file_exists($newPath)) { $path = $newPath; } } $module =& system_buildin_load('system'); return $module->getOuterContent($path); }
protected function executeMacros($v264a818e305e0550c3ee63761dd3d911) { if ($v264a818e305e0550c3ee63761dd3d911['module'] == "core" || $v264a818e305e0550c3ee63761dd3d911['module'] == "system" || $v264a818e305e0550c3ee63761dd3d911['module'] == "custom") { $v22884db148f0ffb0d830ba431102b0b5 =& system_buildin_load($v264a818e305e0550c3ee63761dd3d911['module']); } else { $v22884db148f0ffb0d830ba431102b0b5 = cmsController::getInstance()->getModule($v264a818e305e0550c3ee63761dd3d911['module']); } $vea9f6aca279138c58f705c8d4cb4b8ce = isset($v264a818e305e0550c3ee63761dd3d911['method']) ? $v264a818e305e0550c3ee63761dd3d911['method'] : false; if ($v22884db148f0ffb0d830ba431102b0b5 && $vea9f6aca279138c58f705c8d4cb4b8ce) { if ($v264a818e305e0550c3ee63761dd3d911['module'] != "core" && $v264a818e305e0550c3ee63761dd3d911['module'] != "system" && $v264a818e305e0550c3ee63761dd3d911['module'] != "custom") { $vbab394571d9305ff0c667ed256c19a70 = (bool) system_is_allowed($v264a818e305e0550c3ee63761dd3d911['module'], $v264a818e305e0550c3ee63761dd3d911['method']); } else { $vbab394571d9305ff0c667ed256c19a70 = true; } if ($vbab394571d9305ff0c667ed256c19a70) { $v9b207167e5381c47682c6b4f58a623fb = call_user_func_array(array($v22884db148f0ffb0d830ba431102b0b5, $v264a818e305e0550c3ee63761dd3d911['method']), $v264a818e305e0550c3ee63761dd3d911['params']); return $v9b207167e5381c47682c6b4f58a623fb; } else { return false; } } else { return false; } }
public function view_counter_json() { $section = (string) getRequest('section'); $report = (string) getRequest('report'); $counterId = (int) getRequest('counter'); $order = (string) getRequest('order'); $date1 = (string) getRequest('date1'); $date2 = (string) getRequest('date2'); $section = trim($section, "_"); $cacheDir = CURRENT_WORKING_DIR . '/sys-temp/metrika/'; if (!is_dir($cacheDir)) { mkdir($cacheDir, 0777, true); } $key = md5($section . $report . $counterId . $date1 . $date2); $fileKey = md5($section . $report . $counterId); $cacheFile = $cacheDir . $fileKey; $filteredResponse = null; if (file_exists($cacheFile) && getSession('metrikaKey') == $key) { $filteredResponse = file_get_contents($cacheFile); } elseif (file_exists($cacheFile)) { unlink($cacheFile); } if (is_null($filteredResponse)) { $headers = array("Content-type" => 'text/xml', "Accept" => 'application/x-yametrika+json'); if ($section == "summary" && $report == "common") { return; } $system = system_buildin_load('system'); $request = 'stat/' . $section . '/' . $report . '.json'; if ($section == 'geo') { $request = 'stat/' . $section . '.json'; } $params = array('id' => $counterId, 'pretty' => 1); if ($date1) { $params['date1'] = $system->convertDate("", 'Ymd', $date1); } if ($date2) { $params['date2'] = $system->convertDate("", 'Ymd', $date2); } try { $response = self::get_response($request, "GET", $params, $headers); } catch (Exception $e) { $error = $e->getMessage(); $result = array('errors' => array(0 => array('text' => $error))); $filteredResponse = json_encode($result); file_put_contents($cacheFile, $filteredResponse); } if (is_null($filteredResponse)) { $jsonDecoded = json_decode($response, true); if (isset($jsonDecoded['date1'])) { $jsonDecoded['date1'] = $system->convertDate("", 'd.m.Y', $jsonDecoded['date1']); } if (isset($jsonDecoded['date2'])) { $jsonDecoded['date2'] = $system->convertDate("", 'd.m.Y', $jsonDecoded['date2']); } $mainArray = 'data'; if ($report == 'deepness') { $mainArray = 'data_time'; } if (isset($jsonDecoded[$mainArray])) { if ($order == 'date') { $jsonDecodedData = array(); foreach ($jsonDecoded['data'] as $data) { $date = $data['date']; unset($data['date']); $jsonDecodedData[$date] = array_merge(array('date' => $system->convertDate("", 'd.m.Y', $date)), $data); } ksort($jsonDecodedData); $jsonDecoded['data'] = array_values($jsonDecodedData); } elseif ($section == 'geo') { require_once dirname(__FILE__) . '/__countries.php'; $jsonDecodedData = array(); $controller = cmsController::getInstance(); $lang = $controller->getLang(); $langPrefix = $lang->getPrefix(); foreach ($jsonDecoded['data'] as $data) { $orderValue = $data['name']; if ($langPrefix == 'ru' && isset($countries[$data['name']])) { $orderValue = $countries[$data['name']]; } $jsonDecodedData[] = array_merge(array($order => $orderValue), $data); } $jsonDecoded['data'] = $jsonDecodedData; } else { $jsonDecodedData = array(); foreach ($jsonDecoded[$mainArray] as $data) { $orderValue = $data[$order]; if ($report == 'browsers') { $orderValue .= ' ' . $data['version']; } unset($data[$order]); $jsonDecodedData[] = array_merge(array($order => $orderValue), $data); } $jsonDecoded['data'] = $jsonDecodedData; } } $filteredResponse = json_encode($jsonDecoded); file_put_contents($cacheFile, $filteredResponse); } } $_SESSION['metrikaKey'] = $key; $buffer = outputBuffer::current(); $buffer->contentType('text/javascript'); $buffer->option('generation-time', false); $buffer->clear(); $buffer->push($filteredResponse); $buffer->end(); }
protected function executeCompleteMacros($v22884db148f0ffb0d830ba431102b0b5, $vea9f6aca279138c58f705c8d4cb4b8ce = null, $args = array(), array $v87cd8b8808600624d8c590cfc2e6e94b) { $v594c103f2c6e04c3d8ab059f031e0c1a = cmsController::getInstance(); $v7d059d8ffac0a3914b296af280c6194e = $this->generateMSResultUID(); $v79e333907d62f2b72da57dda128668fd = "%" . $v22884db148f0ffb0d830ba431102b0b5 . " " . $vea9f6aca279138c58f705c8d4cb4b8ce . "(" . implode(",", $args) . ")%"; $vb439a0ec6d69c6153eb9fd03e39b7216 = count($args); for ($v865c0c0b4ab0e063e5caa3387c1a8741 = 0; $v865c0c0b4ab0e063e5caa3387c1a8741 < $vb439a0ec6d69c6153eb9fd03e39b7216; $v865c0c0b4ab0e063e5caa3387c1a8741++) { if (isset(self::$msResultStack[$args[$v865c0c0b4ab0e063e5caa3387c1a8741]])) { $args[$v865c0c0b4ab0e063e5caa3387c1a8741] = self::$msResultStack[$args[$v865c0c0b4ab0e063e5caa3387c1a8741]]; } elseif (strpos($args[$v865c0c0b4ab0e063e5caa3387c1a8741], '[ms_') !== false) { $args[$v865c0c0b4ab0e063e5caa3387c1a8741] = str_replace(array_keys(self::$msResultStack), array_values(self::$msResultStack), $args[$v865c0c0b4ab0e063e5caa3387c1a8741]); } } if (is_null($vea9f6aca279138c58f705c8d4cb4b8ce) && is_callable($v22884db148f0ffb0d830ba431102b0b5)) { $v79e333907d62f2b72da57dda128668fd = $v22884db148f0ffb0d830ba431102b0b5($args); } else { $vd8c56561cee88453daa5db9a9ab5354c = null; if ($v22884db148f0ffb0d830ba431102b0b5 == "core" || $v22884db148f0ffb0d830ba431102b0b5 == "system" || $v22884db148f0ffb0d830ba431102b0b5 == "custom") { $vd8c56561cee88453daa5db9a9ab5354c =& system_buildin_load($v22884db148f0ffb0d830ba431102b0b5); } elseif (system_is_allowed($v22884db148f0ffb0d830ba431102b0b5, $vea9f6aca279138c58f705c8d4cb4b8ce)) { $vd8c56561cee88453daa5db9a9ab5354c = $v594c103f2c6e04c3d8ab059f031e0c1a->getModule($v22884db148f0ffb0d830ba431102b0b5); } elseif (defined('DEBUG') && DEBUG) { $v79e333907d62f2b72da57dda128668fd = "You are not allowed to execute {$v22884db148f0ffb0d830ba431102b0b5}/{$vea9f6aca279138c58f705c8d4cb4b8ce}"; } else { $v79e333907d62f2b72da57dda128668fd = ""; } if ($vd8c56561cee88453daa5db9a9ab5354c) { try { $v79e333907d62f2b72da57dda128668fd = $vd8c56561cee88453daa5db9a9ab5354c->cms_callMethod($vea9f6aca279138c58f705c8d4cb4b8ce, $args); } catch (publicException $ve1671797c52e15f763380b45e841ec32) { $v79e333907d62f2b72da57dda128668fd = $ve1671797c52e15f763380b45e841ec32->getMessage(); } } } $this->parseLevel++; $v79e333907d62f2b72da57dda128668fd = $this->parse($v87cd8b8808600624d8c590cfc2e6e94b, $v79e333907d62f2b72da57dda128668fd); $this->parseLevel--; $this->setMSResult($v7d059d8ffac0a3914b296af280c6194e, $v79e333907d62f2b72da57dda128668fd); return $v7d059d8ffac0a3914b296af280c6194e; }
public function checkLicenseKey() { $v41275a535677f79ff347e01bc530c176 = permissionsCollection::getInstance(); if (!$v41275a535677f79ff347e01bc530c176->isAdmin()) { return false; } $v1a54c1036ccb10069e9c06281d52007a = regedit::getInstance()->getVal("//settings/keycode"); $vd1fc8eaf36937be0c3ba8cfe0a2c1bfe = umiRemoteFileGetter::get("http://www.umi-cms.ru/udata/updatesrv/checkLicenseKey/{$v1a54c1036ccb10069e9c06281d52007a}/"); $vdd988cfd769c9f7fbd795a0f5da8e751 = new DOMDocument(); $vfca1bff8ad8b3a8585abfb0ad523ba42 = array(); if (@$vdd988cfd769c9f7fbd795a0f5da8e751->loadXML($vd1fc8eaf36937be0c3ba8cfe0a2c1bfe) === false) { $vfca1bff8ad8b3a8585abfb0ad523ba42['error'] = getLabel('error-invalid_answer'); } else { $v30993907ee8a1076135a2753c57ec21c = $vdd988cfd769c9f7fbd795a0f5da8e751->getElementsByTagName("udata")->item(0); $vadce578d04ed03c31f6ac59451fcf8e4 = $v30993907ee8a1076135a2753c57ec21c->childNodes; $vcb5e100e5a9a3e7f6d1fd97512215282 = false; for ($v865c0c0b4ab0e063e5caa3387c1a8741 = 0; $v865c0c0b4ab0e063e5caa3387c1a8741 < $vadce578d04ed03c31f6ac59451fcf8e4->length; $v865c0c0b4ab0e063e5caa3387c1a8741++) { $v1b7d5726533ab525a8760351e9b5e415 = $vadce578d04ed03c31f6ac59451fcf8e4->item($v865c0c0b4ab0e063e5caa3387c1a8741); $v9f1cf18509efa587955747cd6c177250 = $v1b7d5726533ab525a8760351e9b5e415->nodeName; if ($v9f1cf18509efa587955747cd6c177250 == "error") { $vcb5e100e5a9a3e7f6d1fd97512215282 = true; } $vfca1bff8ad8b3a8585abfb0ad523ba42[$v9f1cf18509efa587955747cd6c177250] = html_entity_decode($v1b7d5726533ab525a8760351e9b5e415->nodeValue); } if (!$vcb5e100e5a9a3e7f6d1fd97512215282) { $v8e44f0089b076e18a718eb9ca3d94674 = $v41275a535677f79ff347e01bc530c176->getUserId(); $vee11cbb19052e40b07aac0ca060c23ee = umiObjectsCollection::getInstance()->getObject($v8e44f0089b076e18a718eb9ca3d94674); $vfca1bff8ad8b3a8585abfb0ad523ba42['user'] = array('attribute:domain' => cmsController::getInstance()->getCurrentDomain()->getHost(), 'attribute:name' => $vee11cbb19052e40b07aac0ca060c23ee->getValue('fname'), 'attribute:email' => $vee11cbb19052e40b07aac0ca060c23ee->getValue('e-mail')); $vfca1bff8ad8b3a8585abfb0ad523ba42 += system_buildin_load('core')->getDomainsList(); } } return def_module::parseTemplate('', $vfca1bff8ad8b3a8585abfb0ad523ba42); }