Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
a4123ba
added new configuration options PROCERGS#830
guilhermednt Jan 8, 2019
79db348
creating new classes for the Blocklist PROCERGS#830
guilhermednt Jan 8, 2019
807f554
allowing users to change unverified phone numbers PROCERGS#830
guilhermednt Jan 9, 2019
906c46e
Merge remote-tracking branch 'upstream/master' into issue#830
guilhermednt Jan 14, 2019
7cce647
code style PROCERGS#830
guilhermednt Jan 16, 2019
1166ffe
added tests and fixed bugs found PROCERGS#830
guilhermednt Jan 16, 2019
17d10f5
fixed Person::getBadges() PROCERGS#835
guilhermednt Jan 17, 2019
603ed26
implemented auto phone blocking PROCERGS#830
guilhermednt Jan 21, 2019
c394279
Merge remote-tracking branch 'upstream/master' into issue#830
guilhermednt Jan 21, 2019
eac670b
refactored BlocklistSubscriber PROCERGS#830
guilhermednt Jan 22, 2019
15bb285
improved test coverage PROCERGS#830
guilhermednt Jan 22, 2019
751d91b
code cleanup PROCERGS#830
guilhermednt Jan 22, 2019
1d21fce
loggin blocked users out PROCERGS#830
guilhermednt Jan 23, 2019
c23d55a
improved RequestListener and its tests PROCERGS#830
guilhermednt Jan 23, 2019
f2ac3e4
updated tests PROCERGS#830
guilhermednt Jan 23, 2019
e8ec806
removed unused import PROCERGS#830
guilhermednt Jan 23, 2019
92b80fd
testing feature flash PROCERGS#830
guilhermednt Jan 23, 2019
de24f85
created role PROCERGS#830
guilhermednt Jan 28, 2019
f295e0b
created admin pages PROCERGS#830
guilhermednt Jan 28, 2019
66e8076
fixed entity and added audit PROCERGS#830
guilhermednt Jan 28, 2019
d7ccf83
refactored RequestListener PROCERGS#830
guilhermednt Jan 28, 2019
2b89b28
removed unused import PROCERGS#830
guilhermednt Jan 28, 2019
bd6d242
added date formating PROCERGS#830
guilhermednt Jan 28, 2019
92d36be
added details page PROCERGS#830
guilhermednt Jan 28, 2019
584694e
fixed privacy PROCERGS#830
guilhermednt Jan 28, 2019
5f59bba
added button to manually ban PROCERGS#830
guilhermednt Jan 30, 2019
b5349a7
persisting User before blocking PROCERGS#830
guilhermednt Jan 30, 2019
f99eb3f
promoted phone blocking to beta PROCERGS#830
guilhermednt Jan 30, 2019
6d79cb0
Merge pull request #317 from PROCERGS/issue#830
guilhermednt Jan 30, 2019
d1b2410
Merge remote-tracking branch 'upstream/master' into preview-1.22.0
guilhermednt Jan 30, 2019
feac425
promoted phone blocklist to production feature-set PROCERGS#830
guilhermednt Jan 30, 2019
7155bc6
created support interface PROCERGS#699
guilhermednt Feb 5, 2019
575dce2
added partial phone search to smart query PROCERGS#699
guilhermednt Feb 6, 2019
d519537
added Twig masking filter PROCERGS#699
guilhermednt Feb 6, 2019
6826992
added Person grid for search PROCERGS#699
guilhermednt Feb 6, 2019
11c53ad
fixed dates and added CPF formating PROCERGS#699
guilhermednt Feb 6, 2019
fbd8dd2
added unit tests PROCERGS#699
guilhermednt Feb 6, 2019
0bf7c94
logging profile views PROCERGS#699
guilhermednt Feb 6, 2019
500e2db
created support ticket UUID, updated tests and added menu item PROCER…
guilhermednt Feb 6, 2019
1d29041
Merge pull request #319 from PROCERGS/issue#699
guilhermednt Feb 6, 2019
3f8d5c3
Merge remote-tracking branch 'upstream/master' into preview-1.22.0
guilhermednt Feb 6, 2019
22c862f
added more information to support interface PROCERGS#841
guilhermednt Feb 7, 2019
72cd598
allowing admins to test the interface without ticket id PROCERGS#841
guilhermednt Feb 7, 2019
66eea11
making it easy to extend third party connections PROCERGS#841
guilhermednt Feb 7, 2019
e25fdfc
Merge pull request #320 from PROCERGS/issue#841
guilhermednt Feb 7, 2019
a023c2a
Merge remote-tracking branch 'upstream/master' into preview-1.22.0
guilhermednt Feb 7, 2019
fd28e7c
extended SupportHandler to include NFG status PROCERGS#841
guilhermednt Feb 8, 2019
4d7fd9a
added SupportHandlerInterface PROCERGS#841
guilhermednt Feb 8, 2019
3a23e33
Merge pull request #321 from PROCERGS/issue#841
guilhermednt Feb 8, 2019
0de490a
Merge remote-tracking branch 'upstream/master' into preview-1.22.0
guilhermednt Feb 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public function registerBundles()
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
new Snc\RedisBundle\SncRedisBundle(),
new Http\HttplugBundle\HttplugBundle(),
new LoginCidadao\SupportBundle\LoginCidadaoSupportBundle(),

// PROCERGS
new PROCERGS\LoginCidadao\CoreBundle\PROCERGSLoginCidadaoCoreBundle(),
Expand Down
6 changes: 4 additions & 2 deletions app/Resources/translations/messages.pt_BR.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
password_hint:
range:
with_reqs: Senha de %min% ou mais %reqs%.
no_reqs: Senha de %min% ou mais caracteres.
with_reqs: "Senha de %min% ou mais %reqs%."
no_reqs: "Senha de %min% ou mais caracteres."

support.person.view.connections.nfg.label: "Nota Fiscal Gaúcha"
10 changes: 10 additions & 0 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ imports:
- { resource: logstash.yml }
- { resource: "@LoginCidadaoTOSBundle/Resources/config/config.yml" }
- { resource: 'workflows/*.{yml,yaml}' }
- { resource: "@LoginCidadaoSupportBundle/Resources/config/services.yml" }

framework:
#esi: ~
Expand Down Expand Up @@ -296,6 +297,7 @@ simple_things_entity_audit:

- LoginCidadao\PhoneVerificationBundle\Entity\PhoneVerification
- LoginCidadao\PhoneVerificationBundle\Entity\SentVerification
- LoginCidadao\PhoneVerificationBundle\Entity\BlockedPhoneNumber

- PROCERGS\LoginCidadao\CoreBunde\Entity\PersonMeuRS
- PROCERGS\LoginCidadao\NfgBunde\Entity\NfgProfile
Expand Down Expand Up @@ -605,6 +607,14 @@ services:
fos_user.doctrine_registry:
alias: doctrine

# Extend Third Party Connections in the Support Page
PROCERGS\LoginCidadao\CoreBundle\Service\SupportHandlerDecorator:
decorates: 'LoginCidadao\SupportBundle\Service\SupportHandler'
arguments:
- '@PROCERGS\LoginCidadao\CoreBundle\Service\SupportHandlerDecorator.inner'
- '@meurs.helper'
- '@lc.person.repository'

donato_path_well:
enabled: '%check_pathwell_topologies%'

Expand Down
5 changes: 5 additions & 0 deletions app/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ procergs_nfg:
type: annotation
prefix: /nfg

support:
resource: "@LoginCidadaoSupportBundle/Controller/"
type: annotation
prefix: /

# Remote Claims
lc_remote_claims_remote_claim:
type: rest
Expand Down
25 changes: 23 additions & 2 deletions app/config/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ security:
- ROLE_PERSON_EDIT
- ROLE_VIEW_3RD_PARTY_CONNECTIONS
- ROLE_EDIT_CLIENT_SUBJECT_TYPE
- ROLE_EDIT_BLOCKED_PHONES
- ROLE_SUPPORT_MANAGER
- ROLE_ACCOUNTANT
ROLE_SUPER_ADMIN:
- ROLE_ADMIN
Expand All @@ -52,6 +54,7 @@ security:
- ROLE_AUDIT_PROFILE_VIEWS
- ROLE_VIEW_3RD_PARTY_CONNECTIONS_USERNAMES
- ROLE_PERSON_BLOCK
- ROLE_SKIP_SUPPORT_TOKEN_VALIDATION

ROLE_ALLOWED_TO_SWITCH: FEATURE_IMPERSONATION_REPORTS
ROLE_EDIT_CLIENT_ALLOWED_RESTRICTED_SCOPES: ROLE_EDIT_CLIENT_ALLOWED_SCOPES
Expand All @@ -61,15 +64,33 @@ security:
ROLE_VIEW_3RD_PARTY_CONNECTIONS:
ROLE_PERSON_BLOCK:
ROLE_EDIT_CLIENT_SUBJECT_TYPE:
ROLE_EDIT_BLOCKED_PHONES:
ROLE_SKIP_SUPPORT_TOKEN_VALIDATION:
FEATURE_ALPHA: FEATURE_BETA, FEATURE_SHOW_PROFILE_VIEWS
FEATURE_BETA: FEATURE_PROD, FEATURE_ORGANIZATIONS
FEATURE_PROD: FEATURE_2FACTOR_AUTH, FEATURE_INVALIDATE_SESSIONS, FEATURE_REMOTE_CLAIMS
FEATURE_PROD: FEATURE_2FACTOR_AUTH, FEATURE_INVALIDATE_SESSIONS, FEATURE_REMOTE_CLAIMS, FEATURE_PHONE_BLOCKLIST
FEATURE_IGP_VALIDATION:
FEATURE_ORGANIZATIONS:
FEATURE_IMPERSONATION_REPORTS:
FEATURE_EDIT_USERNAME:
FEATURE_SHOW_PROFILE_VIEWS:
FEATURE_REMOTE_CLAIMS:
FEATURE_PHONE_BLOCKLIST:

# Support Roles
ROLE_SUPPORT_AGENT:
- ROLE_SUPPORT_SEARCH_USERS
ROLE_SUPPORT_MANAGER:
- ROLE_SUPPORT_AGENT
- ROLE_SUPPORT_MANAGE_AGENTS
- ROLE_SUPPORT_VIEW_EMAIL
- ROLE_SUPPORT_VIEW_PHONE
- ROLE_SUPPORT_VIEW_BIRTHDAY
ROLE_SUPPORT_MANAGE_AGENTS:
ROLE_SUPPORT_SEARCH_USERS:
ROLE_SUPPORT_VIEW_EMAIL:
ROLE_SUPPORT_VIEW_PHONE:
ROLE_SUPPORT_VIEW_BIRTHDAY:

providers:
chainprovider:
Expand Down Expand Up @@ -164,7 +185,7 @@ security:
- { path: ^/api/v1/address/(cities|states|countries)/search, role: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
- { path: ^/api/v1/public/lc_consultaCep2, role: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
- { path: ^/api/v1/statistics, role: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
- { path: ^/api/v1/phone-verification/(update-status|average-delivery-time|not-delivered), role: IS_AUTHENTICATED_ANONYMOUSLY, ip: %allowed_monitors%, requires_channel: https }
- { path: ^/api/v1/phone-verification/(update-status|average-delivery-time|not-delivered), role: IS_AUTHENTICATED_ANONYMOUSLY, ips: "%allowed_monitors%", requires_channel: https }
- { path: ^/api/v1/accounting, role: IS_AUTHENTICATED_ANONYMOUSLY, ip: %allowed_accounting%, requires_channel: https }
- { path: ^/api, roles: [ IS_AUTHENTICATED_FULLY ], requires_channel: https }

Expand Down
4 changes: 1 addition & 3 deletions src/LoginCidadao/APIBundle/Controller/PersonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,13 @@ public function getLogoutKeyAction($id)
$em->persist($logoutKey);
$em->flush();

$result = [
return [
'key' => $logoutKey->getKey(),
'url' => $this->generateUrl(
'lc_logout_not_remembered_safe',
['key' => $logoutKey->getKey()],
UrlGeneratorInterface::ABSOLUTE_URL
),
];

return $result;
}
}
13 changes: 7 additions & 6 deletions src/LoginCidadao/APIBundle/Security/Audit/ActionLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace LoginCidadao\APIBundle\Security\Audit;

use LoginCidadao\CoreBundle\Model\IdentifiablePersonInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\HttpFoundation\Request;
Expand Down Expand Up @@ -188,14 +189,14 @@ public function registerImpersonate(

/**
* @param Request $request
* @param PersonInterface $person
* @param PersonInterface $viewer
* @param IdentifiablePersonInterface $person
* @param IdentifiablePersonInterface $viewer
* @param array $controllerAction
*/
public function registerProfileView(
Request $request,
PersonInterface $person,
PersonInterface $viewer,
IdentifiablePersonInterface $person,
IdentifiablePersonInterface $viewer,
array $controllerAction
) {
$auditUsername = $this->auditConfig->getCurrentUsername();
Expand All @@ -206,8 +207,8 @@ public function registerProfileView(

private function registerActionLog(
Request $request,
PersonInterface $person,
PersonInterface $actor,
IdentifiablePersonInterface $person,
IdentifiablePersonInterface $actor,
array $controllerAction,
$auditUsername,
$actionType
Expand Down
13 changes: 11 additions & 2 deletions src/LoginCidadao/CoreBundle/Controller/Admin/PersonController.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
<?php
/**
* This file is part of the login-cidadao project or it's bundles.
*
* (c) Guilherme Donato <guilhermednt on github>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace LoginCidadao\CoreBundle\Controller\Admin;

use Doctrine\ORM\NonUniqueResultException;
use libphonenumber\PhoneNumber;
use LoginCidadao\APIBundle\Security\Audit\ActionLogger;
use LoginCidadao\CoreBundle\Entity\PersonRepository;
use LoginCidadao\CoreBundle\Form\Type\PersonFilterFormType;
use LoginCidadao\CoreBundle\Form\Type\PersonResumeFormType;
use LoginCidadao\CoreBundle\Security\User\Manager\UserManager;
use LoginCidadao\PhoneVerificationBundle\Service\PhoneVerificationServiceInterface;
Expand Down Expand Up @@ -39,7 +48,7 @@ public function indexAction(Request $request)
if ($request->get('search') !== null) {
$data = ['username' => $request->get('search')];
}
$form = $this->createForm('LoginCidadao\CoreBundle\Form\Type\PersonFilterFormType', $data);
$form = $this->createForm(PersonFilterFormType::class, $data);
$form = $form->createView();

return compact('form');
Expand Down Expand Up @@ -114,7 +123,7 @@ public function blockAction(Request $request, $id, $token)
*/
public function gridAction(Request $request)
{
$form = $this->createForm('LoginCidadao\CoreBundle\Form\Type\PersonFilterFormType');
$form = $this->createForm(PersonFilterFormType::class);
$form->handleRequest($request);
$gridView = null;
if ($form->isValid()) {
Expand Down
12 changes: 7 additions & 5 deletions src/LoginCidadao/CoreBundle/Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,20 @@ public function dashboardAction()
// logs
$em = $this->getDoctrine()->getManager();

$showProfileViews = $this->isGranted('FEATURE_SHOW_PROFILE_VIEWS');
/** @var ActionLogRepository $logRepo */
$logRepo = $em->getRepository('LoginCidadaoAPIBundle:ActionLog');
$logs['logins'] = $logRepo->findLoginsByPerson($this->getUser(), 5);
$logs['activity'] = $logRepo->getActivityLogsByTarget($this->getUser(), 4);
$logs['activity'] = $logRepo->getActivityLogsByTarget($this->getUser(), 4, $showProfileViews);

$defaultClientUid = $this->container->getParameter('oauth_default_client.uid');

return array(
return [
'allBadges' => $badges,
'userBadges' => $userBadges,
'logs' => $logs,
'defaultClientUid' => $defaultClientUid,
);
];
}

/**
Expand Down Expand Up @@ -170,9 +171,10 @@ private function getEmail(SupportMessage $supportMessage, TranslatorInterface $t
{
$message = $supportMessage->getFormattedMessage($translator);

$email = (new SentEmail())
$email = new SentEmail();
$email
->setType('contact-mail')
->setSubject('Fale conosco - '.$supportMessage->getName())
->setSubject('Fale conosco - '.$supportMessage->getName()." - Ticket: {$email->getSupportTicket()}")
->setSender($supportMessage->getEmail())
->setReceiver($this->container->getParameter('contact_form.email'))
->setMessage($message);
Expand Down
3 changes: 2 additions & 1 deletion src/LoginCidadao/CoreBundle/Controller/TaskController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use FOS\UserBundle\Util\TokenGenerator;
use FOS\UserBundle\Event\GetResponseUserEvent;
use LoginCidadao\CoreBundle\Entity\Person;
use LoginCidadao\CoreBundle\Form\Type\EmailFormType;
use LoginCidadao\CoreBundle\Model\ConfirmEmailTask;
use LoginCidadao\CoreBundle\Model\PersonInterface;
use LoginCidadao\TaskStackBundle\Model\RouteTaskTarget;
Expand Down Expand Up @@ -57,7 +58,7 @@ public function confirmEmailAction(Request $request)
$event = new GetResponseUserEvent($person, $request);
$dispatcher->dispatch(FOSUserEvents::PROFILE_EDIT_INITIALIZE, $event);

$form = $this->createForm('LoginCidadao\CoreBundle\Form\Type\EmailFormType', $person);
$form = $this->createForm(EmailFormType::class, $person);

$response = null;
$form->handleRequest($request);
Expand Down
19 changes: 19 additions & 0 deletions src/LoginCidadao/CoreBundle/Entity/PersonRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use libphonenumber\PhoneNumber;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberUtil;
use Misd\PhoneNumberBundle\Doctrine\DBAL\Types\PhoneNumberType;

class PersonRepository extends EntityRepository
{
Expand Down Expand Up @@ -222,6 +223,20 @@ public function getNameSearchQuery($name)
->setParameter('name', "%{$sanitized}%");
}

public function getPhoneSearchQuery(PhoneNumber $phoneNumber)
{
return $this->getBaseSearchQuery()
->where('p.mobile = :mobile')
->setParameter('mobile', $phoneNumber, PhoneNumberType::NAME);
}

public function getPartialPhoneSearchQuery(string $phoneNumber)
{
return $this->getBaseSearchQuery()
->where('p.mobile LIKE :mobile')
->setParameter('mobile', "{$phoneNumber}%");
}

/**
* This will return the appropriate query for the input given.
* @param $query
Expand Down Expand Up @@ -249,6 +264,10 @@ public function getSmartSearchQuery($query)
return $this->getEmailSearchQuery($query);
}

if ($query[0] === '+') {
return $this->getPartialPhoneSearchQuery($query);
}

// Defaults to name search
return $this->getNameSearchQuery($query);
}
Expand Down
21 changes: 21 additions & 0 deletions src/LoginCidadao/CoreBundle/Entity/SentEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace LoginCidadao\CoreBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Ramsey\Uuid\Uuid;

/**
* SentEmail
Expand Down Expand Up @@ -71,9 +72,21 @@ class SentEmail
*/
private $type;

/**
* @var string
*
* @ORM\Column(name="support_ticket", type="string", length=255, unique=true)
*/
private $supportTicket;

public function __construct()
{
$this->setDate(new \DateTime());
try {
$this->supportTicket = Uuid::uuid4();
} catch (\Exception $e) {
$this->supportTicket = bin2hex(random_bytes(4));
}
}

/**
Expand Down Expand Up @@ -224,6 +237,14 @@ public function getType()
return $this->type;
}

/**
* @return string
*/
public function getSupportTicket(): string
{
return $this->supportTicket;
}

public function getSwiftMail()
{
return (new \Swift_Message($this->getSubject()))
Expand Down
Loading