/var/www/mybaan.com/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/mybaan.com/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/mybaan.com/bff/db/Database.php
}
if ($where) {
return $this->exec('DELETE FROM ' . $table . ' WHERE ' . $where, $bind);
}
return false;
}
/**
* Get several rows from the table
* @param string $query query text
* @param array|null $bindParams query parameters or null
* @param int $cache cache (in seconds)
* @param int $fetchType PDO::FETCH_NUM, PDO::FETCH_ASSOC, PDO::FETCH_BOTH, PDO::FETCH_OBJ
* @param string $fetchFunc
* @return mixed {@see exec}
*/
public function select($query, $bindParams = null, $cache = 0, $fetchType = PDO::FETCH_ASSOC, $fetchFunc = 'fetchAll')
{
return $this->exec($query, $bindParams, $cache, $fetchType, $fetchFunc);
}
/**
* Get several rows from the table row by row, with subsequent processing in a callback function
* @param string $query query text
* @param array $bindParams query parameters
* @param callable $callback handler function
* @param array|int $options [
* bool 'exclusive' => true Use a new database connection
* int 'fetchType' => PDO::FETCH_ASSOC | PDO::FETCH_NUM | PDO::FETCH_BOTH | PDO::FETCH_OBJ
* ]
*/
public function select_iterator($query, array $bindParams, callable $callback, $options = [])
{
if (is_numeric($options)) {
$options = ['fetchType' => $options];
}
func::array_defaults($options, [
'fetchType' => PDO::FETCH_ASSOC,
'exclusive' => true,
/var/www/mybaan.com/plugins/coco_p00dba1/extensions/modules/listings/model.php
I.lang, I.title, I.title_list, I.descr, I.descr_list, I.owner_type,
I.link, I.img_s, I.img_m, I.imgcnt as imgs,
I.f1,I.f2,I.f3,I.f4,I.f5,I.f6,I.f7,I.f8,I.f9,I.f10,
I.f11,I.f12,I.f13,I.f14,I.f15,I.f16,I.f17,I.f18,I.f19,I.f20,
I.addr_lat as lat, I.addr_lon as lon, I.addr_addr,
I.price, I.price_curr, I.price_ex, I.price_ex_mod, I.owner_type,
I.svc, I.publicated, I.publicated_order as publicated_last, I.modified,
C.settings as cat_settings, CL.title as cat_title,
U.verified as user_verified,
R.title_' . $lang . ' AS city_title, I.regions_delivery ' .
( ! empty($fields) ? ',' . join(',', $fields) : '') . '
FROM ' . static::TABLE_ITEMS . ' I ' . join(' ', $opts['joinTables']) . '
LEFT JOIN ' . Geo::TABLE_REGIONS . ' R ON I.geo_city = R.id
LEFT JOIN ' . Users::TABLE_USERS. ' U ON I.user_id = U.user_id
INNER JOIN ' . static::TABLE_CATEGORIES . ' C ON C.id = I.cat_id
INNER JOIN ' . static::TABLE_CATEGORIES_LANG . ' CL ON CL.id = I.cat_id AND CL.lang = :lang
WHERE I.id IN (' . join(',', $itemsID) . ')
ORDER BY FIELD(I.id,' . join(',', $itemsID) . ')',
array_merge([':lang' => $lang], $opts['bindings']),
$opts['ttl']
);
if ($districtsEnabled) {
$districtsList = [];
foreach ($data as $v) {
if ($v['district_id']) {
$districtsList[] = $v['district_id'];
}
}
if (! empty($districtsList)) {
$districtsList = array_unique($districtsList);
$districtsList = $this->db->tag('listings-items-list-districts')->select_key(
'SELECT id, title_' . $lang . ' as t
FROM ' . Geo::TABLE_REGIONS_DISTRICTS . '
WHERE ' . $this->prepareIN('id', $districtsList)
);
}
}
# check for translation
/var/www/mybaan.com/modules/listings/frontend.php
* item promotion
*/
public function promote()
{
if (! bff::servicesEnabled('listings')) {
return $this->errors->error404();
}
$data = [];
$pageTitle = _t('listings', 'Promotion of the listing');
$from = $this->input->postget('from', TYPE_NOTAGS);
$userID = User::id();
$svc = $this->input->postget('svc', TYPE_ARRAY_STR);
$itemID = $this->input->getpost('id', TYPE_UINT); # Item ID
if ($this->input->get('success')) {
return $this->itemStatus('promote.success', $itemID);
}
$ak = $this->input->get('ak', TYPE_STR);
$itemData = $this->model->itemsList(['id' => $itemID], false, ['fields' => ['user_id','company_id','status','blocked_reason','cat_id','geo_city']]);
$itemData = reset($itemData);
if (!$itemID || empty($itemData)) {
if ($this->isPOST()) {
$this->errors->reloadPage();
return $this->ajaxResponseForm([]);
}
return $this->showForbidden($pageTitle, _t('listings', 'Listing not found, or the link is incorrect'));
}
if (empty($itemData['imgs'])) {
$images = $this->itemImages();
$itemData['img_s'] = $images->urlDefault($images::szSmall);
$itemData['img_m'] = $images->urlDefault($images::szMedium);
}
$payWaysList = Bills::getPayWaysList(!empty($userID), ['promotePage' => true]);
$manager = $this->itemServices();
$userBalance = User::balance();
if ($this->isPOST()) {
/var/www/mybaan.com/bff/vendor/illuminate/container/BoundMethod.php
* @param callable|string $callback
* @param array $parameters
* @param string|null $defaultMethod
* @return mixed
*
* @throws \ReflectionException
* @throws \InvalidArgumentException
*/
public static function call($container, $callback, array $parameters = [], $defaultMethod = null)
{
if (is_string($callback) && ! $defaultMethod && method_exists($callback, '__invoke')) {
$defaultMethod = '__invoke';
}
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
*
* @param \Illuminate\Container\Container $container
* @param string $target
* @param array $parameters
* @param string|null $defaultMethod
* @return mixed
*
* @throws \InvalidArgumentException
*/
protected static function callClass($container, $target, array $parameters = [], $defaultMethod = null)
{
$segments = explode('@', $target);
// We will assume an @ sign is used to delimit the class name from the method
// name. We will split on this @ sign and then build a callable array that
/var/www/mybaan.com/bff/vendor/illuminate/container/Util.php
public static function arrayWrap($value)
{
if (is_null($value)) {
return [];
}
return is_array($value) ? $value : [$value];
}
/**
* Return the default value of the given value.
*
* From global value() helper in Illuminate\Support.
*
* @param mixed $value
* @return mixed
*/
public static function unwrapIfClosure($value)
{
return $value instanceof Closure ? $value() : $value;
}
/**
* Get the class name of the given parameter's type, if possible.
*
* From Reflector::getParameterClassName() in Illuminate\Support.
*
* @param \ReflectionParameter $parameter
* @return string|null
*/
public static function getParameterClassName($parameter)
{
$type = $parameter->getType();
if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) {
return null;
}
$name = $type->getName();
/var/www/mybaan.com/bff/vendor/illuminate/container/BoundMethod.php
* @param callable $callback
* @param mixed $default
* @return mixed
*/
protected static function callBoundMethod($container, $callback, $default)
{
if (! is_array($callback)) {
return Util::unwrapIfClosure($default);
}
// Here we need to turn the array callable into a Class@method string we can use to
// examine the container and see if there are any method bindings for this given
// method. If there are, we can call this method binding callback immediately.
$method = static::normalizeMethod($callback);
if ($container->hasMethodBinding($method)) {
return $container->callMethodBinding($method, $callback[0]);
}
return Util::unwrapIfClosure($default);
}
/**
* Normalize the given callback into a Class@method string.
*
* @param callable $callback
* @return string
*/
protected static function normalizeMethod($callback)
{
$class = is_string($callback[0]) ? $callback[0] : get_class($callback[0]);
return "{$class}@{$callback[1]}";
}
/**
* Get all dependencies for a given method.
*
* @param \Illuminate\Container\Container $container
* @param callable|string $callback
/var/www/mybaan.com/bff/vendor/illuminate/container/BoundMethod.php
* @param array $parameters
* @param string|null $defaultMethod
* @return mixed
*
* @throws \ReflectionException
* @throws \InvalidArgumentException
*/
public static function call($container, $callback, array $parameters = [], $defaultMethod = null)
{
if (is_string($callback) && ! $defaultMethod && method_exists($callback, '__invoke')) {
$defaultMethod = '__invoke';
}
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
*
* @param \Illuminate\Container\Container $container
* @param string $target
* @param array $parameters
* @param string|null $defaultMethod
* @return mixed
*
* @throws \InvalidArgumentException
*/
protected static function callClass($container, $target, array $parameters = [], $defaultMethod = null)
{
$segments = explode('@', $target);
// We will assume an @ sign is used to delimit the class name from the method
// name. We will split on this @ sign and then build a callable array that
// we can pass right back into the "call" method for dependency binding.
/var/www/mybaan.com/bff/vendor/illuminate/container/Container.php
public function wrap(Closure $callback, array $parameters = [])
{
return function () use ($callback, $parameters) {
return $this->call($callback, $parameters);
};
}
/**
* Call the given Closure / class@method and inject its dependencies.
*
* @param callable|string $callback
* @param array<string, mixed> $parameters
* @param string|null $defaultMethod
* @return mixed
*
* @throws \InvalidArgumentException
*/
public function call($callback, array $parameters = [], $defaultMethod = null)
{
return BoundMethod::call($this, $callback, $parameters, $defaultMethod);
}
/**
* Get a closure to resolve the given type from the container.
*
* @param string $abstract
* @return \Closure
*/
public function factory($abstract)
{
return function () use ($abstract) {
return $this->make($abstract);
};
}
/**
* An alias function name for make().
*
* @param string|callable $abstract
* @param array $parameters
/var/www/mybaan.com/bff/base/Application.php
if ($this->frontend()) {
if (! $this->security()->isPublicMethod($name, $method)) {
return Site::showAccessDenied();
}
} elseif ($this->adminPanel()) {
$action = $this->input()->getpost('act', TYPE_STR);
if (
! (
$this->security()->haveAccessToModuleMethod($controller, $method, $action) ||
$this->security()->isPublicMethod($name, $method)
)
) {
return Site::showAccessDenied();
}
}
}
if ($opts['inject'] && method_exists($controller, $method)) {
# inject dependencies and call existing method
return $this->call([$controller, $method], $parameters);
}
return call_user_func_array([$controller, $method], array_values($parameters));
}
/**
* Call the required method in all application modules (in which it is implemented)
* Call method in each application module/pluging/theme
* @param string $method
* @param array $parameters
* @param array $opts [
* string|null 'context' => application context
* bool 'modules' => call modules
* bool 'plugins' => call plugins
* bool 'theme' => call active theme
* ]
* @return void
*/
public function callModules(
string $method,
array $parameters = [],
/var/www/mybaan.com/bff/base/Route.php
/**
* 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;
if (is_string($callable)) {
if (strpos($callable, '/') !== false) {
$callable = explode('/', trim($callable, '/'), 3);
} elseif (strpos($callable, '::') !== false) {
$callable = explode('::', $callable);
} elseif (strpos($callable, '@') !== false) {
$callable = explode('@', $callable);
} else {
/var/www/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/bff/middleware/Offline.php
<?php //ICB0 71:0 81:145c ?><?php //00091
// Copyright Tamaranga. 2014-2022
// All Rights Reserved
echo('No IonCube Loader is installed. Please contact support.');exit(199);
?>
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
/var/www/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/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/mybaan.com/bff/base/Application.php
'seo-redirects' => 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/mybaan.com/public_html/index.php
<?php
require __DIR__ . '/../bff/bootstrap.php';
bff()->run();