refonte sonde
This commit is contained in:
parent
82c70cc917
commit
d4bc3dadd4
|
@ -29,6 +29,12 @@ app_logoutcas:
|
||||||
defaults: { _controller: App\Controller\SecurityController:logout }
|
defaults: { _controller: App\Controller\SecurityController:logout }
|
||||||
|
|
||||||
|
|
||||||
|
#== Sonde ================================================================================================================
|
||||||
|
app_sonde:
|
||||||
|
path: /sonde
|
||||||
|
defaults: { _controller: App\Controller\SondeController:sonde }
|
||||||
|
|
||||||
|
|
||||||
#== Crop =========================================================================================================
|
#== Crop =========================================================================================================
|
||||||
app_crop01:
|
app_crop01:
|
||||||
path: /user/crop01
|
path: /user/crop01
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// src/OC/UserBundle/Controller/SecurityController.php;
|
|
||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
|
@ -8,18 +7,12 @@ use App\Entity\Group;
|
||||||
use App\Service\ldapService as ldapService;
|
use App\Service\ldapService as ldapService;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
||||||
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
|
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
|
|
||||||
use Symfony\Component\Security\Core\Encoder\EncoderFactory;
|
|
||||||
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
|
|
||||||
|
|
||||||
use jasig\phpcas\CAS;
|
|
||||||
|
|
||||||
class SecurityController extends AbstractController
|
class SecurityController extends AbstractController
|
||||||
{
|
{
|
||||||
private $ldapService;
|
private $ldapService;
|
||||||
|
@ -51,7 +44,7 @@ class SecurityController extends AbstractController
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logincas(Request $request, AuthenticationUtils $authenticationUtils)
|
public function loginCAS(Request $request, AuthenticationUtils $authenticationUtils)
|
||||||
{
|
{
|
||||||
// Récupération de la cible de navigation
|
// Récupération de la cible de navigation
|
||||||
$redirect = $this->get('session')->get("_security.main.target_path");
|
$redirect = $this->get('session')->get("_security.main.target_path");
|
||||||
|
@ -72,13 +65,6 @@ class SecurityController extends AbstractController
|
||||||
// Récupération Attribut
|
// Récupération Attribut
|
||||||
$attributes = \phpCAS::getAttributes();
|
$attributes = \phpCAS::getAttributes();
|
||||||
|
|
||||||
// Suppression des Attributs en tableaux
|
|
||||||
foreach ($attributes as $key => $value) {
|
|
||||||
if(is_array($value))
|
|
||||||
unset($attributes[$key]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Rechercher l'utilisateur
|
// Rechercher l'utilisateur
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
if(isset($attributes[$this->getParameter('casUsername')]))
|
if(isset($attributes[$this->getParameter('casUsername')]))
|
||||||
|
@ -119,6 +105,10 @@ class SecurityController extends AbstractController
|
||||||
$em->flush();
|
$em->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sauvegarde des attributes en session
|
||||||
|
$this->get('session')->set('attributes', $attributes);
|
||||||
|
|
||||||
|
// Mise à jour par rapport au maitre de l'identité
|
||||||
$masteridentity=$this->getParameter("appMasteridentity");
|
$masteridentity=$this->getParameter("appMasteridentity");
|
||||||
if($masteridentity=="Ninegate") {
|
if($masteridentity=="Ninegate") {
|
||||||
$this->updateNinegate($user);
|
$this->updateNinegate($user);
|
||||||
|
|
|
@ -132,7 +132,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% if sondeUse %}
|
{% if sondeUse %}
|
||||||
<script src='{{ sondeUrl }}?appli={{ appName }}'></script>
|
{{ render(path("app_sonde")) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue