2012-03-14 08:23:19 +00:00
|
|
|
|
<?php
|
|
|
|
|
class AideController extends Zend_Controller_Action
|
|
|
|
|
{
|
2015-07-08 13:48:28 +00:00
|
|
|
|
protected $theme;
|
2012-05-20 16:31:28 +00:00
|
|
|
|
|
2017-02-13 12:02:09 +01:00
|
|
|
|
/**
|
|
|
|
|
* Logger
|
|
|
|
|
* @var \Monolog\Logger
|
|
|
|
|
*/
|
|
|
|
|
protected $logger;
|
|
|
|
|
|
2015-07-08 20:38:22 +00:00
|
|
|
|
public function init()
|
|
|
|
|
{
|
2017-02-13 12:06:18 +01:00
|
|
|
|
if (Zend_Registry::isRegistered('logger')) {
|
|
|
|
|
$this->logger = Zend_Registry::get('logger');
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-08 20:38:22 +00:00
|
|
|
|
// --- Theme
|
|
|
|
|
$this->theme = Zend_Registry::get('theme');
|
|
|
|
|
}
|
|
|
|
|
|
2012-03-14 08:23:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* Afficher bulle pour les nouveautés
|
|
|
|
|
*/
|
|
|
|
|
public function newAction()
|
|
|
|
|
{
|
2012-03-15 11:12:07 +00:00
|
|
|
|
$nbNewsMax = 5;
|
2012-03-30 07:28:20 +00:00
|
|
|
|
$nbJourGlisssant = 5;
|
2012-05-20 16:31:28 +00:00
|
|
|
|
|
|
|
|
|
$user = new Scores_Utilisateur();
|
|
|
|
|
$date = $user->getDateDerniereConnexion();
|
2012-03-15 11:12:07 +00:00
|
|
|
|
$nouveautes = array();
|
2012-05-20 16:31:28 +00:00
|
|
|
|
if ( $date!=null || $date!='0000-00-00 00:00:00' )
|
|
|
|
|
{
|
2012-03-30 07:28:20 +00:00
|
|
|
|
$time = mktime(0, 0, 0, date('m'), date('d')-$nbJourGlisssant, date('Y'));
|
2012-03-15 11:12:07 +00:00
|
|
|
|
$dateglissant = date('Y-m-d', $time);
|
|
|
|
|
$now = date('Y-m-d');
|
2012-05-20 16:31:28 +00:00
|
|
|
|
|
2012-03-15 11:12:07 +00:00
|
|
|
|
$nouveautesM = new Application_Model_Nouveautes();
|
|
|
|
|
$sql = $nouveautesM->select()
|
2012-03-15 11:24:44 +00:00
|
|
|
|
->where("date>='".$dateglissant."' AND date<='".$now."'")
|
2012-03-15 11:12:07 +00:00
|
|
|
|
->order('date DESC')
|
2012-05-20 16:31:28 +00:00
|
|
|
|
->limit($nbNewsMax);
|
2012-03-15 11:12:07 +00:00
|
|
|
|
$nouveautes = $nouveautesM->fetchAll($sql);
|
|
|
|
|
}
|
|
|
|
|
$this->view->assign('nouveautes', $nouveautes);
|
2012-03-14 08:23:19 +00:00
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
|
2012-03-14 08:23:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* Afficher la liste des nouveautés
|
|
|
|
|
*/
|
|
|
|
|
public function newlisteAction()
|
|
|
|
|
{
|
2013-12-26 14:42:44 +00:00
|
|
|
|
$this->view->headTitle()->prepend('Nouveautés');
|
|
|
|
|
|
2012-03-14 08:23:19 +00:00
|
|
|
|
$request = $this->getRequest();
|
2012-05-20 16:31:28 +00:00
|
|
|
|
|
2012-03-14 08:23:19 +00:00
|
|
|
|
//Selection
|
|
|
|
|
$nouveautesM = new Application_Model_Nouveautes();
|
2012-04-10 14:23:08 +00:00
|
|
|
|
$sql = $nouveautesM->select()
|
|
|
|
|
->from('nouveautes', array('categorie', 'intitule', "date", 'fichier'))
|
|
|
|
|
->order('date DESC');
|
2012-04-05 20:53:31 +00:00
|
|
|
|
$nouveautes = $nouveautesM->fetchAll($sql);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
$this->view->assign('nouveautes', $nouveautes);
|
|
|
|
|
|
|
|
|
|
}
|
2013-02-12 16:07:13 +00:00
|
|
|
|
|
2015-03-05 14:55:03 +00:00
|
|
|
|
/**
|
|
|
|
|
* Affichage et validation de "cgu"
|
|
|
|
|
* Conditions d’accès à l'extranet
|
|
|
|
|
*/
|
2012-06-20 20:23:01 +00:00
|
|
|
|
public function cguAction()
|
|
|
|
|
{
|
|
|
|
|
$this->_helper->layout()->disableLayout();
|
|
|
|
|
$request = $this->getRequest();
|
2013-02-12 16:07:13 +00:00
|
|
|
|
|
2012-06-20 20:23:01 +00:00
|
|
|
|
$accept = $request->getParam('accept', 0);
|
|
|
|
|
|
|
|
|
|
if ( $accept == 1 ) {
|
|
|
|
|
require_once 'Scores/WsScores.php';
|
|
|
|
|
$ws = new WsScores();
|
|
|
|
|
$accept = $ws->setCGU();
|
|
|
|
|
Zend_Registry::get('firebug')->info($accept);
|
|
|
|
|
if ($accept) {
|
|
|
|
|
//Put in session
|
|
|
|
|
$auth = Zend_Auth::getInstance();
|
|
|
|
|
$identity = $auth->getIdentity();
|
|
|
|
|
$identity->acceptationCGU = date('Y-m-d H:i:s');
|
|
|
|
|
$auth->getStorage()->write($identity);
|
|
|
|
|
//Redirect
|
2013-12-26 14:42:44 +00:00
|
|
|
|
$this->redirect('/');
|
2012-06-20 20:23:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-02-12 16:07:13 +00:00
|
|
|
|
|
|
|
|
|
|
2015-03-05 14:55:03 +00:00
|
|
|
|
/**
|
|
|
|
|
* Afficher des propriétés du navigateur
|
|
|
|
|
* Compatibilités et version
|
|
|
|
|
*/
|
2013-02-12 16:07:13 +00:00
|
|
|
|
public function navinfoAction()
|
|
|
|
|
{
|
|
|
|
|
$bootstrap = $this->getInvokeArg('bootstrap');
|
|
|
|
|
$userAgent = $bootstrap->getResource('useragent');
|
|
|
|
|
|
|
|
|
|
$device = $userAgent->getDevice();
|
|
|
|
|
|
|
|
|
|
echo $device->getFeature('browser_compatibility').'<br/>';
|
|
|
|
|
echo $device->getFeature('browser_version').'<br/>';
|
|
|
|
|
|
|
|
|
|
echo "<pre>";
|
|
|
|
|
print_r($device);
|
|
|
|
|
echo "</pre>";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-03-14 08:23:19 +00:00
|
|
|
|
}
|