HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/magento.bikenow.co/vendor/magento/module-security/Model/Config.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Security\Model;

use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Config\ScopeInterface;
use Magento\Store\Model\ScopeInterface as StoreScopeInterface;

/**
 * Security config
 */
class Config implements ConfigInterface
{
    /**
     * Period of time which will be used to limit frequency of password reset requests
     */
    const LIMITATION_TIME_PERIOD = 3600;

    /**
     * Configuration path to admin area
     */
    const XML_PATH_ADMIN_AREA = 'admin/security/';

    /**
     * Configuration path to frontend area
     */
    const XML_PATH_FRONTEND_AREA = 'customer/password/';

    /**
     * Configuration path to fronted area
     * @deprecated
     * @see \Magento\Security\Model\Config::XML_PATH_FRONTEND_AREA
     */
    const XML_PATH_FRONTED_AREA = self::XML_PATH_FRONTEND_AREA;

    /**
     * Configuration path to admin account sharing
     */
    const XML_PATH_ADMIN_ACCOUNT_SHARING = 'admin/security/admin_account_sharing';

    /**
     * Configuration key to limit password reset requests method
     */
    const XML_PATH_PASSWORD_RESET_PROTECTION_TYPE = 'password_reset_protection_type';

    /**
     * Configuration key to max number password reset requests
     */
    const XML_PATH_MAX_NUMBER_PASSWORD_RESET_REQUESTS = 'max_number_password_reset_requests';

    /**
     * Configuration key to minimum time between password reset requests
     */
    const XML_PATH_MIN_TIME_BETWEEN_PASSWORD_RESET_REQUESTS = 'min_time_between_password_reset_requests';

    /**
     * Recipient email config path
     */
    const XML_PATH_EMAIL_RECIPIENT = 'contact/email/recipient_email';

    /**
     * @var ScopeConfigInterface
     */
    private $scopeConfig;

    /**
     * @var ScopeInterface
     */
    private $scope;

    /**
     * SecurityConfig constructor.
     *
     * @param ScopeConfigInterface $scopeConfig
     * @param ScopeInterface $scope
     */
    public function __construct(
        ScopeConfigInterface $scopeConfig,
        ScopeInterface $scope
    ) {
        $this->scopeConfig = $scopeConfig;
        $this->scope = $scope;
    }

    /**
     * {@inheritDoc}
     *
     * @return string
     */
    public function getCustomerServiceEmail()
    {
        return $this->scopeConfig->getValue(
            self::XML_PATH_EMAIL_RECIPIENT,
            StoreScopeInterface::SCOPE_STORE
        );
    }

    /**
     * {@inheritDoc}
     *
     * @return int
     */
    public function getLimitationTimePeriod()
    {
        return self::LIMITATION_TIME_PERIOD;
    }

    /**
     * {@inheritDoc}
     *
     * @return bool
     */
    public function isAdminAccountSharingEnabled()
    {
        return $this->scopeConfig->isSetFlag(
            self::XML_PATH_ADMIN_ACCOUNT_SHARING,
            StoreScopeInterface::SCOPE_STORE
        );
    }

    /**
     * {@inheritDoc}
     *
     * @return int
     */
    public function getAdminSessionLifetime()
    {
        return (int) $this->scopeConfig->getValue(\Magento\Backend\Model\Auth\Session::XML_PATH_SESSION_LIFETIME);
    }

    /**
     * {@inheritDoc}
     *
     * @return string
     */
    protected function getXmlPathPrefix()
    {
        if ($this->scope->getCurrentScope() == \Magento\Framework\App\Area::AREA_ADMINHTML) {
            return self::XML_PATH_ADMIN_AREA;
        }
        return self::XML_PATH_FRONTEND_AREA;
    }

    /**
     * {@inheritdoc}
     *
     * @return int
     */
    public function getPasswordResetProtectionType()
    {
        return (int) $this->scopeConfig->getValue(
            $this->getXmlPathPrefix() . self::XML_PATH_PASSWORD_RESET_PROTECTION_TYPE,
            StoreScopeInterface::SCOPE_STORE
        );
    }

    /**
     * {@inheritDoc}
     *
     * @param int $scope
     * @return int
     */
    public function getMaxNumberPasswordResetRequests()
    {
        return (int) $this->scopeConfig->getValue(
            $this->getXmlPathPrefix() . self::XML_PATH_MAX_NUMBER_PASSWORD_RESET_REQUESTS,
            StoreScopeInterface::SCOPE_STORE
        );
    }

    /**
     * {@inheritDoc}
     *
     * @param int $scope
     * @return int
     */
    public function getMinTimeBetweenPasswordResetRequests()
    {
        $timeInMin = $this->scopeConfig->getValue(
            $this->getXmlPathPrefix() . self::XML_PATH_MIN_TIME_BETWEEN_PASSWORD_RESET_REQUESTS,
            StoreScopeInterface::SCOPE_STORE
        );
        return $timeInMin * 60;
    }
}