redirect sur group d'invitation (ref #231)
This commit is contained in:
parent
ff7183ef5b
commit
0805750c33
|
@ -212,7 +212,7 @@ class RegistrationController extends Controller
|
||||||
// Sur erreur
|
// Sur erreur
|
||||||
$this->getErrorForm(null,$form,$request,$data,"submit",$idstatut);
|
$this->getErrorForm(null,$form,$request,$data,"submit",$idstatut);
|
||||||
|
|
||||||
// Sur validation(z)
|
// Sur validation
|
||||||
if ($form->get('submit')->isClicked() && $form->isValid()) {
|
if ($form->get('submit')->isClicked() && $form->isValid()) {
|
||||||
|
|
||||||
$data = $form->getData();
|
$data = $form->getData();
|
||||||
|
@ -342,6 +342,8 @@ class RegistrationController extends Controller
|
||||||
// A voir retour sur un écran d'info indiquant si validation par admion ou s'il doit matter ses email
|
// A voir retour sur un écran d'info indiquant si validation par admion ou s'il doit matter ses email
|
||||||
$this->get('session')->set('registrationinfo', $info);
|
$this->get('session')->set('registrationinfo', $info);
|
||||||
$this->get('session')->set('registrationmode', "info");
|
$this->get('session')->set('registrationmode', "info");
|
||||||
|
$this->get('session')->set('registrationredirectto', null);
|
||||||
|
|
||||||
return $this->redirectToRoute('cadoles_core_registration_info');
|
return $this->redirectToRoute('cadoles_core_registration_info');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -360,12 +362,16 @@ class RegistrationController extends Controller
|
||||||
{
|
{
|
||||||
$info = $this->get('session')->get('registrationinfo');
|
$info = $this->get('session')->get('registrationinfo');
|
||||||
$mode = $this->get('session')->get('registrationmode');
|
$mode = $this->get('session')->get('registrationmode');
|
||||||
|
$redirectto = $this->get('session')->get('registrationredirectto');
|
||||||
|
|
||||||
|
|
||||||
return $this->render($this->labelentity.':info.html.twig', [
|
return $this->render($this->labelentity.':info.html.twig', [
|
||||||
'useheader' => true,
|
'useheader' => true,
|
||||||
'usemenu' => false,
|
'usemenu' => false,
|
||||||
'usesidebar' => false,
|
'usesidebar' => false,
|
||||||
'info' => $info,
|
'info' => $info,
|
||||||
'mode' => $mode
|
'mode' => $mode,
|
||||||
|
'redirectto' => $redirectto,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -467,6 +473,7 @@ class RegistrationController extends Controller
|
||||||
{
|
{
|
||||||
$moderegistration = $this->getParameter('moderegistration');
|
$moderegistration = $this->getParameter('moderegistration');
|
||||||
$masteridentity = $this->getParameter('masteridentity');
|
$masteridentity = $this->getParameter('masteridentity');
|
||||||
|
|
||||||
if($moderegistration=="none"||$masteridentity!="SQL")
|
if($moderegistration=="none"||$masteridentity!="SQL")
|
||||||
throw $this->createNotFoundException('Permission denied');
|
throw $this->createNotFoundException('Permission denied');
|
||||||
|
|
||||||
|
@ -489,6 +496,7 @@ class RegistrationController extends Controller
|
||||||
|
|
||||||
$this->get('session')->set('registrationinfo', $info);
|
$this->get('session')->set('registrationinfo', $info);
|
||||||
$this->get('session')->set('registrationmode', $mode);
|
$this->get('session')->set('registrationmode', $mode);
|
||||||
|
$this->get('session')->set('registrationredirectto', null);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$url=$this->getUrlLogin();
|
$url=$this->getUrlLogin();
|
||||||
|
@ -539,10 +547,17 @@ class RegistrationController extends Controller
|
||||||
|
|
||||||
// Si invitation à un groupe : on le rattache directement à ce groupe
|
// Si invitation à un groupe : on le rattache directement à ce groupe
|
||||||
$groupid=$data[0]->getGroupid();
|
$groupid=$data[0]->getGroupid();
|
||||||
|
|
||||||
$userid=$user->getId();
|
$userid=$user->getId();
|
||||||
if($groupid) {
|
if($groupid) {
|
||||||
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
||||||
if($group) {
|
if($group) {
|
||||||
|
$idpage =$group->getPages()->first()->getId();
|
||||||
|
$url = $this->generateUrl('cadoles_core_redirect', ["route"=>"cadoles_core_home","id"=>$idpage], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||||
|
$info="<p>Votre compte est à présent activé</p><p>Vous allez être redirigé vers la mire de connexion puis vers votre groupe de travail</p><p><a href='".$url."'>Connexion</a>";
|
||||||
|
$this->get('session')->set('registrationinfo', $info);
|
||||||
|
$this->get('session')->set('registrationredirectto', $url);
|
||||||
|
|
||||||
$key = Uuid::uuid4();
|
$key = Uuid::uuid4();
|
||||||
$usergroup=new UserGroup();
|
$usergroup=new UserGroup();
|
||||||
$user=$em->getRepository("CadolesCoreBundle:User")->find($userid);
|
$user=$em->getRepository("CadolesCoreBundle:User")->find($userid);
|
||||||
|
@ -688,6 +703,7 @@ class RegistrationController extends Controller
|
||||||
$mode="info";
|
$mode="info";
|
||||||
$this->get('session')->set('registrationinfo', $info);
|
$this->get('session')->set('registrationinfo', $info);
|
||||||
$this->get('session')->set('registrationmode', $mode);
|
$this->get('session')->set('registrationmode', $mode);
|
||||||
|
$this->get('session')->set('registrationredirectto', null);
|
||||||
return $this->redirectToRoute('cadoles_core_registration_info');
|
return $this->redirectToRoute('cadoles_core_registration_info');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -724,6 +740,7 @@ class RegistrationController extends Controller
|
||||||
$mode="danger";
|
$mode="danger";
|
||||||
$this->get('session')->set('registrationinfo', $info);
|
$this->get('session')->set('registrationinfo', $info);
|
||||||
$this->get('session')->set('registrationmode', $mode);
|
$this->get('session')->set('registrationmode', $mode);
|
||||||
|
$this->get('session')->set('registrationredirectto', null);
|
||||||
return $this->redirectToRoute('cadoles_core_registration_info');
|
return $this->redirectToRoute('cadoles_core_registration_info');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -783,6 +800,7 @@ class RegistrationController extends Controller
|
||||||
$mode="success";
|
$mode="success";
|
||||||
$this->get('session')->set('registrationinfo', $info);
|
$this->get('session')->set('registrationinfo', $info);
|
||||||
$this->get('session')->set('registrationmode', $mode);
|
$this->get('session')->set('registrationmode', $mode);
|
||||||
|
$this->get('session')->set('registrationredirectto', null);
|
||||||
return $this->redirectToRoute('cadoles_core_registration_info');
|
return $this->redirectToRoute('cadoles_core_registration_info');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,9 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Redirection vers la mire d'authentification
|
// Redirection vers la mire d'authentification
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
{% if mode_auth == "SAML" %}
|
{% if redirectto is defined and redirectto is not null %}
|
||||||
|
window.location.href="{{ redirectto }}";
|
||||||
|
{% elseif mode_auth == "SAML" %}
|
||||||
window.location.href="{{ path("lightsaml_sp.login") }}";
|
window.location.href="{{ path("lightsaml_sp.login") }}";
|
||||||
{% elseif mode_auth == "CAS" %}
|
{% elseif mode_auth == "CAS" %}
|
||||||
window.location.href="{{ path("cas_sp.login") }}";
|
window.location.href="{{ path("cas_sp.login") }}";
|
||||||
|
@ -32,6 +34,5 @@
|
||||||
}, 6000);
|
}, 6000);
|
||||||
});
|
});
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue