for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Surfnet\StepupGateway\GatewayBundle\Entity;
use Surfnet\SamlBundle\Entity\ServiceProvider as BaseServiceProvider;
class ServiceProvider extends BaseServiceProvider
{
/**
* @return bool
*/
public function mayUseGateway()
return !$this->mayUseSecondFactorOnly();
}
public function mayUseSecondFactorOnly()
return (bool) $this->get('secondFactorOnly', false);
* @param string $nameId
public function isAllowedToUseSecondFactorOnlyFor($nameId)
if (empty($nameId)) {
return false;
if (!$this->mayUseSecondFactorOnly()) {
$nameIdPatterns = $this->get('secondFactorOnlyNameIdPatterns');
foreach ($nameIdPatterns as $nameIdPattern) {
if (fnmatch($nameIdPattern, $nameId)) {
return true;