refonte sonde

This commit is contained in:
afornerot 2020-10-23 13:27:07 +02:00
parent 463cf49fe0
commit 33c61bb618
7 changed files with 86 additions and 11 deletions

View File

@ -147,14 +147,6 @@ class SecurityController extends Controller
}
}
// Calcul Service
/*
$user = $em->getRepository('CadolesCoreBundle:User')->calculateServices($user, $attributes);
// Attributs calculés
$attributes = $em->getRepository('CadolesCoreBundle:User')->calculateAttributes($user, $attributes);
*/
// Sauvegarde des attributes en session
$this->get('session')->set('attributes', $attributes);

View File

@ -0,0 +1,74 @@
<?php
namespace Cadoles\CoreBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\HttpFoundation\Session\Session;
class SondeController extends Controller
{
public function sondeAction()
{
// Debug sonde
$fgdebug = true;
// Calcul du login
$user=$this->getUser();
if($user) $loginsonde=crypt($user->getUsername(),"dkywqZPYNHtWDnSxACjXVcIsFuaiQT");
else $loginsonde="";
// Calcul du profil
$profilsonde="visiteur";
if($user) {
$profilsonde="utilisateur";
$attributes=$this->get('session')->get('attributes');
if(isset($attributes["ENTPersonProfils"])) $profilsonde=$attributes["ENTPersonProfils"];
}
// Calcul de la provenance
$e = explode('.', $_SERVER["REMOTE_ADDR"]);
$s = sizeof($e);
if(($e[0]=="172"&&$e[1]=="30")||($e[0]=="172"&&$e[1]=="16")||($e[0]=="10"&&($e[1]=="77"||$e[1]=="93"||$e[1]=="94")))
$provenancesonde='interne';
else
$provenancesonde='externe';
// Calcul du service associé à la page
$request = $this->get('request_stack')->getMasterRequest();
$usage=$request->query->get('usage');
$route = $request->attributes->get('_route');
if($route=="cadoles_core_user_file_list"||$route=="cadoles_core_home")
$usagesonde="nosonde";
elseif($route=="cadoles_portal_user_page_view") {
if($usage=="group") $usagesonde="collaboratif";
elseif($usage=="user") $usagesonde="collaboratif";
else $usagesonde="portail";
}
elseif(stripos($route,"cadoles_portal_user_calendar")!==false)
$usagesonde="calendrier";
elseif(stripos($route,"cadoles_portal_user_project")!==false)
$usagesonde="calendrier";
elseif(stripos($route,"cadoles_portal_user_blog")!==false)
$usagesonde="collaboratif";
elseif(stripos($route,"cadoles_core_user_file")!==false)
$usagesonde="fichier";
else
$usagesonde="portail";
$urlsonde="";
if($usagesonde!="nosonde") {
$url=$this->getParameter("widsonde_url");
$app=$this->getParameter("alias");
$urlsonde = $url."?appli=$app&profil=$profilsonde&login=$loginsonde&provenance=$provenancesonde&usage=$usagesonde&route=$route&fgdebug=$fgdebug";
}
return $this->render('CadolesCoreBundle:Sonde:sonde.html.twig',['urlsonde' => $urlsonde]);
}
}

View File

@ -45,6 +45,11 @@ cadoles_core_redirect:
path: /user/redirect/{route}/{id}
defaults: { _controller: CadolesCoreBundle:Security:redirect }
#== Sonde ================================================================================================================
cadoles_core_sonde:
path: /sonde
defaults: { _controller: CadolesCoreBundle:Sonde:sonde }
#== Crop Image ===========================================================================================================
cadoles_core_crop01:
path: /crop01

View File

@ -65,7 +65,6 @@
widthbody=widthbody-250;
if(widthbody<950) widthbody="100%";
console.log("euhe"+widthbody);
//$("#image").css({});
$("#image").css("height","auto");
$("#image").css("max-width",widthbody);

View File

@ -0,0 +1,3 @@
{% if not urlsonde is empty %}
<script src='{{ urlsonde }}'></script>
{% endif %}

View File

@ -158,8 +158,8 @@
{% endblock %}
</script>
{% if activate_widsonde %}
<script src='{{ widsonde_url }}?appli=Ninegate'></script>
{% if activate_widsonde and not framed is defined %}
{{ render(path("cadoles_core_sonde")) }}
{% endif %}
</body>

View File

@ -6,4 +6,6 @@ lastname=sn
email=mail
user_groups=user_groups
rne=rne
ENTPersonProfils=ENTPersonProfils