Skip to content

Commit 35d26ee

Browse files
rafaelchavesfreitaslpirola
authored andcommitted
corrige erro na página Conta e privacidade
1 parent b3f6478 commit 35d26ee

2 files changed

Lines changed: 3 additions & 116 deletions

File tree

Provider.php

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -424,44 +424,6 @@ protected function _init() {
424424
echo "<li><a href='$url' $active><span class='icon icon-my-account'></span> $label</a></li>";
425425

426426
});
427-
428-
$app->hook('ALL(panel.my-account)', function () use($app,$config){
429-
430-
$email = filter_var($app->request->post('email'),FILTER_SANITIZE_EMAIL);
431-
if ($email) {
432-
$app->auth->processMyAccount();
433-
}
434-
435-
$has_seal_govbr = false;
436-
if($config['strategies']['govbr']['visible']){
437-
438-
$agent = $app->user->profile;
439-
$relations = $agent->getSealRelations();
440-
$sealId = $config['strategies']['govbr']['applySealId'];
441-
442-
foreach($relations as $relation){
443-
if($relation->seal->id == $sealId){
444-
$has_seal_govbr = true;
445-
break;
446-
}
447-
}
448-
}
449-
450-
$active = $this->template == 'panel/my-account' ? 'class="active"' : '';
451-
$user = $app->user;
452-
$email = $user->email ? $user->email : '';
453-
$this->render('multiple-local-auth--my-account',[
454-
'email' => $email,
455-
'form_action' => $app->createUrl('panel', 'my-account'),
456-
'feedback_success' => $app->auth->feedback_success,
457-
'feedback_msg' => $app->auth->feedback_msg,
458-
'config' => $config,
459-
'has_seal_govbr' => $has_seal_govbr,
460-
'menssagem_authenticated' => $config['strategies']['govbr']['menssagem_authenticated']
461-
462-
]);
463-
464-
});
465427

466428
$app->applyHook('auth.provider.init');
467429
}
@@ -1334,7 +1296,7 @@ protected function _validateResponse(){
13341296
// verifica se a resposta é um erro
13351297
if (array_key_exists('error', $response)) {
13361298

1337-
$app->flash('auth error', 'Opauth returns error auth response');
1299+
$app->halt(500, 'Opauth returns error auth response');
13381300
} else {
13391301
/**
13401302
* Auth response validation
@@ -1343,9 +1305,9 @@ protected function _validateResponse(){
13431305
* is sent through GET or POST.
13441306
*/
13451307
if (empty($response['auth']) || empty($response['timestamp']) || empty($response['signature']) || empty($response['auth']['provider']) || empty($response['auth']['uid'])) {
1346-
$app->flash('auth error', 'Invalid auth response: Missing key auth response components.');
1308+
$app->halt(500, 'Invalid auth response: Missing key auth response components.');
13471309
} elseif (!$this->opauth->validate(sha1(print_r($response['auth'], true)), $response['timestamp'], $response['signature'], $reason)) {
1348-
$app->flash('auth error', "Invalid auth response: {$reason}");
1310+
$app->halt(500, "Invalid auth response: {$reason}");
13491311
} else {
13501312
$valid = true;
13511313
}

views/panel/multiple-local-auth--my-account.php

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)