diff --git a/application/modules/user/controllers/LogController.php b/application/modules/user/controllers/LogController.php index 2e81aae0d..0f3c406b1 100644 --- a/application/modules/user/controllers/LogController.php +++ b/application/modules/user/controllers/LogController.php @@ -10,7 +10,57 @@ class User_LogController extends Zend_Controller_Action } public function indexAction(){} - public function authAction(){} + + /** + * Liste des authentifications + */ + public function authAction() + { + $request = $this->getRequest(); + + // --- Année de départ + $user = new Scores_Utilisateur(); + $startYear = substr($user->identity->dateDebutCompte,0,4); + if (empty($startYear)) { + $startYear = 2006; + } + + // --- Date + $date = new Zend_Date(); + $year = $date->toString('yyyy'); //Année en cours + $month = $date->toString('MM'); //Mois en cours + + $nbYear = $year - $startYear + 1; + $selectYear = array(); + for( $i=0; $i<$nbYear; $i++ ) { + $selectYear[] = $startYear + $i; + } + $this->view->Years = $selectYear; + + $selectMonth = array('01','02','03','04','05','06','07','08','09','10','11','12'); + $this->view->Months = $selectMonth; + + $selectedYear = $request->getParam('y', date('Y')); + $this->view->year = $selectedYear; + $selectedMonth = $request->getParam('m', date('m')); + $this->view->month = $selectedMonth; + // --- Fin Date + + $ws = new Scores_Ws_Client('account', '0.1'); + $params = new stdClass(); + $params->month = $selectedYear.'-'.$selectedMonth; + $params->type = 'OK'; + $response = $ws->getAuthLog($params); + + if ($response === false) { + $this->view->Error = true; + } else { + $this->view->List = $response->List->item; + } + + } + public function consoAction(){} - public function consocsvAction(){} + + public function consocsvAction(){} } \ No newline at end of file diff --git a/application/modules/user/views/default/scripts/log/auth.phtml b/application/modules/user/views/default/scripts/log/auth.phtml index b3d9bbc7f..fc5b99b0d 100644 --- a/application/modules/user/views/default/scripts/log/auth.phtml +++ b/application/modules/user/views/default/scripts/log/auth.phtml @@ -1 +1,40 @@ - +

Historique de vos connexions

+
+
+ + + + +
+
+ +

Détail

+List) > 0) {?> + + + + + + + + +List as $item) {?> + + + + + + +
DateIP
Date?>IP?>
+ + + \ No newline at end of file diff --git a/application/modules/user/views/default/scripts/log/conso.phtml b/application/modules/user/views/default/scripts/log/conso.phtml index b3d9bbc7f..0815ba1a9 100644 --- a/application/modules/user/views/default/scripts/log/conso.phtml +++ b/application/modules/user/views/default/scripts/log/conso.phtml @@ -1 +1,7 @@ - +

Consommation cummulée au service

+ + + + + \ No newline at end of file diff --git a/application/modules/user/views/default/scripts/log/consodetail.phtml b/application/modules/user/views/default/scripts/log/consodetail.phtml new file mode 100644 index 000000000..b3d9bbc7f --- /dev/null +++ b/application/modules/user/views/default/scripts/log/consodetail.phtml @@ -0,0 +1 @@ +