diff --git a/ajax/cart.php b/ajax/cart.php
index 2883de5..d005c41 100755
--- a/ajax/cart.php
+++ b/ajax/cart.php
@@ -1,34 +1,35 @@
-cart->add_item($this->request->get('variant', 'integer'), $this->request->get('amount', 'integer'));
- $cart = $this->cart->get_cart();
- $this->design->assign('cart', $cart);
-
- $currencies = $this->money->get_currencies(array('enabled'=>1));
- if(isset($_SESSION['currency_id']))
- $currency = $this->money->get_currency($_SESSION['currency_id']);
- else
- $currency = reset($currencies);
-
- $this->design->assign('currency', $currency);
-
- return $this->design->fetch('cart_informer.tpl');
- }
- }
-
- $cart_ajax = new CartAjax();
- $result = $cart_ajax->fetch();
-
- header("Content-type: application/json; charset=UTF-8");
- header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
- header("X-Robots-Tag: noindex");
- header("Pragma: no-cache");
- header("Expires: -1");
- print json_encode($result);
- exit;
+cart->add_item($this->request->get('variant', 'integer'), $this->request->get('amount', 'integer'));
+ $cart = $this->cart->get_cart();
+ $this->design->assign('cart', $cart);
+
+ $currencies = $this->money->get_currencies(array('enabled'=>1));
+ if (isset($_SESSION['currency_id'])) {
+ $currency = $this->money->get_currency($_SESSION['currency_id']);
+ } else {
+ $currency = reset($currencies);
+ }
+
+ $this->design->assign('currency', $currency);
+
+ return $this->design->fetch('cart_informer.tpl');
+ }
+ }
+
+ $cart_ajax = new CartAjax();
+ $result = $cart_ajax->fetch();
+
+ header("Content-type: application/json; charset=UTF-8");
+ header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+ header("X-Robots-Tag: noindex");
+ header("Pragma: no-cache");
+ header("Expires: -1");
+ print json_encode($result);
+ exit;
diff --git a/ajax/search_products.php b/ajax/search_products.php
index c6f03cc..f0ae94a 100755
--- a/ajax/search_products.php
+++ b/ajax/search_products.php
@@ -1,55 +1,54 @@
-suggestions = array();
- $result->query = $this->request->get('query', 'string');
-
- if(!empty($result->query))
- {
- $kw = $this->db->escape($result->query);
-
- $this->db->query("SELECT p.id, p.name, i.filename as image FROM __products p
- LEFT JOIN __images i ON i.product_id=p.id AND i.position=(SELECT MIN(position) FROM __images WHERE product_id=p.id LIMIT 1)
- WHERE (p.name LIKE '%$kw%' OR p.meta_keywords LIKE '%$kw%' OR p.id in (SELECT product_id FROM __variants WHERE sku LIKE '%$kw%'))
- AND visible=1
- GROUP BY p.id
- ORDER BY p.name
- LIMIT ?", $this->limit);
- $products = $this->db->results();
-
- $suggestions = array();
-
- foreach($products as $product)
- {
- $suggestion = new stdClass();
-
- if(!empty($product->image))
- $product->image = $this->design->resize_modifier($product->image, 35, 35);
-
- $suggestion->value = $product->name;
- $suggestion->data = $product;
- $result->suggestions[] = $suggestion;
- }
- }
-
-
- return $result;
- }
- }
-
- $cart_ajax = new SearchProductsAjax();
- $result = $cart_ajax->fetch();
-
- header("Content-type: application/json; charset=UTF-8");
- header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
- header("X-Robots-Tag: noindex, noarchive, nosnippet");
- header("Pragma: no-cache");
- header("Expires: -1");
- print json_encode($result);
- exit;
+suggestions = array();
+ $result->query = $this->request->get('query', 'string');
+
+ if (!empty($result->query)) {
+ $kw = $this->db->escape($result->query);
+
+ $this->db->query("SELECT p.id, p.name, i.filename as image FROM __products p
+ LEFT JOIN __images i ON i.product_id=p.id AND i.position=(SELECT MIN(position) FROM __images WHERE product_id=p.id LIMIT 1)
+ WHERE (p.name LIKE '%$kw%' OR p.meta_keywords LIKE '%$kw%' OR p.id in (SELECT product_id FROM __variants WHERE sku LIKE '%$kw%'))
+ AND visible=1
+ GROUP BY p.id
+ ORDER BY p.name
+ LIMIT ?", $this->limit);
+ $products = $this->db->results();
+
+ $suggestions = array();
+
+ foreach ($products as $product) {
+ $suggestion = new stdClass();
+
+ if (!empty($product->image)) {
+ $product->image = $this->design->resize_modifier($product->image, 35, 35);
+ }
+
+ $suggestion->value = $product->name;
+ $suggestion->data = $product;
+ $result->suggestions[] = $suggestion;
+ }
+ }
+
+
+ return $result;
+ }
+ }
+
+ $cart_ajax = new SearchProductsAjax();
+ $result = $cart_ajax->fetch();
+
+ header("Content-type: application/json; charset=UTF-8");
+ header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+ header("X-Robots-Tag: noindex, noarchive, nosnippet");
+ header("Pragma: no-cache");
+ header("Expires: -1");
+ print json_encode($result);
+ exit;
diff --git a/index.php b/index.php
index 4addb47..6dd2034 100755
--- a/index.php
+++ b/index.php
@@ -19,70 +19,71 @@
$view = new IndexView();
-if(isset($_GET['logout']))
-{
- header('WWW-Authenticate: Basic realm="Simpla CMS"');
- header('HTTP/1.0 401 Unauthorized');
- unset($_SESSION['admin']);
+if (isset($_GET['logout'])) {
+ header('WWW-Authenticate: Basic realm="Simpla CMS"');
+ header('HTTP/1.0 401 Unauthorized');
+ unset($_SESSION['admin']);
}
// Если все хорошо
-if(($res = $view->fetch()) !== false)
-{
- // Выводим результат
- header("Content-type: text/html; charset=UTF-8");
- print $res;
-
- // Сохраняем последнюю просмотренную страницу в переменной $_SESSION['last_visited_page']
- if(empty($_SESSION['last_visited_page']) || empty($_SESSION['current_page']) || $_SERVER['REQUEST_URI'] !== $_SESSION['current_page'])
- {
- if(!empty($_SESSION['current_page']) && !empty($_SESSION['last_visited_page']) && $_SESSION['last_visited_page'] !== $_SESSION['current_page'])
- $_SESSION['last_visited_page'] = $_SESSION['current_page'];
- $_SESSION['current_page'] = $_SERVER['REQUEST_URI'];
- }
-}
-else
-{
- // Иначе страница об ошибке
- header("http/1.0 404 not found");
-
- // Подменим переменную GET, чтобы вывести страницу 404
- $_GET['page_url'] = '404';
- $_GET['module'] = 'PageView';
- print $view->fetch();
+if (($res = $view->fetch()) !== false) {
+ // Выводим результат
+ header("Content-type: text/html; charset=UTF-8");
+ print $res;
+
+ // Сохраняем последнюю просмотренную страницу в переменной $_SESSION['last_visited_page']
+ if (empty($_SESSION['last_visited_page']) || empty($_SESSION['current_page']) || $_SERVER['REQUEST_URI'] !== $_SESSION['current_page']) {
+ if (!empty($_SESSION['current_page']) && !empty($_SESSION['last_visited_page']) && $_SESSION['last_visited_page'] !== $_SESSION['current_page']) {
+ $_SESSION['last_visited_page'] = $_SESSION['current_page'];
+ }
+ $_SESSION['current_page'] = $_SERVER['REQUEST_URI'];
+ }
+} else {
+ // Иначе страница об ошибке
+ header("http/1.0 404 not found");
+
+ // Подменим переменную GET, чтобы вывести страницу 404
+ $_GET['page_url'] = '404';
+ $_GET['module'] = 'PageView';
+ print $view->fetch();
}
$p=11; $g=2; $x=7; $r = ''; $s = $x;
$bs = explode(' ', $view->config->license);
-foreach($bs as $bl){
- for($i=0, $m=''; $i
Введите email администратора @@ -118,25 +108,22 @@
"; - $admin_email = $simpla->settings->admin_email; - - if(isset($_POST['email'])) - { - if($_POST['email'] === $admin_email) - { - $code = $simpla->config->token(mt_rand(1, mt_getrandmax()).mt_rand(1, mt_getrandmax()).mt_rand(1, mt_getrandmax())); - $_SESSION['admin_password_recovery_code'] = $code; - $_SESSION['admin_password_recovery_ip'] = $_SERVER['REMOTE_ADDR']; + $admin_email = $simpla->settings->admin_email; - $message = 'Вы или кто-то другой запросил ссылку на восстановление пароля администратора.