passage en cas proxy pour imapunread
This commit is contained in:
@ -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();
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -10,3 +10,7 @@ cas_sp.test:
|
||||
path: /test
|
||||
defaults: { _controller: CadolesCASBundle:Security:test }
|
||||
|
||||
cas_sp.imapunread:
|
||||
path: /imapunread
|
||||
defaults: { _controller: CadolesCASBundle:Security:imapunread }
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user