简体   繁体   中英

Disable Captcha on admin login page from database or codebase or CLI in magento?

I just pulled down a copy of a customers live site to correct some plugin issues and set up a demo site on our local dev server, but I cannot get into the administration panel of the site due to a broken captcha (the captcha image does not display, so entering it correctly is pretty much impossible).

I do however have access to the codebase and the database, so if I can toggle this off somewhere, remove something from config.xml or comment out a line to temporarily shut it off until I can get in and disable it correctly, that would be perfect, because I only really have about ten minutes of work to do in the backend.

This issue is due to a missing resource, probably due to some DNS setting somewhere that doesn't match up with the URL on our dev server, though I don't know exactly where. The customer is running Magento EE v.1.13.0.2 if that is relevant. Thanks in advance.

o

Search on core_config_data table in your database .Search admin/captcha/enable on run the below code

Update 
  core_config_data  set value=0
WHERE  path LIKE  '%admin/captcha/enable%'
insert into core_config_data (scope,value,scope_id,path) values ('default',0,0, 'admin/captcha/enable');

移除缓存

We were having similar issues, after duplicating & moving an existing site to a new domain.

The other answers here helped but did not entirely solve the issue. When attempting to login it would silently error and not login.

To fix this we did the following:

Search in the core_config_data table in your database for the web/cookie/cookie_domain entry, and ensure the value here is correct for the new domain.

Solution:

For Magento 2.x & higher versions


If you have access to Database:

Run the following query

SELECT * FROM `core_config_data` where path LIKE "%captcha%"

Set both the rows to 0

验证码配置行

If you have access to code base

Remove the backend_login form entry in the following config file

Magento\vendor\magento\module-captcha\etc\config.xml

捕获配置 XML 文件

Don't forget to Flush the cache : php bin/magento cache:flush

NOTE: Once login in to admin revert the code changes.

I just figured this out actually, I navigated to /app/code/core/Mage/Captcha/etc/config.xml and removed the following node (required sudo vi because it was read only): <admin_user_authenticate_before> <observers> <captcha> <class>captcha/observer</class> <method>checkUserLoginBackend</method> </captcha> </observers> </admin_user_authenticate_before>

I still like Amit's answer better because it does not require manually editing any files in the core, but this also works and I wanted to put this up as an option in case someone had the same issue in the future and did not have access to the database. Probably a good idea to restore the config to it's original state when you are done, unless you need to get back to the backend in the ongoing sense. I do like doing it through the database better though when possible.

After logging in, I restored the file to it's original state and disabled the captcha properly through the backend.

On M2.4 disable admin google recaptcha

select * from core_config_data WHERE  path LIKE  '%recaptcha_backend%';

update core_config_data set value=NULL WHERE path LIKE  'recaptcha_backend/type_for/user_login';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM