Example #1
0
		/**
			* Слить все заказы покупателя в профиль пользователя.
			* Объект покупателя после этого будет уничтожен
		*/
		public function merge(umiObject $customer) {

			$cmsController = cmsController::getInstance();
			$domain = $cmsController->getCurrentDomain();
			$domainId = $domain->getId();

			$sel = new selector('objects');
			$sel->types('object-type')->name('emarket', 'order');
			$sel->where('customer_id')->equals($customer->id);
			$sel->where('domain_id')->equals($domainId);
			$sel->order('id')->desc();

			$permissions = permissionsCollection::getInstance();
			$userId = $permissions->getUserId();

			foreach($sel as $order) {
				if(!$order->status_id) {
					$this->mergeBasket($order);
					continue;
				}

				$order->customer_id = $userId;
				$order->commit();
			}
			if (!defined('UMICMS_CLI_MODE') || !UMICMS_CLI_MODE) {
				setcookie('customer-id', 0, 1, '/');
			}
			$customer->delete();
		}
 public static function autoExport(selector $v8be74552df93e31bbdd6b36ed74bdb6a, $vb8c8ec69026adfe891bf5e618eabb17b = false)
 {
     $v4aed429835809b0214b31d7ff74f05ba = new quickCsvExporter($v8be74552df93e31bbdd6b36ed74bdb6a);
     $v0e8133eb006c0f85ed9444ae07a60842 = umiObjectTypesCollection::getInstance();
     foreach ($v8be74552df93e31bbdd6b36ed74bdb6a->types as $v599dcce2998a6b40b1e38e8c6006cb0a) {
         if (is_null($v599dcce2998a6b40b1e38e8c6006cb0a->objectType) == false) {
             $v6301cee35ea764a1e241978f93f01069 = $v599dcce2998a6b40b1e38e8c6006cb0a->objectType->getId();
             $v4aed429835809b0214b31d7ff74f05ba->setObjectTypeId($v6301cee35ea764a1e241978f93f01069);
         }
         if (is_null($v599dcce2998a6b40b1e38e8c6006cb0a->hierarchyType) == false) {
             $vacf567c9c3d6cf7c6e2cc0ce108e0631 = $v599dcce2998a6b40b1e38e8c6006cb0a->hierarchyType->getId();
             $v6301cee35ea764a1e241978f93f01069 = $v0e8133eb006c0f85ed9444ae07a60842->getTypeByHierarchyTypeId($vacf567c9c3d6cf7c6e2cc0ce108e0631);
             $v4aed429835809b0214b31d7ff74f05ba->setObjectTypeId($v6301cee35ea764a1e241978f93f01069);
         }
     }
     if ($v8be74552df93e31bbdd6b36ed74bdb6a->mode == "pages" || $v8be74552df93e31bbdd6b36ed74bdb6a->hierarchy || $vb8c8ec69026adfe891bf5e618eabb17b) {
         $v4aed429835809b0214b31d7ff74f05ba->setResultsMode("element");
     } else {
         $v4aed429835809b0214b31d7ff74f05ba->setResultsMode("object");
     }
     $v52a43e48ec4649dee819dadabcab1bde = cmsController::getInstance()->getCurrentModule();
     $v2245023265ae4cf87d02c8b6ba991139 = mainConfiguration::getInstance();
     $v435ed7e9f07f740abf511a62c00eef6e = $v52a43e48ec4649dee819dadabcab1bde ? $v52a43e48ec4649dee819dadabcab1bde . "-" . date("Y-m-d_H.i.s") : "csv-export-" . uniqid();
     $vedcf819b71ce7a0689cd83e44f16b702 = $v2245023265ae4cf87d02c8b6ba991139->includeParam('system.runtime-cache') . $v435ed7e9f07f740abf511a62c00eef6e . ".csv";
     $v4aed429835809b0214b31d7ff74f05ba->setUsedFields(getRequest('used-fields'));
     $v4aed429835809b0214b31d7ff74f05ba->exportToFile($vedcf819b71ce7a0689cd83e44f16b702);
     $v8c7dd922ad47494fc02c388e12c00eac = new umiFile($vedcf819b71ce7a0689cd83e44f16b702);
     $v8c7dd922ad47494fc02c388e12c00eac->download(true);
 }
 public function validateItem(iUmiHierarchyElement $element)
 {
     $relatedItems = array();
     foreach ($this->related_items as $element) {
         if ($element instanceof iUmiHierarchyElement) {
             $relatedItems[] = $element->id;
         }
     }
     $cmsController = cmsController::getInstance();
     $emarket = $cmsController->getModule('emarket');
     if ($emarket instanceof def_module) {
         $order = $emarket->getBasketOrder();
         foreach ($order->getItems() as $orderItem) {
             $element = $orderItem->getItemElement();
             if ($element instanceof iUmiHierarchyElement) {
                 if (in_array($element->id, $relatedItems)) {
                     return true;
                 }
             }
         }
         return false;
     } else {
         throw new privateException('Emarket module must be installed');
     }
 }
 public function parse($v87cd8b8808600624d8c590cfc2e6e94b, $v9a0364b9e99bb480dd25e1f0284c8555 = null)
 {
     if (is_null($this->domXSL)) {
         $this->domXSL = $this->prepareXSL($this->templatesSource);
     }
     $va3c3308ab3cad416697b6e49b5481ce2 = $this->domXML instanceof DOMDocument ? $this->domXML : $this->prepareXML($v87cd8b8808600624d8c590cfc2e6e94b);
     $v801f7201346b43f8ee8390a1ef20ddcd = new xsltProcessor();
     $v801f7201346b43f8ee8390a1ef20ddcd->registerPHPFunctions();
     if (defined("UMI_XSLT_PROFILER_LOG") && version_compare(PHP_VERSION, '5.3.0', '>=')) {
         $v801f7201346b43f8ee8390a1ef20ddcd->setProfiling(UMI_XSLT_PROFILER_LOG);
     }
     $v818f9c45cfa30eeff277ef38bcbe9910 = errorsXsltListen();
     $v801f7201346b43f8ee8390a1ef20ddcd->importStyleSheet($this->domXSL);
     if ($va0f97308110b5ffc40d784efae2257bb = cmsController::getInstance()->detectCurrentDesignTemplate()) {
         $v40def08eb6011aefb2505a262252de92 = array('template-name' => $va0f97308110b5ffc40d784efae2257bb->getName(), 'template-resources' => $va0f97308110b5ffc40d784efae2257bb->getResourcesDirectory(true));
         $this->addRequestParams($v801f7201346b43f8ee8390a1ef20ddcd, $v40def08eb6011aefb2505a262252de92);
     }
     if (is_array($this->additionalVariables)) {
         $this->addRequestParams($v801f7201346b43f8ee8390a1ef20ddcd, $this->additionalVariables);
     }
     $this->addRequestParams($v801f7201346b43f8ee8390a1ef20ddcd, $_COOKIE);
     $this->addRequestParams($v801f7201346b43f8ee8390a1ef20ddcd, $_REQUEST);
     $this->addRequestParams($v801f7201346b43f8ee8390a1ef20ddcd, $_SERVER, "_");
     $v9b207167e5381c47682c6b4f58a623fb = $v801f7201346b43f8ee8390a1ef20ddcd->transformToXML($va3c3308ab3cad416697b6e49b5481ce2);
     errorsXsltCheck($v818f9c45cfa30eeff277ef38bcbe9910);
     return $v9b207167e5381c47682c6b4f58a623fb;
 }
Example #5
0
		public function _network_settings($network) {
			$this->setHeaderLabel(getLabel("header-social_networks-settings") . $network->getName());

			$mode = getRequest("param0");
			$cmsController = cmsController::getInstance();

			$type = $network->getCodeName();

			$module = $cmsController->getCurrentModule();
			$method = $cmsController->getCurrentMethod();
			$config = mainConfiguration::getInstance();
			$templateId = $config->get("templates", "{$module}.{$method}");

			$inputData = array(
				'object' => $network->getObject(),
				'type' => $type
			);

			if($mode == "do") {
				$config->set("templates", "{$module}.{$method}", getRequest('template-id'));
				$object = $this->saveEditedObjectData($inputData);
				$this->chooseRedirect($this->pre_lang . '/admin/social_networks/' . $type . '/');
			}

			$this->setDataType("form");
			$this->setActionType("modify");

			$data = $this->prepareData($inputData, "object");
			$data['template-id'] = array('@id' => $templateId);

			$this->setData($data);
			return $this->doData();
		}
Example #6
0
 public function run()
 {
     $form = $this->getForm('options');
     if (!$form) {
         cmsCore::error404();
     }
     $is_submitted = $this->request->has('submit');
     $options = cmsController::loadOptions($this->name);
     $source_controllers = cmsEventsManager::hookAll('sitemap_sources');
     if (is_array($source_controllers)) {
         foreach ($source_controllers as $controller) {
             foreach ($controller['sources'] as $id => $title) {
                 $form->addField('sources', new fieldCheckbox("sources:{$controller['name']}|{$id}", array('title' => $title)));
             }
         }
     }
     if ($is_submitted) {
         $options = $form->parse($this->request, $is_submitted);
         $errors = $form->validate($this, $options);
         if (!$errors) {
             cmsUser::addSessionMessage(LANG_CP_SAVE_SUCCESS, 'success');
             cmsController::saveOptions($this->name, $options);
             $this->redirectToAction('options');
         }
         if ($errors) {
             cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
         }
     }
     return cmsTemplate::getInstance()->render('backend/options', array('options' => $options, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
 }
 public function onAddTopicToDispatch(iUmiEventPoint $oEvent)
 {
     $iDispatchId = regedit::getInstance()->getVal("//modules/forum/dispatch_id");
     if (!$iDispatchId) {
         return false;
     }
     $dispatches_module = cmsController::getInstance()->getModule('dispatches');
     if (!$dispatches_module) {
         return false;
     }
     $iTopicId = (int) $oEvent->getParam('topic_id');
     $oTopicElement = umiHierarchy::getInstance()->getElement($iTopicId);
     if ($oTopicElement instanceof umiHierarchyElement) {
         $sTitle = (string) getRequest('title');
         $sMessage = (string) getRequest('body');
         $iHierarchyTypeId = umiHierarchyTypesCollection::getInstance()->getTypeByName("dispatches", "message")->getId();
         $iMsgTypeId = umiObjectTypesCollection::getInstance()->getTypeByHierarchyTypeId($iHierarchyTypeId);
         $oMsgType = umiObjectTypesCollection::getInstance()->getType($iMsgTypeId);
         $iMsgObjId = umiObjectsCollection::getInstance()->addObject($sTitle, $iMsgTypeId);
         $oMsgObj = umiObjectsCollection::getInstance()->getObject($iMsgObjId);
         if ($oMsgObj instanceof umiObject) {
             $iReleaseId = $dispatches_module->getNewReleaseInstanceId($iDispatchId);
             $oMsgObj->setValue('release_reference', $iReleaseId);
             $oMsgObj->setValue('header', $sTitle);
             $oMsgObj->setValue('body', $sMessage);
             $oMsgObj->commit();
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
Example #8
0
 public function actionOptions()
 {
     if (empty($this->useDefaultOptionsAction)) {
         cmsCore::error404();
     }
     $form = $this->getForm('options');
     if (!$form) {
         cmsCore::error404();
     }
     $form = $this->addControllerSeoOptions($form);
     $options = cmsController::loadOptions($this->name);
     if ($this->request->has('submit')) {
         $options = array_merge($options, $form->parse($this->request, true));
         $errors = $form->validate($this, $options);
         if (!$errors) {
             cmsUser::addSessionMessage(LANG_CP_SAVE_SUCCESS, 'success');
             cmsController::saveOptions($this->name, $options);
             $this->processCallback(__FUNCTION__, array($options));
             $this->redirectToAction('options');
         }
         if ($errors) {
             cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
         }
     }
     $template_params = array('toolbar' => $this->getOptionsToolbar(), 'options' => $options, 'form' => $form, 'errors' => isset($errors) ? $errors : false);
     // если задан шаблон опций в контроллере
     if ($this->cms_template->getTemplateFileName('controllers/' . $this->name . '/backend/options', true)) {
         return $this->cms_template->render('backend/options', $template_params);
     } else {
         $default_admin_tpl = $this->cms_template->getTemplateFileName('controllers/admin/controllers_options');
         return $this->cms_template->processRender($default_admin_tpl, $template_params);
     }
 }
Example #9
0
 public function process($template = null)
 {
     list($tpl_block, $tpl_item) = def_module::loadTemplates("emarket/payment/invoice/" . $template, 'legal_person_block', 'legal_person_item');
     $collection = umiObjectsCollection::getInstance();
     $types = umiObjectTypesCollection::getInstance();
     $typeId = $types->getBaseType("emarket", "legal_person");
     $customer = customer::get();
     $order = $this->order;
     $mode = getRequest('param2');
     if ($mode == 'do') {
         $personId = getRequest('legal-person');
         $isNew = $personId == null || $personId == 'new';
         if ($isNew) {
             $typeId = $types->getBaseType("emarket", "legal_person");
             $personId = $collection->addObject("", $typeId);
             $controller = cmsController::getInstance();
             $data = getRequest('data');
             if ($data && ($dataModule = $controller->getModule("data"))) {
                 $person = $collection->getObject($personId);
                 $person->setName($data['new']['name']);
                 $dataModule->saveEditedObject($personId, $isNew, true);
             }
             if ($collection->getObject($personId) instanceof umiObject) {
                 $customer = customer::get();
                 $customer->legal_persons = array_merge($customer->legal_persons, array($personId));
             }
         }
         $order->legal_person = $personId;
         $order->order();
         $order->payment_document_num = $order->id;
         $result = $this->printInvoice($order);
         $buffer = outputBuffer::current();
         $buffer->charset('utf-8');
         $buffer->contentType('text/html');
         $buffer->clear();
         $buffer->push($result);
         $buffer->end();
         return true;
     } else {
         if ($mode == 'delete') {
             $personId = (int) getRequest('person-id');
             if ($collection->isExists($personId)) {
                 $customer = customer::get();
                 $customer->legal_persons = array_diff($customer->legal_persons, array($personId));
                 $collection->delObject($personId);
             }
         }
     }
     $items = array();
     $persons = $customer->legal_persons;
     if (is_array($persons)) {
         foreach ($persons as $personId) {
             $person = $collection->getObject($personId);
             $item_arr = array('attribute:id' => $personId, 'attribute:name' => $person->name);
             $items[] = def_module::parseTemplate($tpl_item, $item_arr, false, $personId);
         }
     }
     $block_arr = array('attribute:type-id' => $typeId, 'attribute:type_id' => $typeId, 'xlink:href' => 'udata://data/getCreateForm/' . $typeId, 'subnodes:items' => $items);
     return def_module::parseTemplate($tpl_block, $block_arr);
 }
Example #10
0
 /**
  * @desc Конструктор
  */
 public function __construct()
 {
     parent::__construct();
     if (cmsController::getInstance()->getCurrentMode() == "admin") {
         $regedit = regedit::getInstance();
         $systemEdition = $regedit->getVal("//modules/autoupdate/system_edition");
         $patches_disabled = false;
         if (strpos($systemEdition, 'trial') !== false || strpos($systemEdition, 'commerce_enc') !== false || strpos($systemEdition, 'start') !== false) {
             $patches_disabled = true;
         }
         if ($patches_disabled) {
             $regedit->setVar("//modules/autoupdate/disable_patches", "1");
         } else {
             $regedit->setVar("//modules/autoupdate/disable_patches", "0");
         }
         $commonTabs = $this->getCommonTabs();
         if ($commonTabs && !$patches_disabled) {
             $commonTabs->add('versions');
             $commonTabs->add('patches');
         }
         $this->__loadLib("__admin.php");
         $this->__implement("__autoupdate");
         $this->__loadLib("__json.php");
         $this->__implement("__json_autoupdate");
     }
 }
Example #11
0
		/**
		* Зарегистрировать событие в истории событий
		* @param string $eventTypeId идентификатор типа события
		* @param array $params массив параметров события
		* @param int $elementId id связанной страницы
		* @param int $objectId id связанного объекта
		*/
		public function registerEvent($eventTypeId, $params = array(), $elementId = null, $objectId = null) {
			
			$pool = ConnectionPool::getInstance();
			$connection = $pool->getConnection();
			umiEventFeed::setConnection($connection);
			umiEventFeedType::setConnection($connection);
					
			try {
				$eventType = umiEventFeedType::get($eventTypeId);
			} catch (Exception $e) {
				$eventType = umiEventFeedType::create($eventTypeId);
			}
			
			$userId = permissionsCollection::getInstance()->getUserId();
			$user = umiObjectsCollection::getInstance()->getObject($userId)->getName();
			
			$module = cmsController::getInstance()->getModule('users');
			$link = $module->getObjectEditLink($userId);
			
			array_unshift($params, $user);
			array_unshift($params, $link);
			umiEventFeed::create($eventType, $params, $elementId, $objectId);
			
			$maxDays = (int) regedit::getInstance()->getVal("//modules/events/max-days-storing-events");
			if ($maxDays > 0) {
				$lastDate = time() - ($maxDays * 24 * 60 * 60);
				umiEventFeed::deleteList(array(), $lastDate);
			}
			
		}
		/**
			* Найти наиболее подходящую скидку для заказа $order
			* @param order $order заказ
			* @return orderDiscount самая подходящая скидка для заказа $order
		*/
		public static function search(order $order) {
			$cmsController = cmsController::getInstance();
			$emarket = $cmsController->getModule('emarket');

			if($emarket instanceof def_module == false) {
				throw new coreException('Emarket module must be installed in order to calculate discounts');
			}
			
			$allDiscounts = $emarket->getAllDiscounts('bonus');
			$discounts = array();
			foreach($allDiscounts as $discountObject) {
				$discount = discount::get($discountObject->id);
				if($discount instanceof bonusDiscount == false) continue;
				if($discount->validate($order)) $discounts[] = $discount;
			}
			
			switch(sizeof($discounts)) {
				case 0: return null;
				default:
					$orderPrice = $order->getOriginalPrice();
					$maxDiscount = null; $minPrice = null;
					foreach($discounts as $i => $discount) {
						$price = $discount->recalcPrice($orderPrice);
						if($price <= 0) continue;

						if(is_null($minPrice) || $minPrice > $price) {
							$minPrice = $price;
							$maxDiscount = $discount;
						}
					}
					return $maxDiscount;
			}
		}
Example #13
0
 public function process($template = null)
 {
     $productId = $this->object->product_id;
     $siteId = $this->object->site_id;
     $productName = $this->order->getId();
     $cmsController = cmsController::getInstance();
     $language = strtolower($cmsController->getCurrentLang()->getPrefix());
     switch ($language) {
         case 'ru':
             $language = 'ru';
             break;
         default:
             $language = 'en';
             break;
     }
     $this->order->order();
     $productPrice = $this->order->getActualPrice();
     $secretCode = $this->object->secret;
     $priceString = number_format($productPrice, 2, '.', '');
     $sign = md5($productId . '-' . $priceString . '-' . $secretCode);
     $answerUrl = $cmsController->getCurrentDomain()->getHost() . "/emarket/gateway/" . $this->order->getId() . "/";
     $param = array();
     $param["formAction"] = "https://payments.chronopay.com/index.php";
     $param["product_id"] = $productId;
     $param["product_price"] = $productPrice;
     $param["language"] = $language;
     $param["order_id"] = $this->order->getId();
     $param["cb_type"] = "P";
     $param["cb_url"] = $answerUrl;
     $param["decline_url"] = $cmsController->getCurrentDomain()->getHost();
     $param["sign"] = $sign;
     $this->order->setPaymentStatus('initialized');
     list($templateString) = def_module::loadTemplates("emarket/payment/chronopay/" . $template, "form_block");
     return def_module::parseTemplate($templateString, $param);
 }
Example #14
0
 public function actionOptions()
 {
     if (empty($this->useDefaultOptionsAction)) {
         cmsCore::error404();
     }
     $form = $this->getForm('options');
     if (!$form) {
         cmsCore::error404();
     }
     $is_submitted = $this->request->has('submit');
     $options = cmsController::loadOptions($this->name);
     if ($is_submitted) {
         $options = $form->parse($this->request, $is_submitted);
         $errors = $form->validate($this, $options);
         if (!$errors) {
             cmsUser::addSessionMessage(LANG_CP_SAVE_SUCCESS, 'success');
             cmsController::saveOptions($this->name, $options);
             $this->redirectToAction('options');
         }
         if ($errors) {
             cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
         }
     }
     return cmsTemplate::getInstance()->render('backend/options', array('options' => $options, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
 }
Example #15
0
 public function __construct()
 {
     parent::__construct();
     if (cmsController::getInstance()->getCurrentMode() == "admin") {
         $commonTabs = $this->getCommonTabs();
         if ($commonTabs) {
             $commonTabs->add("types", array("type_add", "type_edit"));
             $commonTabs->add("guides", array("guide_add", "guide_items", "guide_item_edit", "guide_item_add"));
         }
         $configTabs = $this->getConfigTabs();
         if ($configTabs) {
             $configTabs->add("config");
         }
         $this->__loadLib("__admin.php");
         $this->__implement("__data");
         $this->__loadLib("__json.php");
         $this->__implement("__json_data");
         $this->__loadLib("__trash.php");
         $this->__implement("__trash_data");
         $this->__loadLib("__guides.php");
         $this->__implement("__guides_data");
         $this->__loadLib("__files.php");
         $this->__implement("__files_data");
     } else {
         $this->__loadLib("__rss.php");
         $this->__implement("__rss_data");
     }
     $this->__loadLib("__client_reflection.php");
     $this->__implement("__client_reflection_data");
     $this->__loadLib("__search.php");
     $this->__implement("__search_data");
     $this->__loadLib("__custom.php");
     $this->__implement("__custom_data");
 }
Example #16
0
 public function __construct()
 {
     parent::__construct();
     $this->config = cmsController::loadOptions('photos');
     if (!empty($this->config['types'])) {
         $this->config['types'] = string_explode_list($this->config['types']);
     }
 }
Example #17
0
 public function item_element()
 {
     if ($this->breakMe()) {
         return;
     }
     $element_id = (int) cmsController::getInstance()->getCurrentElementId();
     return $this->view($element_id);
 }
Example #18
0
 public function getDataModule()
 {
     static $dataModule;
     if (!$dataModule) {
         $dataModule = cmsController::getInstance()->getModule('data');
     }
     return $dataModule;
 }
Example #19
0
 public function config()
 {
     $regedit = regedit::getInstance();
     $domains = domainsCollection::getInstance()->getList();
     $lang_id = cmsController::getInstance()->getCurrentLang()->getId();
     $params = array();
     if ($regedit->getVal("//modules/seo/yandex-token")) {
         $params['yandex']['string:token'] = $regedit->getVal("//modules/seo/yandex-token");
     } else {
         $params['yandex']['string:code'] = '';
     }
     foreach ($domains as $domain) {
         $domain_id = $domain->getId();
         $domain_name = $domain->getHost();
         $seo_info = array();
         $seo_info['status:domain'] = $domain_name;
         $seo_info['string:title-' . $domain_id] = $regedit->getVal("//settings/title_prefix/{$lang_id}/{$domain_id}");
         $seo_info['string:keywords-' . $domain_id] = $regedit->getVal("//settings/meta_keywords/{$lang_id}/{$domain_id}");
         $seo_info['string:description-' . $domain_id] = $regedit->getVal("//settings/meta_description/{$lang_id}/{$domain_id}");
         $params[$domain_name] = $seo_info;
     }
     $mode = (string) getRequest('param0');
     if ($mode == "do") {
         $params = $this->expectParams($params);
         foreach ($domains as $domain) {
             $domain_id = $domain->getId();
             $domain_name = $domain->getHost();
             $title = $params[$domain_name]['string:title-' . $domain_id];
             $keywords = $params[$domain_name]['string:keywords-' . $domain_id];
             $description = $params[$domain_name]['string:description-' . $domain_id];
             $regedit->setVal("//settings/title_prefix/{$lang_id}/{$domain_id}", $title);
             $regedit->setVal("//settings/meta_keywords/{$lang_id}/{$domain_id}", $keywords);
             $regedit->setVal("//settings/meta_description/{$lang_id}/{$domain_id}", $description);
         }
         if (isset($params['yandex']['string:code'])) {
             $queryParams = array('grant_type' => "authorization_code", 'code' => $params['yandex']['string:code'], 'client_id' => "47fc30ca18e045cdb75f17c9779cfc36", 'client_secret' => "8c744620c2414522867e358b74b4a2ff");
             $response = umiRemoteFileGetter::get("https://oauth.yandex.ru/token", false, array(), $queryParams, true, "POST");
             $response = preg_split("|(\r\n\r\n)|", $response);
             $result = json_decode($response[1]);
             if (!isset($result) || $result->error || !$result->access_token) {
                 $this->errorNewMessage(getLabel('webmaster-wrong-code'));
                 $this->errorPanic();
             }
             $token = $result->access_token;
             $regedit->setVal("//modules/seo/yandex-token", $token);
         } else {
             $regedit->setVal("//modules/seo/yandex-token", $params['yandex']['string:token']);
         }
         $this->chooseRedirect();
     }
     $this->setDataType('settings');
     $this->setActionType('modify');
     $data = $this->prepareData($params, 'settings');
     $this->setData($data);
     return $this->doData();
 }
 protected function executeCallback($v924a8ceeac17f54d3be3f8cdf1c04eb2, $v70e8822b2e035fa3777d666207aeafa8)
 {
     $v22884db148f0ffb0d830ba431102b0b5 = $v924a8ceeac17f54d3be3f8cdf1c04eb2->getCallbackModule();
     $vea9f6aca279138c58f705c8d4cb4b8ce = $v924a8ceeac17f54d3be3f8cdf1c04eb2->getCallbackMethod();
     if ($v47a12618c9a47b69a3050e6b9313a351 = cmsController::getInstance()->getModule($v22884db148f0ffb0d830ba431102b0b5)) {
         $v47a12618c9a47b69a3050e6b9313a351->{$vea9f6aca279138c58f705c8d4cb4b8ce}($v70e8822b2e035fa3777d666207aeafa8);
     } else {
         throw new coreException("Cannot find module \"{$v22884db148f0ffb0d830ba431102b0b5}\"");
     }
 }
Example #21
0
 private static function loadControllers()
 {
     if (!isset(self::$controllers)) {
         $model = new cmsModel();
         self::$controllers = $model->useCache('controllers')->get('controllers', function ($item, $model) {
             $item['options'] = cmsModel::yamlToArray($item['options']);
             return $item;
         }, 'name');
     }
 }
Example #22
0
		public function process($template = null) {
			$order = $this->order;
			$order->order();
			$controller = cmsController::getInstance();
			$module = $controller->getModule("emarket");
			if($module) {
				$module->redirect($controller->pre_lang . '/emarket/purchase/result/successful/');
			}
			return null;
		}
 public static function isNeedCaptha()
 {
     if (cmsController::getInstance()->getModule('users')->is_auth()) {
         return false;
     }
     if (getCookie('umi_captcha') == md5(getCookie('user_captcha'))) {
         $_SESSION['is_human'] = 1;
     }
     return getSession('is_human') != 1;
 }
Example #24
0
 public function __construct()
 {
     $v8b1dc169bf460ee884fceef66c6607d6 = cmsController::getInstance();
     $v2245023265ae4cf87d02c8b6ba991139 = mainConfiguration::getInstance();
     $va1f3f985f72b398ceb0cf19b2c85aeee = 'http://' . $v8b1dc169bf460ee884fceef66c6607d6->getCurrentDomain()->getHost() . '/';
     $vc9ff119073ea2567730fb42e3a4fe805 = (string) $v2245023265ae4cf87d02c8b6ba991139->get('anti-spam', 'akisment.wp-api-key');
     if (!$vc9ff119073ea2567730fb42e3a4fe805) {
         throw new coreException("Specify [anti-spam] akisment.wp-api-key in config.ini");
     }
     $this->doer = new Akismet($va1f3f985f72b398ceb0cf19b2c85aeee, $vc9ff119073ea2567730fb42e3a4fe805);
 }
Example #25
0
 public function vkontakte()
 {
     $network = social_network::getByCodeName('vkontakte');
     if ($network) {
         if (cmsController::getInstance()->getCurrentMode() == "admin") {
             return $this->_network_settings($network);
         } else {
             return $this->display_social_frame($network);
         }
     }
     return false;
 }
Example #26
0
 public function __construct()
 {
     parent::__construct();
     if (cmsController::getInstance()->getCurrentMode() == "admin") {
         $this->__loadLib("__admin.php");
         $this->__implement("__search");
     } else {
         $this->__loadLib("__custom.php");
         $this->__implement("__custom_search");
         $this->per_page = regedit::getInstance()->getVal("//modules/search/per_page");
     }
 }
Example #27
0
function save_controller_options($controllers)
{
    foreach ($controllers as $controller) {
        $controller_root_path = cmsConfig::get('root_path') . 'system/controllers/' . $controller . '/';
        $form_file = $controller_root_path . 'backend/forms/form_options.php';
        $form_name = $controller . 'options';
        cmsCore::loadControllerLanguage($controller);
        $form = cmsForm::getForm($form_file, $form_name, false);
        if ($form) {
            $options = $form->parse(new cmsRequest(cmsController::loadOptions($controller)));
            cmsCore::getModel('content')->filterEqual('name', $controller)->updateFiltered('controllers', array('options' => $options));
        }
    }
}
 public static function isParseTPLMacrosesAllowed()
 {
     static $v22ee71e9dcc9ca12fc313c6e1ce3f806;
     if (is_bool($v22ee71e9dcc9ca12fc313c6e1ce3f806)) {
         return $v22ee71e9dcc9ca12fc313c6e1ce3f806;
     }
     $v22ee71e9dcc9ca12fc313c6e1ce3f806 = true;
     if (cmsController::getInstance()->getCurrentMode() == "admin") {
         $v22ee71e9dcc9ca12fc313c6e1ce3f806 = false;
     } elseif (defined('XML_MACROSES_DISABLE') && XML_MACROSES_DISABLE) {
         $v9cf41e5f460b6ae5505f9809fe9f5d37 = mainConfiguration::getInstance()->get('kernel', 'xml-macroses.allowed');
         $v22ee71e9dcc9ca12fc313c6e1ce3f806 = is_array($v9cf41e5f460b6ae5505f9809fe9f5d37) && count($v9cf41e5f460b6ae5505f9809fe9f5d37);
     }
     return $v22ee71e9dcc9ca12fc313c6e1ce3f806;
 }
Example #29
0
 public function run()
 {
     if (!$this->request->isAjax()) {
         cmsCore::error404();
     }
     $items = $this->request->get('items', array());
     if (!$items || !is_array($items)) {
         cmsCore::error404();
     }
     foreach ($items as $order_id => $block_id) {
         $options['dashboard_order'][(int) $block_id] = (int) $order_id;
     }
     cmsController::saveOptions('admin', array_merge($this->options, $options));
     $this->halt();
 }
 public function __wakeup()
 {
     if ($this->dbValue) {
         $v78a5eb43deef9a7b5b9ce157b9d52ac4 = $this->dbValue;
         if ($v3766293ae0857925595a6f0bf40531a8 = cmsController::getInstance()->getModule("eshop")) {
             $v78a5eb43deef9a7b5b9ce157b9d52ac4 = $v3766293ae0857925595a6f0bf40531a8->calculateDiscount($this->object_id, $v78a5eb43deef9a7b5b9ce157b9d52ac4);
         }
         $v161c9aaa4fe035e7b2f465bc59f3ab45 = new umiEventPoint("umiObjectProperty_loadPriceValue");
         $v161c9aaa4fe035e7b2f465bc59f3ab45->setParam("object_id", $this->object_id);
         $v161c9aaa4fe035e7b2f465bc59f3ab45->addRef("price", $v78a5eb43deef9a7b5b9ce157b9d52ac4);
         $v161c9aaa4fe035e7b2f465bc59f3ab45->call();
         $v2063c1608d6e0baf80249c42e2be5804 = array($v78a5eb43deef9a7b5b9ce157b9d52ac4);
         $this->value = $v2063c1608d6e0baf80249c42e2be5804;
     }
 }