From 189e8b952e21db3a8bb2aae00c6d4a4d40f9bf8c Mon Sep 17 00:00:00 2001 From: Rafa Chaves Date: Wed, 16 Oct 2024 21:43:01 -0300 Subject: [PATCH 01/40] =?UTF-8?q?corrige=20erro=20na=20p=C3=A1gina=20Conta?= =?UTF-8?q?=20e=20privacidade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Provider.php | 38 ---------- .../panel/multiple-local-auth--my-account.php | 75 ------------------- 2 files changed, 113 deletions(-) delete mode 100644 views/panel/multiple-local-auth--my-account.php diff --git a/Provider.php b/Provider.php index 2878e78..a252964 100644 --- a/Provider.php +++ b/Provider.php @@ -424,44 +424,6 @@ protected function _init() { echo "
  • $label
  • "; }); - - $app->hook('ALL(panel.my-account)', function () use($app,$config){ - - $email = filter_var($app->request->post('email'),FILTER_SANITIZE_EMAIL); - if ($email) { - $app->auth->processMyAccount(); - } - - $has_seal_govbr = false; - if($config['strategies']['govbr']['visible']){ - - $agent = $app->user->profile; - $relations = $agent->getSealRelations(); - $sealId = $config['strategies']['govbr']['applySealId']; - - foreach($relations as $relation){ - if($relation->seal->id == $sealId){ - $has_seal_govbr = true; - break; - } - } - } - - $active = $this->template == 'panel/my-account' ? 'class="active"' : ''; - $user = $app->user; - $email = $user->email ? $user->email : ''; - $this->render('multiple-local-auth--my-account',[ - 'email' => $email, - 'form_action' => $app->createUrl('panel', 'my-account'), - 'feedback_success' => $app->auth->feedback_success, - 'feedback_msg' => $app->auth->feedback_msg, - 'config' => $config, - 'has_seal_govbr' => $has_seal_govbr, - 'menssagem_authenticated' => $config['strategies']['govbr']['menssagem_authenticated'] - - ]); - - }); $app->applyHook('auth.provider.init'); } diff --git a/views/panel/multiple-local-auth--my-account.php b/views/panel/multiple-local-auth--my-account.php deleted file mode 100644 index 68b1526..0000000 --- a/views/panel/multiple-local-auth--my-account.php +++ /dev/null @@ -1,75 +0,0 @@ -layout = 'panel'; -$app->view->enqueueStyle('app', 'multipleLocal-govbr', 'css/govbr.css'); - -?> - -
    - - - -
    - -
    - - - -
    -
    - -

    - -
    - -
    - -
    -

    -
    - -
    - -
    - -
    -
    - -
    - -
    -
    - -
    -
    -
    - - -
    - "> -
    - - - - -
    -
    -
    -
    -
    From c192a2359073a8fcd23b0c703ebcb692595e94b1 Mon Sep 17 00:00:00 2001 From: Welington De Lima Olegario Date: Thu, 26 Dec 2024 15:31:49 -0300 Subject: [PATCH 02/40] =?UTF-8?q?faz=20valida=C3=A7=C3=A3o=20de=20obrigato?= =?UTF-8?q?riedade=20de=20cpf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Provider.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Provider.php b/Provider.php index a252964..957575e 100644 --- a/Provider.php +++ b/Provider.php @@ -39,6 +39,8 @@ function __construct ($config) { 'loginOnRegister' => env('AUTH_LOGIN_ON_REGISTER', false), 'enableLoginByCPF' => env('AUTH_LOGIN_BY_CPF', true), + 'requeridCpf' => env('AUTH_REQUIRED_CPF', true), + 'passwordMustHaveCapitalLetters' => env('AUTH_PASS_CAPITAL_LETTERS', true), 'passwordMustHaveLowercaseLetters' => env('AUTH_PASS_LOWERCASE_LETTERS', true), 'passwordMustHaveSpecialCharacters' => env('AUTH_PASS_SPECIAL_CHARS', true), @@ -549,8 +551,10 @@ function validateRegisterFields() { // validate cpf if(empty($cpf) || !$this->validateCPF($cpf)) { - array_push($errors['user']['cpf'], i::__('Por favor, informe um cpf válido.', 'multipleLocal')); - $hasErrors = true; + if($this->config['requeridCpf']){ + array_push($errors['user']['cpf'], i::__('Por favor, informe um cpf válido.', 'multipleLocal')); + $hasErrors = true; + } } $foundAgent = []; From e93e821d2766c7f17ba6da2910d603ed93ed7080 Mon Sep 17 00:00:00 2001 From: Rafa Chaves Date: Thu, 26 Dec 2024 22:10:37 -0300 Subject: [PATCH 03/40] =?UTF-8?q?corrige=20valida=C3=A7=C3=A3o=20de=20cpf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Provider.php | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/Provider.php b/Provider.php index 957575e..40ba15c 100644 --- a/Provider.php +++ b/Provider.php @@ -39,7 +39,7 @@ function __construct ($config) { 'loginOnRegister' => env('AUTH_LOGIN_ON_REGISTER', false), 'enableLoginByCPF' => env('AUTH_LOGIN_BY_CPF', true), - 'requeridCpf' => env('AUTH_REQUIRED_CPF', true), + 'requireCpf' => env('AUTH_REQUIRED_CPF', true), 'passwordMustHaveCapitalLetters' => env('AUTH_PASS_CAPITAL_LETTERS', true), 'passwordMustHaveLowercaseLetters' => env('AUTH_PASS_LOWERCASE_LETTERS', true), @@ -550,31 +550,32 @@ function validateRegisterFields() { if($config['enableLoginByCPF']) { // validate cpf - if(empty($cpf) || !$this->validateCPF($cpf)) { - if($this->config['requeridCpf']){ - array_push($errors['user']['cpf'], i::__('Por favor, informe um cpf válido.', 'multipleLocal')); - $hasErrors = true; - } + if($config['requireCpf'] && !$this->validateCPF($cpf)) { + array_push($errors['user']['cpf'], i::__('Por favor, informe um cpf válido.', 'multipleLocal')); + $hasErrors = true; } - $foundAgent = []; - $metadataFieldCpf = $this->getMetadataFieldCpfFromConfig(); - $_cpf = implode("','", [$cpf, preg_replace('/[^0-9]/i', '', $cpf)]); - $foundAgent = $conn->fetchAll("SELECT * FROM agent_meta WHERE key IN ('{$metadataFieldCpf}', 'cpf') AND value IN ('{$_cpf}')"); - - // creates an array with agents with status == 1, because the user can have, for example, 3 agents, but 2 have status == 0 - $existAgent = []; - if($foundAgent){ - foreach ($foundAgent as $agentMeta) { - if($agentMeta->owner->status >= 0) { - $existAgent[] = $agentMeta; + if($this->validateCPF($cpf)) { + $foundAgent = []; + $metadataFieldCpf = $this->getMetadataFieldCpfFromConfig(); + + $_cpf = implode("','", [$cpf, preg_replace('/[^0-9]/i', '', $cpf)]); + $foundAgent = $conn->fetchAll("SELECT * FROM agent_meta WHERE key IN ('{$metadataFieldCpf}', 'cpf') AND value IN ('{$_cpf}')"); + + // creates an array with agents with status == 1, because the user can have, for example, 3 agents, but 2 have status == 0 + $existAgent = []; + if($foundAgent){ + foreach ($foundAgent as $agentMeta) { + if($agentMeta->owner->status >= 0) { + $existAgent[] = $agentMeta; + } } } - } - if(count($existAgent) > 0) { - array_push($errors['user']['cpf'], i::__('Este CPF já esta em uso. Tente recuperar a sua senha.', 'multipleLocal')); - $hasErrors = true; + if(count($existAgent) > 0) { + array_push($errors['user']['cpf'], i::__('Este CPF já esta em uso. Tente recuperar a sua senha.', 'multipleLocal')); + $hasErrors = true; + } } } From 92e2ce5e8801178f5c948244ade23367f757491d Mon Sep 17 00:00:00 2001 From: erleibiazzio Date: Fri, 3 Jan 2025 09:20:12 -0300 Subject: [PATCH 04/40] =?UTF-8?q?Faz=20com=20que=20os=20cadastros=20criado?= =?UTF-8?q?s=20apartir=20da=20nova=20vers=C3=A3o=20do=20Mapas=20seja=20sem?= =?UTF-8?q?pre=20criado=20como=20Publicado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Provider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Provider.php b/Provider.php index 40ba15c..e668e95 100644 --- a/Provider.php +++ b/Provider.php @@ -65,7 +65,7 @@ function __construct ($config) { 'urlImageToUseInEmails' => env('AUTH_EMAIL_IMAGE'), 'urlTermsOfUse' => env('LINK_TERMOS', $app->createUrl('auth', 'termos-e-condicoes')), - 'statusCreateAgent' => env('STATUS_CREATE_AGENT', Agent::STATUS_DRAFT), + 'statusCreateAgent' => env('STATUS_CREATE_AGENT', Agent::STATUS_ENABLED), 'strategies' => [ 'Facebook' => [ 'visible' => env('AUTH_FACEBOOK_CLIENT_ID', false), From 38a3cc4819bf4550cea7ab15c0fb64f91df410e4 Mon Sep 17 00:00:00 2001 From: Raul Vitor Lucena Brito Date: Fri, 14 Mar 2025 16:51:39 -0300 Subject: [PATCH 05/40] =?UTF-8?q?Cria=20componente=20para=20integra=C3=A7?= =?UTF-8?q?=C3=A3o=20do=20gov-br=20/=20apenas=20front?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sass/4-components/_c-login-govbr.scss | 20 ++++++++++ assets-src/sass/plugin-MultiplLocalAuth.scss | 1 + components/login-govbr/script.js | 28 ++++++++++++++ components/login-govbr/template.php | 38 +++++++++++++++++++ components/login/template.php | 3 ++ 5 files changed, 90 insertions(+) create mode 100644 assets-src/sass/4-components/_c-login-govbr.scss create mode 100644 components/login-govbr/script.js create mode 100644 components/login-govbr/template.php diff --git a/assets-src/sass/4-components/_c-login-govbr.scss b/assets-src/sass/4-components/_c-login-govbr.scss new file mode 100644 index 0000000..71d4d43 --- /dev/null +++ b/assets-src/sass/4-components/_c-login-govbr.scss @@ -0,0 +1,20 @@ +.login-govbr { + + + &__content { + display: grid; + gap: 20px; + max-width: 520px; + } + + .govbr { + background-color: #1351b4; + color: #FFFFFF; + margin-top: 23px; + + > img { + width: 50px; + height: 100%; + } + } +} \ No newline at end of file diff --git a/assets-src/sass/plugin-MultiplLocalAuth.scss b/assets-src/sass/plugin-MultiplLocalAuth.scss index cfa0541..54c7ac5 100755 --- a/assets-src/sass/plugin-MultiplLocalAuth.scss +++ b/assets-src/sass/plugin-MultiplLocalAuth.scss @@ -16,6 +16,7 @@ /* ----- 4: COMPONENTS ------- */ @import '4-components/c-change-password'; @import '4-components/c-create-account'; +@import '4-components/c-login-govbr'; @import '4-components/c-login'; diff --git a/components/login-govbr/script.js b/components/login-govbr/script.js new file mode 100644 index 0000000..1440d97 --- /dev/null +++ b/components/login-govbr/script.js @@ -0,0 +1,28 @@ +app.component('login-govbr', { + template: $TEMPLATES['login-govbr'], + + setup() { + }, + + data() { + }, + + props: { + config: { + type: String, + required: true + } + }, + + mounted() { + }, + + computed: { + configs() { + return JSON.parse(this.config); + }, + }, + + methods: { + }, +}); diff --git a/components/login-govbr/template.php b/components/login-govbr/template.php new file mode 100644 index 0000000..1455239 --- /dev/null +++ b/components/login-govbr/template.php @@ -0,0 +1,38 @@ + + + + + \ No newline at end of file diff --git a/components/login/template.php b/components/login/template.php index 1ddbe24..3df1343 100644 --- a/components/login/template.php +++ b/components/login/template.php @@ -9,6 +9,7 @@ $this->import(' mc-card + login-govbr password-strongness '); ?> @@ -43,6 +44,8 @@ \ No newline at end of file diff --git a/components/login/template.php b/components/login/template.php index 3df1343..f619f73 100644 --- a/components/login/template.php +++ b/components/login/template.php @@ -44,8 +44,6 @@