crt0 / lockpanel
Magento2 module to block administrative panel via API
Installs: 2
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:module
Requires
- php: >=8.1
This package is auto-updated.
Last update: 2025-06-21 16:51:44 UTC
README
Descrição
O módulo CRT0\LockPanel foi criado para bloquear o painel administrativo do Magento por meio de endpoints da API REST. Ele permite:
- Bloquear/desbloquear o acesso ao painel.
- Verificar o status de bloqueio.
- Configurar usuários que não serão afetados pelo bloqueio.
Instalação do Módulo
-
Copie os arquivos do módulo para o diretório do Magento:
app/code/CRT0/LockPanel
-
Ative o módulo:
bin/magento module:enable CRT0_LockPanel
-
Atualize o sistema:
bin/magento setup:upgrade && bin/magento setup:di:compile
bin/magento c:c
-
Pronto! O módulo está instalado.
Configuração
- No painel do Magento, vá para
Stores > Configuration > CRT0 LockPanel
. - Configure:
- Ativar o Módulo: Habilite o bloqueio administrativo.
- Senha da API: Defina a senha para acessar os endpoints.
- Usuários Isentos: Selecione usuários que poderão acessar o painel mesmo com o bloqueio.
Endpoints Disponíveis
1. Bloquear o Painel
- Endpoint:
POST /rest/V1/lockpanel/lock
- Parâmetros (form data):
password
(obrigatório): Senha configurada no painel.
Exemplo usando cURL:
bash
CopyEdit
curl -X POST "https://sualoja.com/rest/V1/lockpanel/lock" \ -H "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "password=minhasenhaapi"
2. Desbloquear o Painel
- Endpoint:
POST /rest/V1/lockpanel/unlock
- Parâmetros (form data):
password
(obrigatório): Senha configurada no painel.
Exemplo usando cURL:
bash
CopyEdit
curl -X POST "https://sualoja.com/rest/V1/lockpanel/unlock" \ -H "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "password=minhasenhaapi"
3. Consultar Status
- Endpoint:
GET /rest/V1/lockpanel/status
Exemplo usando cURL:
bash
CopyEdit
curl -X GET "https://sualoja.com/rest/V1/lockpanel/status" \ -H "Content-Type: application/json"
Resposta Possível:
-
Painel bloqueado:
json
CopyEdit
{ "status": "locked" }
-
Painel desbloqueado:
json
CopyEdit
{ "status": "unlocked" }
Description
The CRT0\LockPanel module was created to lock the Magento admin panel via REST API endpoints. It allows:
- Lock/unlock access to the panel.
- Check lock status.
- Configure users who will not be affected by blocking.
Module Installation
-
Copy the module files to the Magento directory:
app/code/CRT0/LockPanel
-
Activate the module:
bin/magento module:enable CRT0_LockPanel
-
Update the system:
bin/magento setup:upgrade && bin/magento setup:di:compile
bin/magento c:c
-
Ready! The module is installed.
Settings
- In the Magento dashboard, go to
Stores > Configuration > CRT0 LockPanel
. - Configure:
- Activate the Module: Enable administrative blocking.
- API Password: Set the password to access the endpoints.
- Exempt Users: Select users who will be able to access the panel even if blocked.
Testes
- Use ferramentas como Postman ou cURL para testar os endpoints.
- Certifique-se de que os parâmetros da senha sejam enviados no formato form data para os métodos
POST
.