Merge branch 'master' into dist/envole/6/master

This commit is contained in:
2021-07-05 14:41:20 +02:00
9 changed files with 51 additions and 45 deletions

View File

@ -30,7 +30,7 @@ class SecurityController extends Controller
// Init Client CAS
\phpCAS::setDebug("/var/log/phpcas/phpCAS-ninegate.log");
@\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
@\phpCAS::proxy(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
\phpCAS::setNoCasServerValidation();
@ -195,7 +195,7 @@ class SecurityController extends Controller
public function logoutAction() {
// Init Client CAS
\phpCAS::setDebug(false);
@\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), true);
@\phpCAS::proxy(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), true);
\phpCAS::setNoCasServerValidation();
@ -209,7 +209,7 @@ class SecurityController extends Controller
// Init Client CAS
\phpCAS::setDebug("/var/log/phpcas/phpCAS-ninegate.log");
@\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
@\phpCAS::proxy(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
\phpCAS::setNoCasServerValidation();
@ -295,4 +295,29 @@ class SecurityController extends Controller
}
}
function imapunreadAction() {
if($this->getParameter("active_imapunread")) {
$ip=$this->getParameter("imapundread_ip");
// Init Client CAS
\phpCAS::setDebug("/var/log/phpcas/phpCAS-ninegate.log");
@\phpCAS::proxy(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
\phpCAS::setNoCasServerValidation();
\phpCAS::forceAuthentication();
$pt= \phpCAS::retrievePT('imap://'.$ip,$t,$f);
$a = \phpCAS::serviceMail("{".$ip.":993/imap/ssl/novalidate-cert}","imap://".$ip,0, $errc,$err,$pt);
$unseen = imap_status($a, "{".$ip.":993/imap/ssl/novalidate-cert}INBOX", SA_UNSEEN);
$count=$unseen->unseen;
$response = new Response(json_encode($count));
}
else
$response = new Response(json_encode(""));
$response->headers->set('Content-Type', 'application/json');
return $response;
}
}

View File

@ -10,3 +10,7 @@ cas_sp.test:
path: /test
defaults: { _controller: CadolesCASBundle:Security:test }
cas_sp.imapunread:
path: /imapunread
defaults: { _controller: CadolesCASBundle:Security:imapunread }

View File

@ -6,9 +6,9 @@
{% set permannu = app.session.get('permannu') %}
{% if fgheader %}
<li id="menu-header"><a onclick="switchHeader()" title="Cacher / Affichier Bannière " style="cursor:pointer"><i class="fa fa-chevron-up fa-fw"></i></a>
<li id="menu-header"><a onclick="switchHeader()" title="Cacher / Afficher Bannière " style="cursor:pointer"><i class="fa fa-chevron-up fa-fw"></i></a>
{% else %}
<li id="menu-header"><a onclick="switchHeader()" title="Cacher / Affichier Bannière " style="cursor:pointer"><i class="fa fa-chevron-down fa-fw"></i></a>
<li id="menu-header"><a onclick="switchHeader()" title="Cacher / Afficher Bannière " style="cursor:pointer"><i class="fa fa-chevron-down fa-fw"></i></a>
{% endif %}
{% if is_granted('ROLE_ADMIN') or (is_granted('ROLE_MODO') and (permannu=="ROLE_MODO" or permannu=="ROLE_ANIM" or permannu=="ROLE_USER")) or (is_granted('ROLE_ANIM') and (permannu=="ROLE_ANIM" or permannu=="ROLE_USER")) or (is_granted('ROLE_USER') and permannu=="ROLE_USER") %}

View File

@ -973,7 +973,7 @@ class InitDataCommand extends ContainerAwareCommand
$entityItem->addGroup($groupall);
}
$entityItem->setUrl($widroundcube_url);
$entityItem->setBadgeurl("/ninegate/imap-unread.php");
$entityItem->setBadgeurl("/ninegate/cas/imapunread");
$em->persist($entityItem);
}

View File

@ -94,7 +94,7 @@
<div id="menupageaction">
<a id="menuname" style="cursor:pointer;font-size:80%" href="">qsfqsdf</a>
<a id="menuname" style="cursor:pointer;font-size:80%" href=""></a>
{% if canadd %}
<a id="menusubmit" style="cursor:pointer" onclick="submitPage()" title='Ajouter une page'><i class='fa fa-plus fa-fw'></i></a>
@ -313,10 +313,10 @@
order: [[ 1, "asc" ]],
});
{% if app.user %}
{% if app.user and app.session.get("timerefreshnotif") > 0%}
setInterval(function(){
loadmsgCounter()
}, 10000);
}, {{(app.session.get("timerefreshnotif")*1000)}});
{% endif %}
// Init socket de counter