Commit 0d5d4242d20177d333ea2512c9e0f7254c8bbb33

Authored by Etienne Pallier
1 parent ec0d1b37
Exists in master and in 1 other branch dev

ajouté moyenne générale

src/Controller/UsersController.php
... ... @@ -263,7 +263,7 @@ class UsersController extends AppController
263 263 }
264 264 private function _getCurrentUserEntityFromSession($session_user = null) {
265 265 $user_fullname = $this->_getCurrentUserFullNameFromSession($session_user);
266   - //debug($user_fullname);
  266 + debug($user_fullname);
267 267 // "Pallier Etienne"
268 268 return $this->Users->find()->where(['nom'=>$user_fullname])->first();
269 269 }
... ...
src/Template/Stats/index.ctp
... ... @@ -17,6 +17,19 @@ function getHourMnSecForDuration($duration_sec) {
17 17 }
18 18  
19 19  
  20 +echo "<b>Temps de connexion moyen (moyenne sur tous les utilisateurs et toutes les années) : </b>";
  21 +$connex_nb_tot = 0;
  22 +$connex_dur_tot_tot = 0;
  23 +foreach ($stats as $stat) {
  24 + $connex_nb_tot += $stat->connex_nb;
  25 + $connex_dur_tot_tot += $stat->connex_dur_tot;
  26 +}
  27 +$connex_dur_tot_avg = round($connex_dur_tot_tot / $connex_nb_tot);
  28 +//$connex_dur_tot_avg = intdiv($connex_dur_tot_tot , $connex_nb_tot);
  29 +//echo $connex_dur_tot_avg;
  30 +list($h,$m,$s) = getHourMnSecForDuration($connex_dur_tot_avg);
  31 +echo "$h h $m mn $s sec";
  32 +echo "<br>";echo "<br>";
20 33  
21 34  
22 35 ?>
... ...
tests/Fixture/UsersFixture.php
... ... @@ -57,10 +57,13 @@ class UsersFixture extends TestFixture
57 57 // Superadmin
58 58 [
59 59 //'id' => 1,
  60 +
60 61 // Nom Prénom
61 62 /////'nom' => 'user1 SUPER',
62 63 'nom' => 'SUPER user1',
63 64 //'nom' => 'test1 test2',
  65 +
  66 + // LOGIN
64 67 //'username' => 'testa',
65 68 'username' => 'user1_SUPER',
66 69 'password' => '$2y$10$VtYdA8Evkc.K.VpvqmF9wui5hc9ep19f8ukWBeFBIlunXSHPqw.K2',
... ... @@ -88,8 +91,9 @@ class UsersFixture extends TestFixture
88 91 // Admin
89 92 [
90 93 //'id' => 3,
  94 + ///////'nom' => 'user3 ADMIN',
91 95 //'nom' => 'test5 test6',
92   - 'nom' => 'user3 ADMIN',
  96 + 'nom' => 'test6 test5',
93 97 //'username' => 'teste',
94 98 'username' => 'user3_ADMIN',
95 99 'password' => '$2y$10$VtYdA8Evkc.K.VpvqmF9wui5hc9ep19f8ukWBeFBIlunXSHPqw.K2',
... ... @@ -102,8 +106,9 @@ class UsersFixture extends TestFixture
102 106 // Responsable
103 107 [
104 108 //'id' => 4,
  109 + /////'nom' => 'user4 RESP',
105 110 //'nom' => 'test7 test8',
106   - 'nom' => 'user4 RESP',
  111 + 'nom' => 'test8 test7',
107 112 //'username' => 'testr',
108 113 'username' => 'user4_RESP',
109 114 'password' => '$2y$10$VtYdA8Evkc.K.VpvqmF9wui5hc9ep19f8ukWBeFBIlunXSHPqw.K2',
... ... @@ -116,8 +121,9 @@ class UsersFixture extends TestFixture
116 121 // User (simple user, authentified, but no priviledge)
117 122 [
118 123 //'id' => 5,
  124 + ///////'nom' => 'user5 USER',
119 125 //'nom' => 'test9 test0',
120   - 'nom' => 'user5 USER',
  126 + 'nom' => 'test0 test9',
121 127 //'username' => 'testt',
122 128 'username' => 'user5_USER',
123 129 'password' => '$2y$10$VtYdA8Evkc.K.VpvqmF9wui5hc9ep19f8ukWBeFBIlunXSHPqw.K2',
... ...