diff --git a/.phpstan.dist.baseline.neon b/.phpstan.dist.baseline.neon
index d2ece40d7a0..ec3a8f42f29 100644
--- a/.phpstan.dist.baseline.neon
+++ b/.phpstan.dist.baseline.neon
@@ -1242,18 +1242,6 @@ parameters:
count: 1
path: app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php
- -
- rawMessage: 'Property Mage_Captcha_Model_Zend::$_helper (Mage_Captcha_Helper_Data) in empty() is not falsy.'
- identifier: empty.property
- count: 1
- path: app/code/core/Mage/Captcha/Model/Zend.php
-
- -
- rawMessage: 'Return type (Mage_Customer_Model_Session) of method Mage_Captcha_Model_Zend::getSession() should be compatible with return type (Zend_Session_Namespace) of method Zend_Captcha_Word::getSession()'
- identifier: method.childReturnType
- count: 1
- path: app/code/core/Mage/Captcha/Model/Zend.php
-
-
rawMessage: 'Argument of an invalid type string supplied for foreach, only iterables are supported.'
identifier: foreach.nonIterable
diff --git a/.phpstorm.meta.php/magento_blocks.meta.php b/.phpstorm.meta.php/magento_blocks.meta.php
index ad54beffab8..a9c2b395d85 100644
--- a/.phpstorm.meta.php/magento_blocks.meta.php
+++ b/.phpstorm.meta.php/magento_blocks.meta.php
@@ -811,8 +811,6 @@
'bundle/catalog_product_view_type_bundle_option_select' => \Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select::class,
'bundle/checkout_cart_item_renderer' => \Mage_Bundle_Block_Checkout_Cart_Item_Renderer::class,
'bundle/sales_order_items_renderer' => \Mage_Bundle_Block_Sales_Order_Items_Renderer::class,
- 'captcha/captcha' => \Mage_Captcha_Block_Captcha::class,
- 'captcha/captcha_zend' => \Mage_Captcha_Block_Captcha_Zend::class,
'cataloginventory/adminhtml_form_field_customergroup' => \Mage_CatalogInventory_Block_Adminhtml_Form_Field_Customergroup::class,
'cataloginventory/adminhtml_form_field_minsaleqty' => \Mage_CatalogInventory_Block_Adminhtml_Form_Field_Minsaleqty::class,
'cataloginventory/qtyincrements' => \Mage_CatalogInventory_Block_Qtyincrements::class,
diff --git a/.phpstorm.meta.php/magento_blocks_methods.meta.php b/.phpstorm.meta.php/magento_blocks_methods.meta.php
index cb494c45022..3e2e6b7eccc 100644
--- a/.phpstorm.meta.php/magento_blocks_methods.meta.php
+++ b/.phpstorm.meta.php/magento_blocks_methods.meta.php
@@ -811,8 +811,6 @@
'bundle/catalog_product_view_type_bundle_option_select' => \Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select::class,
'bundle/checkout_cart_item_renderer' => \Mage_Bundle_Block_Checkout_Cart_Item_Renderer::class,
'bundle/sales_order_items_renderer' => \Mage_Bundle_Block_Sales_Order_Items_Renderer::class,
- 'captcha/captcha' => \Mage_Captcha_Block_Captcha::class,
- 'captcha/captcha_zend' => \Mage_Captcha_Block_Captcha_Zend::class,
'cataloginventory/adminhtml_form_field_customergroup' => \Mage_CatalogInventory_Block_Adminhtml_Form_Field_Customergroup::class,
'cataloginventory/adminhtml_form_field_minsaleqty' => \Mage_CatalogInventory_Block_Adminhtml_Form_Field_Minsaleqty::class,
'cataloginventory/qtyincrements' => \Mage_CatalogInventory_Block_Qtyincrements::class,
diff --git a/.phpstorm.meta.php/magento_helpers.meta.php b/.phpstorm.meta.php/magento_helpers.meta.php
index 0d96f0a1b53..08c25963350 100644
--- a/.phpstorm.meta.php/magento_helpers.meta.php
+++ b/.phpstorm.meta.php/magento_helpers.meta.php
@@ -38,8 +38,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
diff --git a/.phpstorm.meta.php/magento_helpers_methods.meta.php b/.phpstorm.meta.php/magento_helpers_methods.meta.php
index 8d90634fd9a..249bbd70336 100644
--- a/.phpstorm.meta.php/magento_helpers_methods.meta.php
+++ b/.phpstorm.meta.php/magento_helpers_methods.meta.php
@@ -38,8 +38,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -235,8 +233,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -432,8 +428,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -629,8 +623,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -826,8 +818,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -1023,8 +1013,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -1220,8 +1208,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -1417,8 +1403,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -1614,8 +1598,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -1811,8 +1793,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -2008,8 +1988,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -2205,8 +2183,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -2402,8 +2378,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -2599,8 +2573,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -2796,8 +2768,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
@@ -2993,8 +2963,6 @@
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
- 'captcha' => \Mage_Captcha_Helper_Data::class,
- 'captcha/data' => \Mage_Captcha_Helper_Data::class,
'cataloginventory' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/data' => \Mage_CatalogInventory_Helper_Data::class,
'cataloginventory/minsaleqty' => \Mage_CatalogInventory_Helper_Minsaleqty::class,
diff --git a/.phpstorm.meta.php/magento_models.meta.php b/.phpstorm.meta.php/magento_models.meta.php
index fc67e3352bc..fb251713b4c 100644
--- a/.phpstorm.meta.php/magento_models.meta.php
+++ b/.phpstorm.meta.php/magento_models.meta.php
@@ -419,15 +419,6 @@
'bundle/selection' => \Mage_Bundle_Model_Selection::class,
'bundle/source_option_selection_price_type' => \Mage_Bundle_Model_Source_Option_Selection_Price_Type::class,
'bundle/source_option_type' => \Mage_Bundle_Model_Source_Option_Type::class,
- 'captcha/config_font' => \Mage_Captcha_Model_Config_Font::class,
- 'captcha/config_form_abstract' => \Mage_Captcha_Model_Config_Form_Abstract::class,
- 'captcha/config_form_backend' => \Mage_Captcha_Model_Config_Form_Backend::class,
- 'captcha/config_form_frontend' => \Mage_Captcha_Model_Config_Form_Frontend::class,
- 'captcha/config_mode' => \Mage_Captcha_Model_Config_Mode::class,
- 'captcha/observer' => \Mage_Captcha_Model_Observer::class,
- 'captcha/resource_log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha_resource/log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha/zend' => \Mage_Captcha_Model_Zend::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Attribute::class,
'catalogindex/catalog_index_flag' => \Mage_CatalogIndex_Model_Catalog_Index_Flag::class,
@@ -3586,15 +3577,6 @@
'bundle/selection' => \Mage_Bundle_Model_Selection::class,
'bundle/source_option_selection_price_type' => \Mage_Bundle_Model_Source_Option_Selection_Price_Type::class,
'bundle/source_option_type' => \Mage_Bundle_Model_Source_Option_Type::class,
- 'captcha/config_font' => \Mage_Captcha_Model_Config_Font::class,
- 'captcha/config_form_abstract' => \Mage_Captcha_Model_Config_Form_Abstract::class,
- 'captcha/config_form_backend' => \Mage_Captcha_Model_Config_Form_Backend::class,
- 'captcha/config_form_frontend' => \Mage_Captcha_Model_Config_Form_Frontend::class,
- 'captcha/config_mode' => \Mage_Captcha_Model_Config_Mode::class,
- 'captcha/observer' => \Mage_Captcha_Model_Observer::class,
- 'captcha/resource_log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha_resource/log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha/zend' => \Mage_Captcha_Model_Zend::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Attribute::class,
'catalogindex/catalog_index_flag' => \Mage_CatalogIndex_Model_Catalog_Index_Flag::class,
diff --git a/.phpstorm.meta.php/magento_models_methods.meta.php b/.phpstorm.meta.php/magento_models_methods.meta.php
index 6e7e022a582..5c1da591aa1 100644
--- a/.phpstorm.meta.php/magento_models_methods.meta.php
+++ b/.phpstorm.meta.php/magento_models_methods.meta.php
@@ -419,15 +419,6 @@
'bundle/selection' => \Mage_Bundle_Model_Selection::class,
'bundle/source_option_selection_price_type' => \Mage_Bundle_Model_Source_Option_Selection_Price_Type::class,
'bundle/source_option_type' => \Mage_Bundle_Model_Source_Option_Type::class,
- 'captcha/config_font' => \Mage_Captcha_Model_Config_Font::class,
- 'captcha/config_form_abstract' => \Mage_Captcha_Model_Config_Form_Abstract::class,
- 'captcha/config_form_backend' => \Mage_Captcha_Model_Config_Form_Backend::class,
- 'captcha/config_form_frontend' => \Mage_Captcha_Model_Config_Form_Frontend::class,
- 'captcha/config_mode' => \Mage_Captcha_Model_Config_Mode::class,
- 'captcha/observer' => \Mage_Captcha_Model_Observer::class,
- 'captcha/resource_log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha_resource/log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha/zend' => \Mage_Captcha_Model_Zend::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Attribute::class,
'catalogindex/catalog_index_flag' => \Mage_CatalogIndex_Model_Catalog_Index_Flag::class,
@@ -3586,15 +3577,6 @@
'bundle/selection' => \Mage_Bundle_Model_Selection::class,
'bundle/source_option_selection_price_type' => \Mage_Bundle_Model_Source_Option_Selection_Price_Type::class,
'bundle/source_option_type' => \Mage_Bundle_Model_Source_Option_Type::class,
- 'captcha/config_font' => \Mage_Captcha_Model_Config_Font::class,
- 'captcha/config_form_abstract' => \Mage_Captcha_Model_Config_Form_Abstract::class,
- 'captcha/config_form_backend' => \Mage_Captcha_Model_Config_Form_Backend::class,
- 'captcha/config_form_frontend' => \Mage_Captcha_Model_Config_Form_Frontend::class,
- 'captcha/config_mode' => \Mage_Captcha_Model_Config_Mode::class,
- 'captcha/observer' => \Mage_Captcha_Model_Observer::class,
- 'captcha/resource_log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha_resource/log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha/zend' => \Mage_Captcha_Model_Zend::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Attribute::class,
'catalogindex/catalog_index_flag' => \Mage_CatalogIndex_Model_Catalog_Index_Flag::class,
@@ -6753,15 +6735,6 @@
'bundle/selection' => \Mage_Bundle_Model_Selection::class,
'bundle/source_option_selection_price_type' => \Mage_Bundle_Model_Source_Option_Selection_Price_Type::class,
'bundle/source_option_type' => \Mage_Bundle_Model_Source_Option_Type::class,
- 'captcha/config_font' => \Mage_Captcha_Model_Config_Font::class,
- 'captcha/config_form_abstract' => \Mage_Captcha_Model_Config_Form_Abstract::class,
- 'captcha/config_form_backend' => \Mage_Captcha_Model_Config_Form_Backend::class,
- 'captcha/config_form_frontend' => \Mage_Captcha_Model_Config_Form_Frontend::class,
- 'captcha/config_mode' => \Mage_Captcha_Model_Config_Mode::class,
- 'captcha/observer' => \Mage_Captcha_Model_Observer::class,
- 'captcha/resource_log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha_resource/log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha/zend' => \Mage_Captcha_Model_Zend::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Attribute::class,
'catalogindex/catalog_index_flag' => \Mage_CatalogIndex_Model_Catalog_Index_Flag::class,
@@ -9920,15 +9893,6 @@
'bundle/selection' => \Mage_Bundle_Model_Selection::class,
'bundle/source_option_selection_price_type' => \Mage_Bundle_Model_Source_Option_Selection_Price_Type::class,
'bundle/source_option_type' => \Mage_Bundle_Model_Source_Option_Type::class,
- 'captcha/config_font' => \Mage_Captcha_Model_Config_Font::class,
- 'captcha/config_form_abstract' => \Mage_Captcha_Model_Config_Form_Abstract::class,
- 'captcha/config_form_backend' => \Mage_Captcha_Model_Config_Form_Backend::class,
- 'captcha/config_form_frontend' => \Mage_Captcha_Model_Config_Form_Frontend::class,
- 'captcha/config_mode' => \Mage_Captcha_Model_Config_Mode::class,
- 'captcha/observer' => \Mage_Captcha_Model_Observer::class,
- 'captcha/resource_log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha_resource/log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha/zend' => \Mage_Captcha_Model_Zend::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Attribute::class,
'catalogindex/catalog_index_flag' => \Mage_CatalogIndex_Model_Catalog_Index_Flag::class,
@@ -13087,15 +13051,6 @@
'bundle/selection' => \Mage_Bundle_Model_Selection::class,
'bundle/source_option_selection_price_type' => \Mage_Bundle_Model_Source_Option_Selection_Price_Type::class,
'bundle/source_option_type' => \Mage_Bundle_Model_Source_Option_Type::class,
- 'captcha/config_font' => \Mage_Captcha_Model_Config_Font::class,
- 'captcha/config_form_abstract' => \Mage_Captcha_Model_Config_Form_Abstract::class,
- 'captcha/config_form_backend' => \Mage_Captcha_Model_Config_Form_Backend::class,
- 'captcha/config_form_frontend' => \Mage_Captcha_Model_Config_Form_Frontend::class,
- 'captcha/config_mode' => \Mage_Captcha_Model_Config_Mode::class,
- 'captcha/observer' => \Mage_Captcha_Model_Observer::class,
- 'captcha/resource_log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha_resource/log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha/zend' => \Mage_Captcha_Model_Zend::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Attribute::class,
'catalogindex/catalog_index_flag' => \Mage_CatalogIndex_Model_Catalog_Index_Flag::class,
@@ -16254,15 +16209,6 @@
'bundle/selection' => \Mage_Bundle_Model_Selection::class,
'bundle/source_option_selection_price_type' => \Mage_Bundle_Model_Source_Option_Selection_Price_Type::class,
'bundle/source_option_type' => \Mage_Bundle_Model_Source_Option_Type::class,
- 'captcha/config_font' => \Mage_Captcha_Model_Config_Font::class,
- 'captcha/config_form_abstract' => \Mage_Captcha_Model_Config_Form_Abstract::class,
- 'captcha/config_form_backend' => \Mage_Captcha_Model_Config_Form_Backend::class,
- 'captcha/config_form_frontend' => \Mage_Captcha_Model_Config_Form_Frontend::class,
- 'captcha/config_mode' => \Mage_Captcha_Model_Config_Mode::class,
- 'captcha/observer' => \Mage_Captcha_Model_Observer::class,
- 'captcha/resource_log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha_resource/log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha/zend' => \Mage_Captcha_Model_Zend::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Attribute::class,
'catalogindex/catalog_index_flag' => \Mage_CatalogIndex_Model_Catalog_Index_Flag::class,
@@ -19421,15 +19367,6 @@
'bundle/selection' => \Mage_Bundle_Model_Selection::class,
'bundle/source_option_selection_price_type' => \Mage_Bundle_Model_Source_Option_Selection_Price_Type::class,
'bundle/source_option_type' => \Mage_Bundle_Model_Source_Option_Type::class,
- 'captcha/config_font' => \Mage_Captcha_Model_Config_Font::class,
- 'captcha/config_form_abstract' => \Mage_Captcha_Model_Config_Form_Abstract::class,
- 'captcha/config_form_backend' => \Mage_Captcha_Model_Config_Form_Backend::class,
- 'captcha/config_form_frontend' => \Mage_Captcha_Model_Config_Form_Frontend::class,
- 'captcha/config_mode' => \Mage_Captcha_Model_Config_Mode::class,
- 'captcha/observer' => \Mage_Captcha_Model_Observer::class,
- 'captcha/resource_log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha_resource/log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha/zend' => \Mage_Captcha_Model_Zend::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Attribute::class,
'catalogindex/catalog_index_flag' => \Mage_CatalogIndex_Model_Catalog_Index_Flag::class,
@@ -22588,15 +22525,6 @@
'bundle/selection' => \Mage_Bundle_Model_Selection::class,
'bundle/source_option_selection_price_type' => \Mage_Bundle_Model_Source_Option_Selection_Price_Type::class,
'bundle/source_option_type' => \Mage_Bundle_Model_Source_Option_Type::class,
- 'captcha/config_font' => \Mage_Captcha_Model_Config_Font::class,
- 'captcha/config_form_abstract' => \Mage_Captcha_Model_Config_Form_Abstract::class,
- 'captcha/config_form_backend' => \Mage_Captcha_Model_Config_Form_Backend::class,
- 'captcha/config_form_frontend' => \Mage_Captcha_Model_Config_Form_Frontend::class,
- 'captcha/config_mode' => \Mage_Captcha_Model_Config_Mode::class,
- 'captcha/observer' => \Mage_Captcha_Model_Observer::class,
- 'captcha/resource_log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha_resource/log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha/zend' => \Mage_Captcha_Model_Zend::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Attribute::class,
'catalogindex/catalog_index_flag' => \Mage_CatalogIndex_Model_Catalog_Index_Flag::class,
@@ -25755,15 +25683,6 @@
'bundle/selection' => \Mage_Bundle_Model_Selection::class,
'bundle/source_option_selection_price_type' => \Mage_Bundle_Model_Source_Option_Selection_Price_Type::class,
'bundle/source_option_type' => \Mage_Bundle_Model_Source_Option_Type::class,
- 'captcha/config_font' => \Mage_Captcha_Model_Config_Font::class,
- 'captcha/config_form_abstract' => \Mage_Captcha_Model_Config_Form_Abstract::class,
- 'captcha/config_form_backend' => \Mage_Captcha_Model_Config_Form_Backend::class,
- 'captcha/config_form_frontend' => \Mage_Captcha_Model_Config_Form_Frontend::class,
- 'captcha/config_mode' => \Mage_Captcha_Model_Config_Mode::class,
- 'captcha/observer' => \Mage_Captcha_Model_Observer::class,
- 'captcha/resource_log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha_resource/log' => \Mage_Captcha_Model_Resource_Log::class,
- 'captcha/zend' => \Mage_Captcha_Model_Zend::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Attribute::class,
'catalogindex/catalog_index_flag' => \Mage_CatalogIndex_Model_Catalog_Index_Flag::class,
diff --git a/.phpstorm.meta.php/magento_resource_models.meta.php b/.phpstorm.meta.php/magento_resource_models.meta.php
index 2e8ab002dbb..90704aa9f9c 100644
--- a/.phpstorm.meta.php/magento_resource_models.meta.php
+++ b/.phpstorm.meta.php/magento_resource_models.meta.php
@@ -54,7 +54,6 @@
'bundle/price_index' => \Mage_Bundle_Model_Resource_Price_Index::class,
'bundle/selection' => \Mage_Bundle_Model_Resource_Selection::class,
'bundle/selection_collection' => \Mage_Bundle_Model_Resource_Selection_Collection::class,
- 'captcha/log' => \Mage_Captcha_Model_Resource_Log::class,
'catalogindex/abstract' => \Mage_CatalogIndex_Model_Resource_Abstract::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Resource_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Resource_Attribute::class,
@@ -687,7 +686,6 @@
'bundle/price_index' => \Mage_Bundle_Model_Resource_Price_Index::class,
'bundle/selection' => \Mage_Bundle_Model_Resource_Selection::class,
'bundle/selection_collection' => \Mage_Bundle_Model_Resource_Selection_Collection::class,
- 'captcha/log' => \Mage_Captcha_Model_Resource_Log::class,
'catalogindex/abstract' => \Mage_CatalogIndex_Model_Resource_Abstract::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Resource_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Resource_Attribute::class,
diff --git a/.phpstorm.meta.php/magento_resource_models_methods.meta.php b/.phpstorm.meta.php/magento_resource_models_methods.meta.php
index fd8ccde3495..494eca8414a 100644
--- a/.phpstorm.meta.php/magento_resource_models_methods.meta.php
+++ b/.phpstorm.meta.php/magento_resource_models_methods.meta.php
@@ -54,7 +54,6 @@
'bundle/price_index' => \Mage_Bundle_Model_Resource_Price_Index::class,
'bundle/selection' => \Mage_Bundle_Model_Resource_Selection::class,
'bundle/selection_collection' => \Mage_Bundle_Model_Resource_Selection_Collection::class,
- 'captcha/log' => \Mage_Captcha_Model_Resource_Log::class,
'catalogindex/abstract' => \Mage_CatalogIndex_Model_Resource_Abstract::class,
'catalogindex/aggregation' => \Mage_CatalogIndex_Model_Resource_Aggregation::class,
'catalogindex/attribute' => \Mage_CatalogIndex_Model_Resource_Attribute::class,
diff --git a/app/code/core/Mage/Admin/Model/Observer.php b/app/code/core/Mage/Admin/Model/Observer.php
index ce3ae3892b3..a51f756bd85 100644
--- a/app/code/core/Mage/Admin/Model/Observer.php
+++ b/app/code/core/Mage/Admin/Model/Observer.php
@@ -35,7 +35,6 @@ public function actionPreDispatchAdmin($observer)
'resetpassword',
'resetpasswordpost',
'logout',
- 'refresh', // captcha refresh
];
if (in_array($requestedActionName, $openActions)) {
$request->setDispatched(true);
diff --git a/app/code/core/Mage/Captcha/Block/Captcha.php b/app/code/core/Mage/Captcha/Block/Captcha.php
deleted file mode 100644
index 3a72bd32208..00000000000
--- a/app/code/core/Mage/Captcha/Block/Captcha.php
+++ /dev/null
@@ -1,34 +0,0 @@
-isEnabled()) {
- $blockPath = Mage::helper('captcha')->getCaptcha($this->getFormId())->getBlockName();
- $block = $this->getLayout()->createBlock($blockPath);
- $block->setData($this->getData());
- return $block->toHtml();
- }
- return '';
- }
-}
diff --git a/app/code/core/Mage/Captcha/Block/Captcha/Zend.php b/app/code/core/Mage/Captcha/Block/Captcha/Zend.php
deleted file mode 100644
index 51b3ee1ef41..00000000000
--- a/app/code/core/Mage/Captcha/Block/Captcha/Zend.php
+++ /dev/null
@@ -1,73 +0,0 @@
-getIsAjax() ? '' : $this->_template;
- }
-
- /**
- * Returns URL to controller action which returns new captcha image
- *
- * @return string
- */
- public function getRefreshUrl()
- {
- return Mage::getUrl(
- Mage::app()->getStore()->isAdmin() ? 'adminhtml/refresh/refresh' : 'captcha/refresh',
- ['_secure' => Mage::app()->getStore()->isCurrentlySecure()],
- );
- }
-
- /**
- * Renders captcha HTML (if required)
- *
- * @return string
- */
- protected function _toHtml()
- {
- if (Mage::helper('captcha')->isEnabled() && $this->getCaptchaModel()->isRequired()) {
- $this->getCaptchaModel()->generate();
- return parent::_toHtml();
- }
- return '';
- }
-
- /**
- * Returns captcha model
- *
- * @return Mage_Captcha_Model_Zend
- */
- public function getCaptchaModel()
- {
- return Mage::helper('captcha')->getCaptcha($this->getFormId());
- }
-}
diff --git a/app/code/core/Mage/Captcha/Helper/Data.php b/app/code/core/Mage/Captcha/Helper/Data.php
deleted file mode 100644
index aa684aa5680..00000000000
--- a/app/code/core/Mage/Captcha/Helper/Data.php
+++ /dev/null
@@ -1,130 +0,0 @@
-getStore()->isAdmin() ? 'admin/captcha/enable' : 'customer/captcha/enable';
- return Mage::getStoreConfigFlag($path);
- }
-
- /**
- * Get Captcha
- *
- * @param string $formId
- * @return Mage_Captcha_Model_Zend
- */
- public function getCaptcha($formId)
- {
- if (!array_key_exists($formId, $this->_captcha)) {
- $type = $this->getConfigNode('type');
- $this->_captcha[$formId] = Mage::getModel('captcha/' . $type, ['formId' => $formId]);
- }
- return $this->_captcha[$formId];
- }
-
- /**
- * Returns value of the node with respect to current area (frontend or backend)
- *
- * @param string $id The last part of XML_PATH_$area_CAPTCHA_ constant (case-insensitive)
- * @param Mage_Core_Model_Store $store
- * @return Mage_Core_Model_Config_Element
- */
- public function getConfigNode($id, $store = null)
- {
- $areaCode = Mage::app()->getStore($store)->isAdmin() ? 'admin' : 'customer';
- return Mage::getStoreConfig($areaCode . '/captcha/' . $id, $store);
- }
-
- /**
- * Get list of available fonts
- * Return format:
- * [['arial'] => ['label' => 'Arial', 'path' => '/www/magento/fonts/arial.ttf']]
- *
- * @return array
- */
- public function getFonts()
- {
- $node = Mage::getConfig()->getNode(self::XML_PATH_CAPTCHA_FONTS);
- $fonts = [];
- if ($node) {
- foreach ($node->children() as $fontName => $fontNode) {
- $fonts[$fontName] = [
- 'label' => (string) $fontNode->label,
- 'path' => Mage::getBaseDir('base') . DS . $fontNode->path,
- ];
- }
- }
- return $fonts;
- }
-
- /**
- * Get captcha image directory
- *
- * @param mixed $website
- * @return string
- */
- public function getImgDir($website = null)
- {
- $websiteCode = Mage::app()->getWebsite($website)->getCode();
- $captchaDir = Mage::getBaseDir('media') . DS . 'captcha' . DS . $websiteCode . DS;
- $io = new Varien_Io_File();
- $io->checkAndCreateFolder($captchaDir, 0755);
- return $captchaDir;
- }
-
- /**
- * Get captcha image base URL
- *
- * @param mixed $website
- * @return string
- */
- public function getImgUrl($website = null)
- {
- $websiteCode = Mage::app()->getWebsite($website)->getCode();
- return Mage::getBaseUrl('media') . 'captcha' . '/' . $websiteCode . '/';
- }
-}
diff --git a/app/code/core/Mage/Captcha/Model/Config/Font.php b/app/code/core/Mage/Captcha/Model/Config/Font.php
deleted file mode 100644
index 9a81faacce7..00000000000
--- a/app/code/core/Mage/Captcha/Model/Config/Font.php
+++ /dev/null
@@ -1,30 +0,0 @@
-getFonts() as $fontName => $fontData) {
- $optionArray[] = ['label' => $fontData['label'], 'value' => $fontName];
- }
- return $optionArray;
- }
-}
diff --git a/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php b/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php
deleted file mode 100644
index 78e5595aae3..00000000000
--- a/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php
+++ /dev/null
@@ -1,42 +0,0 @@
-getNode($this->_configPath);
- if ($backendNode) {
- foreach ($backendNode->children() as $formNode) {
- /** @var Mage_Core_Model_Config_Element $formNode */
- if (!empty($formNode->label)) {
- $optionArray[] = ['label' => (string) $formNode->label, 'value' => $formNode->getName()];
- }
- }
- }
- return $optionArray;
- }
-}
diff --git a/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php b/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php
deleted file mode 100644
index cb1e08d805d..00000000000
--- a/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php
+++ /dev/null
@@ -1,21 +0,0 @@
- Mage::helper('captcha')->__('Always'),
- 'value' => Mage_Captcha_Helper_Data::MODE_ALWAYS,
- ],
- [
- 'label' => Mage::helper('captcha')->__('After number of attempts to login'),
- 'value' => Mage_Captcha_Helper_Data::MODE_AFTER_FAIL,
- ],
- ];
- }
-}
diff --git a/app/code/core/Mage/Captcha/Model/Interface.php b/app/code/core/Mage/Captcha/Model/Interface.php
deleted file mode 100644
index db64f1a08ad..00000000000
--- a/app/code/core/Mage/Captcha/Model/Interface.php
+++ /dev/null
@@ -1,39 +0,0 @@
-getCaptcha($formId);
- if ($captchaModel->isRequired()) {
- $controller = $observer->getControllerAction();
- if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) {
- Mage::getSingleton('customer/session')->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.'));
- $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
- $controller->getResponse()->setRedirect(Mage::getUrl('*/*/forgotpassword'));
- }
- }
- return $this;
- }
-
- /**
- * Check Captcha On User Login Page
- *
- * @param Varien_Event_Observer $observer
- * @return $this
- */
- public function checkUserLogin($observer)
- {
- $formId = 'user_login';
- $captchaModel = Mage::helper('captcha')->getCaptcha($formId);
- $controller = $observer->getControllerAction();
- $loginParams = $controller->getRequest()->getPost('login');
- $login = $loginParams['username'] ?? null;
- if ($captchaModel->isRequired($login)) {
- $word = $this->_getCaptchaString($controller->getRequest(), $formId);
- if (!$captchaModel->isCorrect($word)) {
- Mage::getSingleton('customer/session')->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.'));
- $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
- Mage::getSingleton('customer/session')->setUsername($login);
- $beforeUrl = Mage::getSingleton('customer/session')->getBeforeAuthUrl();
- $url = $beforeUrl ? $beforeUrl : Mage::helper('customer')->getLoginUrl();
- $controller->getResponse()->setRedirect($url);
- }
- }
- $captchaModel->logAttempt($login);
- return $this;
- }
-
- /**
- * Check Captcha On Register User Page
- *
- * @return $this
- */
- public function checkUserCreate(Varien_Event_Observer $observer)
- {
- $formId = 'user_create';
- $captchaModel = Mage::helper('captcha')->getCaptcha($formId);
- if ($captchaModel->isRequired()) {
- $controller = $observer->getControllerAction();
- if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) {
- Mage::getSingleton('customer/session')->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.'));
- $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
- Mage::getSingleton('customer/session')->setCustomerFormData($controller->getRequest()->getPost());
- $controller->getResponse()->setRedirect(Mage::getUrl('*/*/create'));
- }
- }
- return $this;
- }
-
- /**
- * Check Captcha On Checkout as Guest Page
- *
- * @return $this
- */
- public function checkGuestCheckout(Varien_Event_Observer $observer)
- {
- $formId = 'guest_checkout';
- $captchaModel = Mage::helper('captcha')->getCaptcha($formId);
- $checkoutMethod = Mage::getSingleton('checkout/type_onepage')->getQuote()->getCheckoutMethod();
- if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_GUEST) {
- if ($captchaModel->isRequired()) {
- $controller = $observer->getControllerAction();
- if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) {
- $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
- $result = ['error' => 1, 'message' => Mage::helper('captcha')->__('Incorrect CAPTCHA.')];
- $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
- }
- }
- }
- return $this;
- }
-
- /**
- * Check Captcha On Checkout Register Page
- *
- * @param Varien_Event_Observer $observer
- * @return $this
- */
- public function checkRegisterCheckout($observer)
- {
- $formId = 'register_during_checkout';
- $captchaModel = Mage::helper('captcha')->getCaptcha($formId);
- $checkoutMethod = Mage::getSingleton('checkout/type_onepage')->getQuote()->getCheckoutMethod();
- if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER) {
- if ($captchaModel->isRequired()) {
- $controller = $observer->getControllerAction();
- if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) {
- $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
- $result = ['error' => 1, 'message' => Mage::helper('captcha')->__('Incorrect CAPTCHA.')];
- $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
- }
- }
- }
- return $this;
- }
-
- /**
- * Check Captcha On User Login Backend Page
- *
- * @param Varien_Event_Observer $observer
- * @return $this
- */
- public function checkUserLoginBackend($observer)
- {
- $formId = 'backend_login';
- $captchaModel = Mage::helper('captcha')->getCaptcha($formId);
- $loginParams = Mage::app()->getRequest()->getPost('login', []);
- $login = $loginParams['username'] ?? null;
- if ($captchaModel->isRequired($login)) {
- if (!$captchaModel->isCorrect($this->_getCaptchaString(Mage::app()->getRequest(), $formId))) {
- $captchaModel->logAttempt($login);
- Mage::throwException(Mage::helper('captcha')->__('Incorrect CAPTCHA.'));
- }
- }
- $captchaModel->logAttempt($login);
- return $this;
- }
-
- /**
- * Returns backend session
- *
- * @return Mage_Adminhtml_Model_Session
- */
- protected function _getBackendSession()
- {
- return Mage::getSingleton('adminhtml/session');
- }
-
- /**
- * Check Captcha On User Login Backend Page
- *
- * @param Varien_Event_Observer $observer
- * @return $this
- */
- public function checkUserForgotPasswordBackend($observer)
- {
- $formId = 'backend_forgotpassword';
- $captchaModel = Mage::helper('captcha')->getCaptcha($formId);
- $controller = $observer->getControllerAction();
- $email = (string) $observer->getControllerAction()->getRequest()->getParam('email');
- $params = $observer->getControllerAction()->getRequest()->getParams();
-
- if (!empty($email) && !empty($params)) {
- if ($captchaModel->isRequired()) {
- if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) {
- $this->_getBackendSession()->setEmail((string) $controller->getRequest()->getPost('email'));
- $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
- $this->_getBackendSession()->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.'));
- $controller->getResponse()->setRedirect(Mage::getUrl('*/*/forgotpassword'));
- }
- }
- }
- return $this;
- }
-
- /**
- * Reset Attempts For Frontend
- *
- * @param Varien_Event_Observer $observer
- * @return $this
- */
- public function resetAttemptForFrontend($observer)
- {
- return $this->_resetAttempt($observer->getModel()->getEmail());
- }
-
- /**
- * Reset Attempts For Backend
- *
- * @param Varien_Event_Observer $observer
- * @return $this
- */
- public function resetAttemptForBackend($observer)
- {
- return $this->_resetAttempt($observer->getUser()->getUsername());
- }
-
- /**
- * Delete Unnecessary logged attempts
- *
- * @return $this
- */
- public function deleteOldAttempts()
- {
- Mage::getResourceModel('captcha/log')->deleteOldAttempts();
- return $this;
- }
-
- /**
- * Delete Expired Captcha Images
- *
- * @return $this
- */
- public function deleteExpiredImages()
- {
- foreach (Mage::app()->getWebsites(true) as $website) {
- $expire = time() - Mage::helper('captcha')->getConfigNode('timeout', $website->getDefaultStore()) * 60;
- $imageDirectory = Mage::helper('captcha')->getImgDir($website);
- foreach (new DirectoryIterator($imageDirectory) as $file) {
- if ($file->isFile() && pathinfo($file->getFilename(), PATHINFO_EXTENSION) == 'png') {
- if ($file->getMTime() < $expire) {
- unlink($file->getPathname());
- }
- }
- }
- }
- return $this;
- }
-
- /**
- * Reset Attempts
- *
- * @param string $login
- * @return $this
- */
- protected function _resetAttempt($login)
- {
- Mage::getResourceModel('captcha/log')->deleteUserAttempts($login);
- return $this;
- }
-
- /**
- * Get Captcha String
- *
- * @param Mage_Core_Controller_Request_Http $request
- * @param string $formId
- * @return string
- */
- protected function _getCaptchaString($request, $formId)
- {
- $captchaParams = $request->getPost(Mage_Captcha_Helper_Data::INPUT_NAME_FIELD_VALUE);
- return $captchaParams[$formId] ?? '';
- }
-
- /**
- * Check Captcha On Share Wishlist Page
- *
- * @param Varien_Event_Observer $observer
- * @return $this
- */
- public function checkWishlistSharing($observer)
- {
- $formId = 'wishlist_sharing';
- $captchaModel = Mage::helper('captcha')->getCaptcha($formId);
- if ($captchaModel->isRequired()) {
- $controller = $observer->getControllerAction();
- $request = $controller->getRequest();
- if (!$captchaModel->isCorrect($this->_getCaptchaString($request, $formId))) {
- Mage::getSingleton('wishlist/session')->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.'));
- $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
- Mage::getSingleton('wishlist/session')->setSharingForm($request->getPost());
- $wishlistId = (int) $request->getParam('wishlist_id');
- $controller->getResponse()
- ->setRedirect(Mage::getUrl('wishlist/index/share/wishlist_id/' . $wishlistId));
- }
- }
- return $this;
- }
-
- /**
- * Check Captcha On Email Product To A Friend Page
- *
- * @param Varien_Event_Observer $observer
- * @return $this
- */
- public function checkSendfriendSend($observer)
- {
- $formId = 'sendfriend_send';
- $captchaModel = Mage::helper('captcha')->getCaptcha($formId);
- if ($captchaModel->isRequired()) {
- $controller = $observer->getControllerAction();
- $request = $controller->getRequest();
- if (!$captchaModel->isCorrect($this->_getCaptchaString($request, $formId))) {
- Mage::getSingleton('catalog/session')->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.'));
- $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
- Mage::getSingleton('catalog/session')->setFormData($request->getPost());
- $id = (int) $request->getParam('id');
- $catId = $request->getParam('cat_id');
- if ($catId !== null) {
- $id .= '/cat_id/' . (int) $catId;
- }
- $controller->getResponse()->setRedirect(Mage::getUrl('*/*/send/id/' . $id));
- }
- }
- return $this;
- }
-}
diff --git a/app/code/core/Mage/Captcha/Model/Resource/Log.php b/app/code/core/Mage/Captcha/Model/Resource/Log.php
deleted file mode 100644
index 07644b84e56..00000000000
--- a/app/code/core/Mage/Captcha/Model/Resource/Log.php
+++ /dev/null
@@ -1,133 +0,0 @@
-_setMainTable('captcha/log');
- }
-
- /**
- * Save or Update count Attempts
- *
- * @param string|null $login
- * @return $this
- */
- public function logAttempt($login)
- {
- if ($login != null) {
- $this->_getWriteAdapter()->insertOnDuplicate(
- $this->getMainTable(),
- [
- 'type' => self::TYPE_LOGIN, 'value' => $login, 'count' => 1,
- 'updated_at' => Mage::getSingleton('core/date')->gmtDate(),
- ],
- ['count' => new Zend_Db_Expr('count+1'), 'updated_at'],
- );
- }
- $ip = Mage::helper('core/http')->getRemoteAddr();
- if ($ip != null) {
- $this->_getWriteAdapter()->insertOnDuplicate(
- $this->getMainTable(),
- [
- 'type' => self::TYPE_REMOTE_ADDRESS, 'value' => $ip, 'count' => 1,
- 'updated_at' => Mage::getSingleton('core/date')->gmtDate(),
- ],
- ['count' => new Zend_Db_Expr('count+1'), 'updated_at'],
- );
- }
- return $this;
- }
-
- /**
- * Delete User attempts by login
- *
- * @param string $login
- * @return $this
- */
- public function deleteUserAttempts($login)
- {
- if ($login != null) {
- $this->_getWriteAdapter()->delete(
- $this->getMainTable(),
- ['type = ?' => self::TYPE_LOGIN, 'value = ?' => $login],
- );
- }
- $ip = Mage::helper('core/http')->getRemoteAddr();
- if ($ip != null) {
- $this->_getWriteAdapter()->delete(
- $this->getMainTable(),
- ['type = ?' => self::TYPE_REMOTE_ADDRESS, 'value = ?' => $ip],
- );
- }
-
- return $this;
- }
-
- /**
- * Get count attempts by ip
- *
- * @return string|int
- */
- public function countAttemptsByRemoteAddress()
- {
- $ip = Mage::helper('core/http')->getRemoteAddr();
- if (!$ip) {
- return 0;
- }
- $read = $this->_getReadAdapter();
- $select = $read->select()->from($this->getMainTable(), 'count')->where('type = ?', self::TYPE_REMOTE_ADDRESS)
- ->where('value = ?', $ip);
- return $read->fetchOne($select);
- }
-
- /**
- * Get count attempts by user login
- *
- * @param string $login
- * @return string|int
- */
- public function countAttemptsByUserLogin($login)
- {
- if (!$login) {
- return 0;
- }
- $read = $this->_getReadAdapter();
- $select = $read->select()->from($this->getMainTable(), 'count')->where('type = ?', self::TYPE_LOGIN)
- ->where('value = ?', $login);
- return $read->fetchOne($select);
- }
-
- /**
- * Delete attempts with expired in update_at time
- */
- public function deleteOldAttempts()
- {
- $this->_getWriteAdapter()->delete(
- $this->getMainTable(),
- ['updated_at < ?' => Mage::getSingleton('core/date')->gmtDate(null, time() - 60 * 30)],
- );
- }
-}
diff --git a/app/code/core/Mage/Captcha/Model/Zend.php b/app/code/core/Mage/Captcha/Model/Zend.php
deleted file mode 100644
index f7f666d4c3f..00000000000
--- a/app/code/core/Mage/Captcha/Model/Zend.php
+++ /dev/null
@@ -1,504 +0,0 @@
-_formId = $params['formId'];
- $this->setExpiration($this->getTimeout());
- }
-
- /**
- * Returns key with respect of current form ID
- *
- * @param string $key
- * @return string
- */
- protected function _getFormIdKey($key)
- {
- return $this->_formId . '_' . $key;
- }
-
- /**
- * Get Block Name
- *
- * @return string
- */
- public function getBlockName()
- {
- return 'captcha/captcha_zend';
- }
-
- /**
- * Whether captcha is required to be inserted to this form
- *
- * @param null|string $login
- * @return bool
- */
- public function isRequired($login = null)
- {
- $nonAuthForms = ['wishlist_sharing', 'sendfriend_send'];
-
- if ((!in_array($this->_formId, $nonAuthForms) && $this->_isUserAuth())
- || !$this->_isEnabled() || !in_array($this->_formId, $this->_getTargetForms())
- ) {
- return false;
- }
-
- return ($this->_isShowAlways() || $this->_isOverLimitAttempts($login)
- || $this->getSession()->getData($this->_getFormIdKey('show_captcha'))
- );
- }
-
- /**
- * Check is overlimit attempts
- *
- * @param string $login
- * @return bool
- */
- protected function _isOverLimitAttempts($login)
- {
- return ($this->_isOverLimitIpAttempt() || $this->_isOverLimitLoginAttempts($login));
- }
-
- /**
- * Returns number of allowed attempts for same login
- *
- * @return int
- */
- protected function _getAllowedAttemptsForSameLogin()
- {
- return (int) $this->_getHelper()->getConfigNode('failed_attempts_login');
- }
-
- /**
- * Returns number of allowed attempts from same IP
- *
- * @return int
- */
- protected function _getAllowedAttemptsFromSameIp()
- {
- return (int) $this->_getHelper()->getConfigNode('failed_attempts_ip');
- }
-
- /**
- * Check is overlimit saved attempts from one ip
- *
- * @return bool
- */
- protected function _isOverLimitIpAttempt()
- {
- $countAttemptsByIp = Mage::getResourceModel('captcha/log')->countAttemptsByRemoteAddress();
- return $countAttemptsByIp >= $this->_getAllowedAttemptsFromSameIp();
- }
-
- /**
- * Is Over Limit Login Attempts
- *
- * @param string $login
- * @return bool
- */
- protected function _isOverLimitLoginAttempts($login)
- {
- if ($login != false) {
- $countAttemptsByLogin = Mage::getResourceModel('captcha/log')->countAttemptsByUserLogin($login);
- return ($countAttemptsByLogin >= $this->_getAllowedAttemptsForSameLogin());
- }
- return false;
- }
-
- /**
- * Check is user auth
- *
- * @return bool
- */
- protected function _isUserAuth()
- {
- return Mage::app()->getStore()->isAdmin()
- ? Mage::getSingleton('admin/session')->isLoggedIn()
- : Mage::getSingleton('customer/session')->isLoggedIn();
- }
-
- /**
- * Whether to respect case while checking the answer
- *
- * @return string
- */
- public function isCaseSensitive()
- {
- return (string) $this->_getHelper()->getConfigNode('case_sensitive');
- }
-
- /**
- * Get font to use when generating captcha
- *
- * @return string
- */
- public function getFont()
- {
- return $this->_getFontPath();
- }
-
- /**
- * After this time isCorrect() is going to return FALSE even if word was guessed correctly
- *
- * @return int
- */
- public function getTimeout()
- {
- if (!$this->_expiration) {
- /**
- * as "timeout" configuration parameter specifies timeout in minutes - we multiply it on 60 to set
- * expiration in seconds
- */
- $this->_expiration = (int) $this->_getHelper()->getConfigNode('timeout') * 60;
- }
- return $this->_expiration;
- }
-
- /**
- * Get captcha image directory
- *
- * @return string
- */
- public function getImgDir()
- {
- return $this->_helper->getImgDir();
- }
-
- /**
- * Get captcha image base URL
- *
- * @return string
- */
- public function getImgUrl()
- {
- return $this->_helper->getImgUrl();
- }
-
- /**
- * Checks whether captcha was guessed correctly by user
- *
- * @param string $word
- * @return bool
- */
- public function isCorrect($word)
- {
- $storedWord = $this->getWord();
- $this->_clearWord();
-
- if (!$word || !$storedWord) {
- return false;
- }
-
- if (!$this->isCaseSensitive()) {
- $storedWord = strtolower($storedWord);
- $word = strtolower($word);
- }
- return $word == $storedWord;
- }
-
- /**
- * Returns session instance
- *
- * @return Mage_Customer_Model_Session
- */
- public function getSession()
- {
- return Mage::getSingleton('customer/session');
- }
-
- /**
- * Return full URL to captcha image
- *
- * @return string
- */
- public function getImgSrc()
- {
- return $this->getImgUrl() . $this->getId() . $this->getSuffix();
- }
-
- /**
- * log Attempt
- *
- * @param string $login
- * @return $this
- */
- public function logAttempt($login)
- {
- if ($this->_isEnabled() && in_array($this->_formId, $this->_getTargetForms())) {
- Mage::getResourceModel('captcha/log')->logAttempt($login);
- if ($this->_isOverLimitLoginAttempts($login)) {
- $this->getSession()->setData($this->_getFormIdKey('show_captcha'), 1);
- }
- }
- return $this;
- }
-
- /**
- * Returns path for the font file, chosen to generate captcha
- *
- * @return string
- */
- protected function _getFontPath()
- {
- $font = (string) $this->_getHelper()->getConfigNode('font');
- $fonts = $this->_getHelper()->getFonts();
-
- if (isset($fonts[$font])) {
- $fontPath = $fonts[$font]['path'];
- } else {
- $fontData = array_shift($fonts);
- $fontPath = $fontData['path'];
- }
-
- return $fontPath;
- }
-
- /**
- * Returns captcha helper
- *
- * @return Mage_Captcha_Helper_Data
- */
- protected function _getHelper()
- {
- if (empty($this->_helper)) {
- $this->_helper = Mage::helper('captcha');
- }
- return $this->_helper;
- }
-
- /**
- * Generate word used for captcha render
- *
- * @return string
- */
- protected function _generateWord()
- {
- $word = '';
- $symbols = $this->_getSymbols();
- $wordLen = $this->_getWordLen();
- for ($i = 0; $i < $wordLen; $i++) {
- $word .= $symbols[array_rand($symbols)];
- }
- return $word;
- }
-
- /**
- * Get symbols array to use for word generation
- *
- * @return array
- */
- protected function _getSymbols()
- {
- return str_split((string) $this->_getHelper()->getConfigNode('symbols'));
- }
-
- /**
- * Returns length for generating captcha word. This value may be dynamic.
- *
- * @return int
- */
- protected function _getWordLen()
- {
- $from = 0;
- $to = 0;
- $length = (string) $this->_getHelper()->getConfigNode('length');
- if (!is_numeric($length)) {
- if (preg_match('/(\d+)-(\d+)/', $length, $matches)) {
- $from = (int) $matches[1];
- $to = (int) $matches[2];
- }
- } else {
- $from = (int) $length;
- $to = (int) $length;
- }
-
- if (($to < $from) || ($from < 1) || ($to < 1)) {
- $from = self::DEFAULT_WORD_LENGTH_FROM;
- $to = self::DEFAULT_WORD_LENGTH_TO;
- }
-
- return mt_rand($from, $to);
- }
-
- /**
- * Whether to show captcha for this form every time
- *
- * @return bool
- */
- protected function _isShowAlways()
- {
- // setting the allowed attempts to 0 is like setting mode to always
- if ($this->_getAllowedAttemptsForSameLogin() == 0 || $this->_getAllowedAttemptsFromSameIp() == 0) {
- return true;
- }
-
- if ((string) $this->_getHelper()->getConfigNode('mode') == Mage_Captcha_Helper_Data::MODE_ALWAYS) {
- return true;
- }
-
- $alwaysFor = $this->_getHelper()->getConfigNode('always_for');
- foreach ($alwaysFor as $nodeFormId => $isAlwaysFor) {
- if ($isAlwaysFor && $this->_formId == $nodeFormId) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Whether captcha is enabled at this area
- *
- * @return string
- */
- protected function _isEnabled()
- {
- return (string) $this->_getHelper()->getConfigNode('enable');
- }
-
- /**
- * Retrieve list of forms where captcha must be shown
- *
- * For frontend this list is based on current website
- *
- * @return array
- */
- protected function _getTargetForms()
- {
- $formsString = (string) $this->_getHelper()->getConfigNode('forms');
- return explode(',', $formsString);
- }
-
- /**
- * Get captcha word
- *
- * @return string|null
- */
- public function getWord()
- {
- $sessionData = $this->getSession()->getData($this->_getFormIdKey(self::SESSION_WORD));
- if (!is_array($sessionData)) {
- return null;
- }
- return time() < $sessionData['expires'] ? $sessionData['data'] : null;
- }
-
- /**
- * Set captcha word
- *
- * @param string $word
- * @return Zend_Captcha_Word
- */
- protected function _setWord($word)
- {
- $this->getSession()->setData(
- $this->_getFormIdKey(self::SESSION_WORD),
- ['data' => $word, 'expires' => time() + $this->getTimeout()],
- );
- $this->_word = $word;
- return $this;
- }
-
- /**
- * Set captcha word
- *
- * @return $this
- */
- protected function _clearWord()
- {
- $this->getSession()->unsetData($this->_getFormIdKey(self::SESSION_WORD));
- $this->_word = '';
- return $this;
- }
-
- /**
- * Override function to generate less curly captcha that will not cut off
- *
- * @see Zend_Captcha_Image::_randomSize()
- * @return int
- */
- protected function _randomSize()
- {
- return mt_rand(280, 300) / 100;
- }
-
- /**
- * Overlap of the parent method
- *
- * Now deleting old captcha images make crontab script
- * @see Mage_Captcha_Model_Observer::deleteExpiredImages
- */
- protected function _gc()
- {
- //do nothing
- }
-}
diff --git a/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php b/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php
deleted file mode 100644
index dbc538fd8a1..00000000000
--- a/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php
+++ /dev/null
@@ -1,39 +0,0 @@
-getRequest()->getPost('formId');
- $captchaModel = Mage::helper('captcha')->getCaptcha($formId);
- $this->getLayout()->createBlock($captchaModel->getBlockName())->setFormId($formId)->setIsAjax(true)->toHtml();
- $this->getResponse()->setBody(json_encode(['imgSrc' => $captchaModel->getImgSrc()]));
- $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true);
- }
-
- /**
- * Check is allowed access to action
- *
- * @return true
- */
- protected function _isAllowed()
- {
- return true;
- }
-}
diff --git a/app/code/core/Mage/Captcha/controllers/RefreshController.php b/app/code/core/Mage/Captcha/controllers/RefreshController.php
deleted file mode 100644
index 0778dd2118f..00000000000
--- a/app/code/core/Mage/Captcha/controllers/RefreshController.php
+++ /dev/null
@@ -1,29 +0,0 @@
-getRequest()->getPost('formId');
- $captchaModel = Mage::helper('captcha')->getCaptcha($formId);
- $this->getLayout()->createBlock($captchaModel->getBlockName())->setFormId($formId)->setIsAjax(true)->toHtml();
- $this->getResponse()->setBody(json_encode(['imgSrc' => $captchaModel->getImgSrc()]));
- $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true);
- }
-}
diff --git a/app/code/core/Mage/Captcha/etc/config.xml b/app/code/core/Mage/Captcha/etc/config.xml
deleted file mode 100644
index 2ab26afa918..00000000000
--- a/app/code/core/Mage/Captcha/etc/config.xml
+++ /dev/null
@@ -1,291 +0,0 @@
-
-
-captcha_log
-
__('Attention: Captcha is case sensitive.') ?>
-