refonte sonde

This commit is contained in:
afornerot 2020-10-23 15:11:06 +02:00
parent 82c70cc917
commit d4bc3dadd4
3 changed files with 13 additions and 17 deletions

View File

@ -29,6 +29,12 @@ app_logoutcas:
defaults: { _controller: App\Controller\SecurityController:logout }
#== Sonde ================================================================================================================
app_sonde:
path: /sonde
defaults: { _controller: App\Controller\SondeController:sonde }
#== Crop =========================================================================================================
app_crop01:
path: /user/crop01

View File

@ -1,5 +1,4 @@
<?php
// src/OC/UserBundle/Controller/SecurityController.php;
namespace App\Controller;
@ -8,18 +7,12 @@ use App\Entity\Group;
use App\Service\ldapService as ldapService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
use Symfony\Component\EventDispatcher\EventDispatcher;
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
{
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
$redirect = $this->get('session')->get("_security.main.target_path");
@ -70,14 +63,7 @@ class SecurityController extends AbstractController
$username = \phpCAS::getUser();
// Récupération Attribut
$attributes = \phpCAS::getAttributes();
// Suppression des Attributs en tableaux
foreach ($attributes as $key => $value) {
if(is_array($value))
unset($attributes[$key]);
}
$attributes = \phpCAS::getAttributes();
// Rechercher l'utilisateur
$em = $this->getDoctrine()->getManager();
@ -119,6 +105,10 @@ class SecurityController extends AbstractController
$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");
if($masteridentity=="Ninegate") {
$this->updateNinegate($user);

View File

@ -132,7 +132,7 @@
</script>
{% if sondeUse %}
<script src='{{ sondeUrl }}?appli={{ appName }}'></script>
{{ render(path("app_sonde")) }}
{% endif %}
</body>
</html>