![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-backend/Model/Config/SessionLifetime/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Backend\Model\Config\SessionLifetime; use Magento\Framework\App\Config\Value; use Magento\Framework\Exception\LocalizedException; /** * Backend model for the admin/security/session_lifetime configuration field. Validates session lifetime. * @api * @since 100.1.0 */ class BackendModel extends Value { /** Maximum admin session lifetime; 1 year*/ const MAX_LIFETIME = 31536000; /** Minimum admin session lifetime */ const MIN_LIFETIME = 60; /** * Processing object before save data * * @since 100.1.0 * @throws LocalizedException */ public function beforeSave() { $value = (int)$this->getValue(); if ($value > self::MAX_LIFETIME) { throw new LocalizedException( __( 'The Admin session lifetime is invalid. ' . 'Set the lifetime to 31536000 seconds (one year) or shorter and try again.' ) ); } elseif ($value < self::MIN_LIFETIME) { throw new LocalizedException( __('The Admin session lifetime is invalid. Set the lifetime to 60 seconds or longer and try again.') ); } return parent::beforeSave(); } }