/var/www/natumbe.kz/bff/db/Database.php
}
}
}
if (is_null($arg)) {
$query = $this->pdo->query($cmd);
} else {
$query = $this->pdo->prepare($cmd, $prepareOptions);
if (is_object($query)) {
foreach ($arg as $key => $value) {
if (
!(is_array($value) ?
$query->bindValue($key, $value[0], $value[1]) :
$query->bindValue($key, $value, $this->type($value))
)
) {
break;
}
}
$query->execute();
}
}
# Check SQLSTATE
if (!$this->errorCheck($query, ['query' => $cmd, 'bind' => $arg])) {
if ($this->tag !== false) {
$this->tag = false;
}
return false;
}
if ($fetchType !== false || preg_match('/^\s*(?:SELECT|PRAGMA|SHOW|EXPLAIN)\s/i', (string) $cmd)) {
if ($fetchFunc !== false) {
$this->result = $query->$fetchFunc($fetchType);
$this->rows = $query->rowCount();
$query = null;
} else {
$this->result = $query;
}
} else {
$this->rows = $this->result = $query->rowCount();
/var/www/natumbe.kz/bff/db/Database.php
}
}
}
if (is_null($arg)) {
$query = $this->pdo->query($cmd);
} else {
$query = $this->pdo->prepare($cmd, $prepareOptions);
if (is_object($query)) {
foreach ($arg as $key => $value) {
if (
!(is_array($value) ?
$query->bindValue($key, $value[0], $value[1]) :
$query->bindValue($key, $value, $this->type($value))
)
) {
break;
}
}
$query->execute();
}
}
# Check SQLSTATE
if (!$this->errorCheck($query, ['query' => $cmd, 'bind' => $arg])) {
if ($this->tag !== false) {
$this->tag = false;
}
return false;
}
if ($fetchType !== false || preg_match('/^\s*(?:SELECT|PRAGMA|SHOW|EXPLAIN)\s/i', (string) $cmd)) {
if ($fetchFunc !== false) {
$this->result = $query->$fetchFunc($fetchType);
$this->rows = $query->rowCount();
$query = null;
} else {
$this->result = $query;
}
} else {
$this->rows = $this->result = $query->rowCount();
/var/www/natumbe.kz/bff/db/Database.php
'query' => 'SELECT ' . $select . ' FROM ' . $table . ' ' . $tablePrefix . ' ' . $filter['where'] . $groupBy . $orderBy . (!empty($limit) ? ' ' . $limit : ''),
'bind' => $filter['bind'],
];
}
/**
* Get several rows from the table, with subsequent grouping by column
* @param string $table table name
* @param array $fields list of columns
* @param string|array $where WHERE conditions
* @param string|array $orderBy sorting order
* @param string $limit LIMIT condition
* @param array $cryptKeys encrypted columns
* @param int $cache cache (in seconds)
* @return mixed {@see exec}
*/
public function select_rows($table, array $fields = [], $where = [], $orderBy = '', $limit = '', array $cryptKeys = [], $cache = 0)
{
$select = $this->select_prepare($table, $fields, $where, ['orderBy' => $orderBy, 'limit' => $limit, 'cryptKeys' => $cryptKeys]);
return $this->exec($select['query'], $select['bind'], $cache, PDO::FETCH_ASSOC, 'fetchAll');
}
/**
* Get all rows from the table step by step, with subsequent processing in a callback function
* @param string $table table name
* @param array $fields list of columns
* @param array $where WHERE conditions
* @param string|array $orderBy sorting order
* @param array $cryptKeys encrypted columns
* @param callback $callback handler function
* @param int $step number of records processed per step
* @return int total number of records in the table
*/
public function select_rows_chunked($table, array $fields = [], array $where = [], $orderBy = '', array $cryptKeys = [], $callback = 0, $step = 100)
{
$total = $this->select_rows_count($table, $where);
if ($total > 0 && is_callable($callback)) {
if ($total < $step) {
$rows = $this->select_rows($table, $fields, $where, $orderBy, '', $cryptKeys);
if (!empty($rows)) {
/var/www/natumbe.kz/bff/db/Database.php
$defaults = array_fill_keys(bff::locale()->getLanguages(), '');
foreach ($fields as $key => $fieldType) {
if (
(is_int($fieldType) && $fieldType >= TYPE_CONVERT_SINGLE) ||
(is_array($fieldType) && is_int(reset($fieldType)) && reset($fieldType) >= TYPE_CONVERT_SINGLE)
) {
$fields[$key] = true; // mark as nested array
$data[$key] = [];
} else {
$data[$key] = $defaults;
}
}
if (!is_array($filter)) {
$filter = ['id' => $filter];
}
if ($lang) {
$filter['lang'] = $lang;
}
$rows = $this->select_rows($table, array_merge(array_keys($fields), ['lang']), $filter);
foreach ($rows as $row) {
foreach ($fields as $key => $fieldType) {
if ($fieldType === true) {
$subData = json_decode($row[$key] ?? '{}', true);
if (is_array($subData)) {
foreach ($subData as $subKey => $subValue) {
if ($lang) {
$data[$key][$subKey] = $subValue;
} else {
if (!isset($data[$key][$subKey])) {
$data[$key][$subKey] = $defaults;
}
$data[$key][$subKey][$row['lang']] = $subValue;
}
}
}
} else {
if ($lang) {
$data[$key] = $row[$key];
} else {
/var/www/natumbe.kz/modules/listings/model.php
* Getting translation data for item
* @param int $itemId
* @param string|null $lang one language only
* @param array $opts [exclude]
* @return array
*/
public function itemLangData($itemId, ?string $lang = null, array $opts = [])
{
$filter = ['id' => $itemId];
if ($lang) {
$filter['lang'] = $lang;
}
$fields = $opts['fields'] ?? array_merge($this->langItem, $this->langItemSEO);
if ($opts['exclude'] ?? false) {
foreach ($opts['exclude'] as $field) {
unset($fields[$field]);
}
}
$data = [];
$this->db->langSelect($filter, $data, $fields, static::TABLE_ITEMS_LANG, $lang);
return $data;
}
/**
* Getting data about several items by filter
* @param array $filter filter parameters
* @param array $fields required fields
* @param array $opts:
* string 'context' function call context
* string 'prefix' table prefix
* bool 'oneColumn' one column from the table
* string 'groupKey' field for grouping data in the array, default: 'id'
* string|array 'groupBy' query condition GROUP BY
* string|array 'orderBy' query condition ORDER BY
* int|string|array 'limit' sample limit, for example: 15
* callable 'iterator' iterator function
* @return mixed
*/
public function itemsDataByFilter(array $filter, array $fields = [], array $opts = [])
{
/var/www/natumbe.kz/modules/listings/model.php
if (! isset($data[$k])) {
$data[$k] = $v;
}
}
}
}
# load item translatable + SEO data
$langFieldsExclude = [];
if ($data['mcategorytemplate']) { # use category seo settings
$langFieldsExclude = array_merge($langFieldsExclude, ['mtitle','mkeywords','mdescription','seotext']);
} else {
$data['mtemplate'] = 0; # use only item seo settings (without template)
}
if ($data['mcategorysocialtemplate']) { # use category social settings
$langFieldsExclude[] = 'msocialtext';
} else {
$data['msocialtemplate'] = 0; # use only item social settings (without template)
}
$translate = $this->itemLangData($itemID, $lang, ['exclude' => $langFieldsExclude]);
foreach ($translate as $f => $value) {
$data[$f] = (is_string($value) && $value !== '' ? $value : ($data[$f] ?? ''));
}
# active services
$data['svc'] = explode(',', $data['svc']);
}
$this->app->hook('listings.model.item.data.view.data', ['data' => &$data, 'opts' => &$opts]);
return $data;
}
/**
* Getting translation data for item
* @param int $itemId
* @param string|null $lang one language only
* @param array $opts [exclude]
* @return array
*/
/var/www/natumbe.kz/modules/listings/views/ItemPage.php
# Last Modified
if (! $this->isDebug() && ! $this->userId && $this->request->isRobot()) {
if (! $this->request->lastModified($this->item['modified'])) {
return Response::notModified($this->item['modified']);
}
}
# Url correction
$this->request->urlCorrection($this->item['link']);
return $this;
}
public function loadItem()
{
if (! empty($this->item)) {
return true;
}
$this->item = Listings::model()->itemDataView($this->itemId);
if (empty($this->item)) {
return false;
}
# Item owner
$this->item['owner'] = ($this->item['user_id'] && $this->userId && $this->userId == $this->item['user_id']);
# Owner data
$this->item['user'] = Users::model()->usersDataSidebar($this->item['user_id']);
# Owner company data
$this->item['company'] = [];
if ($this->item['company_id'] && bff::businessEnabled()) {
$this->item['company'] = Business::model()->companiesDataSidebar($this->item['company_id']);
if ($this->item['company']) {
$this->item['name'] = $this->item['company']['title'];
}
}
$this->item['is_company'] = ($this->item['company_id'] && $this->item['company']);
/var/www/natumbe.kz/modules/listings/views/ItemPage.php
return (new static())->handle($id);
}
/**
* @return bool Item comments enabled
*/
public function comments()
{
return $this->config('listings.comments', true, TYPE_BOOL);
}
/**
* Handle page request
* @param int $id item id
*/
public function handle($id)
{
$this->itemId = $id;
$this->userId = $this->request->userId();
if (! $id || ! $this->loadItem()) {
return $this->errors->error404();
}
$this->from = $this->input->get('from', TYPE_STR);
$this->moderation = Listings::moderationUrlKey($id, $this->input->get('mod', TYPE_STR));
# Last Modified
if (! $this->isDebug() && ! $this->userId && $this->request->isRobot()) {
if (! $this->request->lastModified($this->item['modified'])) {
return Response::notModified($this->item['modified']);
}
}
# Url correction
$this->request->urlCorrection($this->item['link']);
return $this;
}
public function loadItem()
{
/var/www/natumbe.kz/modules/listings/routes.php
'callback' => function ($category, $keyword, $id) {
return bff(ItemPage::class)->handle($id);
},
'page' => ItemPage::class,
'priority' => 90,
],
# item view + category landing pages
'listings-view-landingpages' => [
'pattern' => '{any}/{keyword}-{id}.html',
'callback' => function ($keyword, $id) {
return bff(ItemPage::class)->handle($id);
},
'page' => ItemPage::class,
'priority' => 100,
],
# item view
'listings-item.view' => [
'pattern' => '{keyword}-{id}.html',
'callback' => function ($keyword, $id) {
return bff(ItemPage::class)->handle($id);
},
'page' => ItemPage::class,
'url' => function ($p, $o) use ($prefix, $useViewPrefix, $useViewCategory, $useViewGeo) {
# form link based on the specified area (region), [city (city)]
# or taking into account the current filter settings by region
if (! $useViewGeo || ! empty($p['no_region'])) {
$p['city'] = ['keyword' => ''];
$deep = Geo::maxDeep();
for ($i = 1; $i <= $deep; $i++) {
unset($p['region' . $i]);
}
}
$geo = Geo::url($p, $o['dynamic'], false);
$cat = '';
if ($useViewPrefix) {
if ($useViewCategory) {
if (empty($p['landing_url'])) {
$cat = '/' . $prefix . (!empty($p['category']) ? '/' . $p['category'] : '');
} else {
$cat = $p['landing_url'];
/var/www/natumbe.kz/bff/base/Route.php
return bff::filter(
'routing.route.run.after.' . $this->getId(),
$this->runAction(),
$this,
$request
);
}
/**
* Run route action
* @return mixed
* @throws \Exception
*/
public function runAction()
{
$params = $this->getParams();
if ($this->controller instanceof Closure) {
return call_user_func_array($this->controller, array_values($params));
}
return bff()->callController(
$this->getControllerName(),
$this->getControllerMethod(),
$params,
[
'inject' => ! bff()->cron(),
'direct' => $this->isDirect(),
]
);
}
/**
* Parse action to get controller
* @return void
*/
protected function parseAction()
{
$callable = $this->action;
/var/www/natumbe.kz/bff/base/Route.php
return bff::filter(
'routing.route.run.after.' . $this->getId(),
$this->runAction(),
$this,
$request
);
}
/**
* Run route action
* @return mixed
* @throws \Exception
*/
public function runAction()
{
$params = $this->getParams();
if ($this->controller instanceof Closure) {
return call_user_func_array($this->controller, array_values($params));
}
return bff()->callController(
$this->getControllerName(),
$this->getControllerMethod(),
$params,
[
'inject' => ! bff()->cron(),
'direct' => $this->isDirect(),
]
);
}
/**
* Parse action to get controller
* @return void
*/
protected function parseAction()
{
$callable = $this->action;
/var/www/natumbe.kz/bff/base/Route.php
return false;
}
/**
* Run route
* @param \bff\http\Request $request
* @return \bff\http\Response|mixed
*/
public function run(Request $request)
{
bff::hook(
'routing.route.run.before.' . $this->getId(),
$this,
$request
);
return bff::filter(
'routing.route.run.after.' . $this->getId(),
$this->runAction(),
$this,
$request
);
}
/**
* Run route action
* @return mixed
* @throws \Exception
*/
public function runAction()
{
$params = $this->getParams();
if ($this->controller instanceof Closure) {
return call_user_func_array($this->controller, array_values($params));
}
return bff()->callController(
$this->getControllerName(),
/var/www/natumbe.kz/bff/base/Router.php
}
}
if ($controller && $action) {
return $this->get(static::DIRECT_ROUTE, '', $controller . '/' . $action . '/');
}
return null;
}
/**
* Gather route middleware
* @param \bff\http\Request $request
* @param \bff\base\Route $route
* @return \bff\http\Response|mixed
*/
public function runRoute(Request $request, Route $route)
{
try {
# Run
$response = $route->run($request);
if ($response instanceof Block) {
$response = $response->render();
}
} catch (ResponseException $e) {
# Special type of exception in cases where unable to implement proper "return Response"
return $e->getResponse();
} catch (ModelRecordNotFoundException $e) {
if (Errors::no()) {
Errors::unknownRecord();
}
if ($request->isAJAX()) {
return Response::json(['data' => [], 'errors' => Errors::get()]);
}
} catch (NotFoundException $e) {
return Response::notFound($e->getResponse());
} catch (Throwable $e) {
if (! bff()->isDebug()) {
Errors::logException($e);
return Errors::error404();
}
/var/www/natumbe.kz/bff/base/Application.php
if (is_string($middleware) && array_key_exists($middleware, $this->middlewareGroups)) {
foreach ($this->middlewareGroups[$middleware] as $key => $value) {
if (is_string($key)) {
$stack[$key] = $value;
} else {
$stack[] = $value;
}
}
} else {
$stack[] = $middleware;
}
}
if ($this->adminPanel()) {
# Admin
$stack[] = ['callback' => \bff\middleware\AdminPanel::class, 'priority' => 100];
} else {
# Frontend ...
$stack[] = ['callback' => function (Request $request, $next) use ($route) {
# Run
$response = $this->router()->runRoute($request, $route);
# Html + Layout
if (is_string($response)) {
return $this->view()->layoutResponse([
'centerblock' => $this->view()->vueRender(
$this->tags()->process($response)
),
]);
}
# Other response types
return Response::responsify($response);
}, 'priority' => 100];
}
} else {
if ($this->adminPanel()) {
# Admin
$stack[] = ['callback' => \bff\middleware\StartSession::class, 'priority' => 50];
$stack[] = ['callback' => \bff\middleware\AdminPanel::class, 'priority' => 100];
} else {
# Not found: Frontend ...
$stack[] = function () {
/var/www/natumbe.kz/bff/vendor/illuminate/pipeline/Pipeline.php
return $this->handleException($passable, $e);
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
if (is_callable($pipe)) {
// If the pipe is a callable, then we will call it directly, but otherwise we
// will resolve the pipes out of the dependency container and call it with
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
/var/www/natumbe.kz/bff/middleware/StartSession.php
/**
* Handle the given request within session state.
*
* @param \bff\http\Request $request
* @param \Illuminate\Contracts\Session\Session $session
* @param \Closure $next
* @return mixed
*/
protected function handleStatefulRequest(Request $request, $session, Closure $next)
{
// If a session driver has been configured, we will need to start the session here
// so that the data is ready for an application. Note that the Laravel sessions
// do not make use of PHP "native" sessions in any way since they are crappy.
$request->setSession(
$this->startSession($request, $session)
);
$this->collectGarbage($session);
$response = $next($request);
$this->storeCurrentUrl($request, $session);
if ($this->isSecureRequest($request, $session)) {
$response = $this->addCookieToResponse($response, $session);
// Again, if the session has been configured we will need to close out the session
// so that the attributes may be persisted to some storage medium. We will also
// add the session identifier cookie to the application response headers now.
$this->saveSession($request);
}
return $response;
}
/**
* Start the session for the given request.
*
* @param \bff\http\Request $request
* @param \Illuminate\Contracts\Session\Session $session
/var/www/natumbe.kz/bff/middleware/StartSession.php
*/
public function handle($request, Closure $next)
{
if (! $this->sessionConfigured()) {
return $next($request);
}
# No session for robots
if ($request->isRobot()) {
config::temp('session.driver', 'array');
}
$session = $this->getSession($request);
if (
$this->manager->shouldBlock() ||
($request->route() instanceof Route && $request->route()->locksFor())
) {
return $this->handleRequestWhileBlocking($request, $session, $next);
} else {
return $this->handleStatefulRequest($request, $session, $next);
}
}
/**
* Handle the given request within session state.
*
* @param \bff\http\Request $request
* @param \Illuminate\Contracts\Session\Session $session
* @param \Closure $next
* @return mixed
*/
protected function handleRequestWhileBlocking(Request $request, $session, Closure $next)
{
if (! $request->route() instanceof Route) {
return;
}
$lockFor = $request->route() && $request->route()->locksFor()
? $request->route()->locksFor()
: 10;
/var/www/natumbe.kz/bff/vendor/illuminate/pipeline/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
/var/www/natumbe.kz/bff/middleware/UserLastActivity.php
use User;
use Users;
use bff\http\Request;
/**
* Marking the user's last activity
* @copyright Tamaranga
*/
class UserLastActivity
{
public function __invoke(Request $request, $next)
{
if (User::logined()) {
$userID = User::id();
# Update last activity
Users::updateUserLastActivity($userID);
}
return $next($request);
}
}
/var/www/natumbe.kz/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/natumbe.kz/bff/middleware/LoginAuto.php
$userData = Users::model()->userData($userID, ['user_id', 'user_id_ex', 'last_login']);
if (empty($userData)) {
break;
}
if (Users::model()->userIsAdministrator($userID)) {
break;
}
if ($hashFull !== Users::loginAutoHash($userData)) {
break;
}
if (Users::i()->authById($userID) === true) {
break;
}
return Redirect::route('users-login', [
'ref' => $request->url(true),
]);
} while (false);
return $next($request);
}
}
/var/www/natumbe.kz/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/natumbe.kz/bff/middleware/Offline.php
<?php //ICB0 71:0 81:1479 ?><?php //00091
// Copyright Tamaranga. 2014-2022
// All Rights Reserved
echo('No IonCube Loader is installed. Please contact support.');exit(199);
?>
HR+cPpsRVv7wPKIdZoZgiWBGBL6EWIBnzYYYoyT8TQcEYEJR07YQmDD5ss2YakPINkQI70EV7gxg
Njn6vZuhWbTij+EVHLyudLlZaj6q0mZztdX0zM/8ghGp8mJFsBSsMshX7lOO6QGUpcqjTFO8LA1f
zXdlmpB8BOKX5AwE0kN4hwPDAbh5bMjlK7c8GkWC5/Wg1Fqld7u2Dzd8LDx4oOaQb5StKb+lZ1gT
PCSwPKxZX0yvzvqvxmewuJCuRaUqySX6KbXGre7l9zDmpiUWdLvsdArI775JgvNYWIrj7R/wOaHU
fnT9AzD/7K+KtN2nXjEpQQE5kQix9Nirc7Q5C+rTYbPwI0jgVuAfHl98qzQ5klQDVbu2R/V2pdux
g8TQ9TDIDPlBAylne/QNE4j7SWtxCGQLuPuULxiUtwNR7s4IW2Dpx4qRSHm5b8s8IdKmRcSppdZ7
r4enDjEiMhINBaUEP6ViRmJqkgfAg4aYokiNAgg7kqm9Vdx7CJi0WAoeHS2vtYvmnuRXLI9s33FE
Pjk6LZjlFVwbwH1YJ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.kz/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/natumbe.kz/app/middleware/SubdomainsValidation.php
break;
}
if (preg_match('/(.*)\.' . preg_quote(SITEHOST) . '/', $host, $matches) <= 0) {
break;
}
if (empty($matches[1])) {
break;
}
if (Geo::urlType() !== Geo::URL_SUBDOMAIN) {
return Errors::error404();
};
$region = Geo::regionDataByKeyword($matches[1]);
if (empty($region)) {
# Could not find region by keyword
return Errors::error404();
}
} while (false);
return $next($request);
}
}
/var/www/natumbe.kz/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/natumbe.kz/bff/middleware/Cors.php
* @param mixed $next
* @return ResponseInterface
*/
public function __invoke(RequestInterface $request, $next)
{
return $this->handle($request, $next);
}
/**
* Handle request
* @param RequestInterface $request
* @param mixed $next
* @return ResponseInterface
*/
public function handle(RequestInterface $request, $next)
{
# Skip requests without Origin header
if (! $request->hasHeader('Origin')) {
# Not an access control request
return $next($request);
}
# Preflight Request
if ($this->isPreflightRequest($request)) {
return $this->setCorsHeaders($request, ResponseFactory::empty(), true);
}
# Strict request validation
if ($this->strict() && ! $this->isAllowedRequest($request)) {
return ResponseFactory::createResponse(403, $this->options['forbidden_message'] ?? '');
}
return $this->setCorsHeaders($request, $next($request));
}
/**
* Is preflight request
* @param RequestInterface $request
* @return bool
*/
/var/www/natumbe.kz/bff/vendor/illuminate/pipeline/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
/var/www/natumbe.kz/bff/middleware/FrameGuard.php
<?php
namespace bff\middleware;
use Security;
use bff\http\Request;
/**
* X-Frame-Options
* @copyright Tamaranga
*/
class FrameGuard
{
public function __invoke(Request $request, $next)
{
if (! $request->isPOST()) {
Security::setIframeOptions();
}
return $next($request);
}
}
/var/www/natumbe.kz/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/natumbe.kz/bff/middleware/TrustedProxies.php
namespace bff\middleware;
use Cache;
use config;
use bff\http\Request;
/**
* Allowed proxies
* @copyright Tamaranga
*/
class TrustedProxies
{
public function __invoke(Request $request, $next)
{
$request->setTrustedProxies([]); // reset state between requests
$trusted = config::get('request.trusted.proxies');
if (is_null($trusted) || $trusted === '') {
return $next($request);
}
if (is_string($trusted)) {
if ($trusted === '*') {
$trusted = [
$request->remoteAddress(false, false) // current IP
];
} else {
$trusted = array_map('trim', explode(',', $trusted));
}
}
if (is_array($trusted)) {
$request->setTrustedProxies(
$this->mixinCloudFlareIps($trusted)
);
}
return $next($request);
}
/var/www/natumbe.kz/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/natumbe.kz/bff/vendor/illuminate/pipeline/Pipeline.php
public function via($method)
{
$this->method = $method;
return $this;
}
/**
* Run the pipeline with a final destination callback.
*
* @param \Closure $destination
* @return mixed
*/
public function then(Closure $destination)
{
$pipeline = array_reduce(
array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Run the pipeline and return the result.
*
* @return mixed
*/
public function thenReturn()
{
return $this->then(function ($passable) {
return $passable;
});
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
/var/www/natumbe.kz/bff/base/Application.php
}
return $result;
}
/**
* Run middleware stack
* @param array $pipes
* @param mixed $passable
* @param Closure|null $destination
* @return mixed|\bff\http\Response
*/
public function middlewareRun(array $pipes, $passable, ?Closure $destination = null)
{
return (new Pipeline($this))
->send($passable)
->through($pipes)
->then($destination ?? function ($passable) {
return $passable;
});
}
/**
* @param string $method
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
# Call macro method
if (static::hasMacro($method)) {
return $this->callMacro($method, $parameters);
}
return null;
}
/**
* Handle dynamic static method calls into the method.
* @param string $method
/var/www/natumbe.kz/bff/base/Application.php
'dynamic' => true,
]);
}
} catch (Throwable $e) {
$route = null;
}
# Handle route
if ($route) {
# Controller/action fallback
bff::$class = $route->getControllerName();
bff::$event = $route->getControllerMethod();
# Set request route
$request->setRouteResolver(function () use ($route) {
return $route;
});
}
# Call middleware stack
$response = $this->middlewareRun($this->finalizeMiddleware(
$this->filter('app.middleware', $this->middlewares),
$route
), $request);
# Fix http protocol mismatch
if ($response->getProtocolVersion() !== ($requestProtocol = $request->getProtocolVersion())) {
if ($requestProtocol === '2.0') {
$requestProtocol = '2';
}
$response = $response->withProtocolVersion($requestProtocol);
}
# Respond
if ($respond) {
$this->respond($response);
}
return $response;
}
/var/www/natumbe.kz/public_html/index.php
<?php
$_SERVER["DOCUMENT_ROOT"] = __DIR__;
require_once($_SERVER['DOCUMENT_ROOT'].'/protect192/code/include.php');
require __DIR__ . '/../bff/bootstrap.php';
bff()->run();