помогите Добавление captcha на вход в админку
нужно добавить basic captcha на страницу входа в админку, чтобы не брутфорсили вход. Попытался подсмотреть как это работает на странице контакта, но так и не смог заставить работать.
ALarik
expert
Ждал этот вопрос, и теперь поднесу к нему вот такой вот мануал:
Чтобы ответить на вопрос: «Как установить recaptcha на вход в админку opencart ?» первым делом необходимо установить настройки самой каптчи в настройках тут:
настроив единожды, мы получаем рабочий базовый конфиг, с которым можем работать дальше.
Открываем файл: admin/controller/common/login.php и добавляем перед строкой:
$data['ipper'] = false;
вот такой вот код:
$this->document->addScript('https://www.google.com/recaptcha/api.js'); $data['site_key'] = $this->config->get('captcha_google_key');
и перед стандартной ошибкой логина, добавим вывод ошибки с ГР, находим строку:
if (isset($this->error['warning']))
и перед этой строкой, добавляем:
if (isset($this->error['captcha'])) < $data['error_captcha'] = $this->error['captcha']; > else
теперь чуть ниже, в методе validate этого же файла находим строку:
return !$this->error;
и ПЕРЕД ней, добавляем вот такой вот код:
if ($this->config->get('captcha_google_status')) < $this->load->language('extension/captcha/google_captcha'); $recaptcha = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($this->config->get('captcha_google_secret')) . '&response=' . $this->request->post['g-recaptcha-response'] . '&remoteip=' . $this->request->server['REMOTE_ADDR']); $recaptcha = json_decode($recaptcha, true); if ($recaptcha['success']) < $this->session->data['gcapcha'] = true; > else < $this->error['captcha'] = $this->language->get('error_captcha'); > >
Контроллер готов, сохраняем и добавляем языковую переменную (выбираем нужный язык: en-gb, ru-ru, uk-ua или свой) в файл:
admin/language/YOUR_LANG/common/login.php после строки коммента:
// Error
переменную с ошибкой для АНГЛ:
$_['error_captcha'] = 'Security error, please try again';
$_['error_captcha'] = 'Помилка безпеки, спробуйте ще раз';
$_['error_captcha'] = 'Ошибка безопасности, попробуйте ещё раз';
С языками все, надеюсь разобрались, если нет - коментируем, распишу детальней!
Далее, идём к файлу, который у нас в брокарте подменился от стандартного логина:
admin/view/template/extension/extension/wellcome.twig и в нём находим строку:
Basic captcha opencart что это
Есть 2 типа установки: "Установка расширений", если файл модуля является архивом с окончанием в названии ocmod.zip или "Через FTP (менеджер файлов)" когда это простой архив с файлами.
Установка Ocmod
- 1 Скачайте файл модуля. Платные дополнения можно скачать в личном кабинете только после оплаты.
- 2 В админ-панеле вашего сайта перейдите в "Расширения" -> "Установка расширений", или "Модули" -> "Установка модификаторов" и нажмите кнопку "Загрузить";
- 3 Выберите скачанный файл и нажмите "Продолжить", ожидайте появление надписи - "Успешно установлено";
- 4 Затем перейдите в "Менеджер дополнений", либо "Модификаторы" и нажмите кнопку "Обновить" (синяя, в правом верхнем углу). А также выдайте права администратора для модуля (ниже написано как это сделать).
Установка через FTP
- 1 Скачайте файл модуля. Платные дополнения можно скачать в личном кабинете только после оплаты;
- 2 Загрузите файлы через менеджер файлов в корень сайта. Как правило, в архиве есть файлы для разных версий PHP и версии OC (вам нужно правильно выбрать свой вариант);
- 3 Затем перейдите в "Менеджер дополнений", либо "Модификаторы" и нажмите кнопку "Обновить" (синяя, в правом верхнем углу). А также выдайте права администратора для модуля (ниже написано как это сделать).
После установки любого модуля, перейдите в раздел "Система" -> "Группы пользователей" -> "Administrator", снимите все галочки и поставьте их обратно, нажав на кнопку "Выделить все" на полях просмотра и изменения.
Переходите в нашу группу в Telegram!
Наше сообщество из опытных и рядовых пользователей поможет решить любые трудности 🙂
Случайные модули
Обновите страницу что бы увидеть другие модули

Товары в админке в порядке добавления Самая удобная сортировка для товаров в админ-панеле (по дате)..
Бесплатно

Вывод атрибутов на витрине Часто требуется вывести характеристики (атрибуты) на разных страницах, а не только в товаре..
How to enable Basic Captcha and Google ReCaptcha in OpenCart 3
In this tutorial, we will guide you on how to add an extra layer of security to your OpenCart Online Store. Captchas are designed to identify humans from bots and to protect websites from spam, phishing and hacker attacks. OpenCart 3 comes with two integrated captcha modules: Basic Captcha and Google reCaptcha . In the following lines, we will show you how to set up each of them. You are welcome to choose the most suitable option for the needs of your store.
Enabling Basic Captcha
The “ Basic Captcha ” will display an image containing a combination of letters and numbers and your visitors will be required to enter them correctly in order to be verified and proceed further. The installation and the setup of the “ Basic Captcha ” are extremely simple and can be done within a few steps.
If you wish to enable it, please log in to your OpenCart Admin Dashboard and navigate through the left menu bar to Extensions > Extensions and select “ Captchas ” from the “ Choose the extension type ” dropdown menu.

After the results are listed, please click on the green “ Install ” button right next to “ Basic Captcha ”.

The installation process will take just a few moments. Once it is completed, please click on the blue “ Edit ” button in order to enable the captcha.
When you access the page, please select the “ Enabled ” option from the “ Status ” dropdown menu and click on the blue “ Save ” button in order to record the change.

Once, you have the “ Basic Captcha ” successfully enabled, please navigate through the left menu bar to System > Settings , switch to the “ Option ” tab and scroll down to the last “ Captcha ” section.

When you are there, please make sure to select “ Basic Captcha ” from the “ Captcha ” dropdown menu. You will also need to select the website page where you would like the captcha form to be enabled from the “ Captcha Page ” list. We would recommend you keep it enabled on the “ Contact ” form as the attacks are pretty common on it. After you are ready, please do not forget to click on the blue “ Save ” button at the top right corner of the page.
Now that you are ready, you can do ahead and test in on the pages you have decided to enable it on.

If everything was done as expected, the captcha form will appear on your page(s) as shown on the screenshot example above.
Enabling Google reCaptcha
“ Google reCaptcha ” is one of the predominant captchas used and it is widely trusted. The process of installing and enabling “ Google reCaptcha ” is pretty much the same with the main difference that you will need to provide the required “ Site Key ” and “ Secret Key ” which can be obtained from your “ Google reCAPTCHA ” account.
Before we step into the installation, we will guide you on how to acquire the keys. You will need to log in to your existing “ Google reCAPTCHA ” account or create a new one by clicking here .
Once your account is successfully created you will have to register a new site.

Under the “ Label ” field, please enter a title that will help you easily recognize this site in the future.
From the options below, please select your desired verification type. If you are uncertain what is the exact difference between these types, please take a moment to review Google’s official documentation available here .
You will also need to enter the domain name of your OpenCart store into the empty field available under “ Domains ”. Please note that it includes all subdomains associated with your main domain name.

Please, make sure to tick the “ Accept the reCAPTCHA Terms of Services ” checkbox and then click on the “ SUBMIT ” button.
Afterward, you will be provided with the required “ Site Key ” and “ Secret Key ”. Please make sure to keep these keys safe as they are sensible data.

Now you are all set and you are ready to go back to your OpenCart Admin Dashboard . Once you are there, please navigate through the left menu bar to Extensions > Extensions . Afterward, select “ Captchas ” from the dropdown menu and click on the green “ Install ” button next to “ Google reCAPTCHA ”.

Please, allow a few moments for the process to be completed and then click on the blue “ Edit ” button.
Once you access the page, you will need to enter the “ Site Key ” and “ Secret Key ” and select “ Enabled ” from the “ Status ” dropdown menu.

Now that you have “ Google reCaptcha ” successfully enabled, please navigate through the left menu bar to System > Settings , switch to the “ Option ” tab and scroll down to the last “ Captcha ” section.

Please make sure to select “ Google reCAPTCHA ” from the dropdown menu and mark all the pages you would like to enable the captcha from onto from the “ Captcha Page ” list.
Once you are ready, please do not forget to click on the blue “ Save ” button located at the top right corner of the desired page.
Now that you are done, you can double-check the storefront in order to confirm the form is successfully enabled on the page(s).

If everything was properly configured the reCaptcha form will be displayed on the page(s) as shown on the screenshot example above.
That is it! We hope you have managed to successfully enable the desired captcha form on your Online Store following our instructions. In case you have experienced any sort of difficulties you are always welcome to contact our Support Team for further guidance.
Sebahat
Content Marketing Specialist
Sebahat is a young and bright woman who has become an invaluable part of our team. She started as a Customer Care Representative, mastering that role and, along the way, growing into a tech-savvy individual who is well acquainted with every support layer of the company. Driven by her aim to improve our customers’ experience constantly, she is committed to enhancing the extraordinary support we deliver.
More Opencart 3 tutorials in this Category
Learn more about Opencart 3 in the other tutorials that we have:
![]()
How to configure General and Store Settings in OpenCart 3
![]()
How to configure Local Settings in OpenCart 3
![]()
How to add a New Language in OpenCart 3
![]()
How to add a New Currency in OpenCart 3
![]()
How to configure Store Option Settings in OpenCart 3
![]()
How to enable Basic Captcha and Google ReCaptcha in OpenCart 3
![]()
How to change Store Logo and Favicon in OpenCart 3
![]()
How to configure Mail Settings with SMTP in OpenCart 3
![]()
How to setup SEO friendly URLs in OpenCart 3
![]()
How to enable SSL in OpenCart 3
![]()
How to edit Information Pages in OpenCart 3
Ready to get started?
Experience the Loading Speed, Security and Stability your visitors deserve or let us answer all your questions and help you choose the best plan for you!
HostArmada will enhance your visitors' experience with a uniquely optimized and stable Cloud SSD based Web Hosting service at an affordable price.
STAY TUNED
Receive news, offers, web hosting tips, tricks and other useful materials!
WEB HOSTING SERVICES
- Cloud WordPress Hosting
- Cloud WooCommerce Hosting
- Cloud Shared Hosting
- Cloud VPS Hosting
- Reseller Hosting
- Dedicated CPU Hosting
- Cloud Magento Hosting
- Cloud Node.js Hosting
- Domains
- Pricing
ABOUT HOSTARMADA
- About us, Mission, and Vision
- Contact us
- Blog
- Reviews & Testimonials
- Affiliate Program
- Legal & Terms of Service (ToS)
- Privacy Policy
- Website Loading Speed
- Website Security
- Data Centers & Locations
- Partners
LEARN & GET HELP
- Tutorials
- cPanel Tutorials
- WHM Tutorials
- WordPress Tutorials
- WooCommerce Tutorials
- Magento Tutorials
- Knowledge Base
- Technical Support
- Contact Sales
- Sign In
reCAPTCHA на страницах входа и сброса пароля в OpenCart 3
reCAPTCHA на страницах входа и сброса пароля в OpenCart 3 - данный модификатор расширяет возможности безопасности вашего интернет-магазина на странице входа для администратора, авторизации клиента и сброса пароля клиента, добавляя проверку reCAPTCHA V2.
- Google reCAPTCHA V2.
- Встраивание проверки Captcha на странице входа для администратора, авторизации клиента и сброса пароля клиента.
- Не перезаписывает основные файлы.
- Поддержка OCMOD.