Commit 3a1d23a531e17e7eddd27fcc4530ec36fa12216a

Authored by Alexandre
1 parent 0d982d72

Version: 2.4.3.5

Bugfixes LDAP
			
Version majeure en cours (2.5): https://projects.irap.omp.eu/versions/99

ROADMAP: https://projects.irap.omp.eu/projects/labinvent/roadmap
README-LABINVENT.md
@@ -51,9 +51,9 @@ Logiciel testé et validé sur les configurations suivantes : @@ -51,9 +51,9 @@ Logiciel testé et validé sur les configurations suivantes :
51 VERSION ACTUELLE 51 VERSION ACTUELLE
52 52
53 Date: 10/06/2016 53 Date: 10/06/2016
54 -Version: 2.4.3.4 54 +Version: 2.4.3.5
55 55
56 -Bugfixes 56 +Bugfixes LDAP
57 57
58 Version majeure en cours (2.5): https://projects.irap.omp.eu/versions/99 58 Version majeure en cours (2.5): https://projects.irap.omp.eu/versions/99
59 59
src/Controller/PagesController.php
@@ -50,11 +50,10 @@ class PagesController extends AppController @@ -50,11 +50,10 @@ class PagesController extends AppController
50 50
51 //Si l'utilisateur n'est pas connecté, on le redirige vers la page login.ctp 51 //Si l'utilisateur n'est pas connecté, on le redirige vers la page login.ctp
52 //sauf si l'action demandé est 'about' ou si le mode install est activé 52 //sauf si l'action demandé est 'about' ou si le mode install est activé
53 - if (!($this->LdapAuth->user('uid')[0]) && $path[0] != 'about' && !($configuration->mode_install)) { 53 + if (!($this->LdapAuth->user($configuration->authentificationType_ldap)[0]) && $path[0] != 'about' && !($configuration->mode_install)) {
54 return $this->redirect(['controller' => 'users', 'action' => 'login']); 54 return $this->redirect(['controller' => 'users', 'action' => 'login']);
55 } 55 }
56 56
57 -  
58 57
59 $count = count($path); 58 $count = count($path);
60 if (!$count) { 59 if (!$count) {
src/Model/Table/LdapConnectionsTable.php
@@ -45,7 +45,6 @@ class LdapConnectionsTable extends AppTable { @@ -45,7 +45,6 @@ class LdapConnectionsTable extends AppTable {
45 $ldapUsers[] = [ 45 $ldapUsers[] = [
46 'sn' => [$names[0]], 46 'sn' => [$names[0]],
47 'mail' => [$user['email']], 47 'mail' => [$user['email']],
48 - 'uid' => [$user['username']],  
49 'givenname' => [$names[1]], 48 'givenname' => [$names[1]],
50 $this->authenticationType => [$user['username']], 49 $this->authenticationType => [$user['username']],
51 'userpassword' => [$user['password']], 50 'userpassword' => [$user['password']],
@@ -55,7 +54,6 @@ class LdapConnectionsTable extends AppTable { @@ -55,7 +54,6 @@ class LdapConnectionsTable extends AppTable {
55 $ldapUsers[] = [ 54 $ldapUsers[] = [
56 'sn' => [$names[0]], 55 'sn' => [$names[0]],
57 'mail' => [$user['email']], 56 'mail' => [$user['email']],
58 - 'uid' => [$user['username']],  
59 'givenname' => " ", 57 'givenname' => " ",
60 $this->authenticationType => [$user['username']], 58 $this->authenticationType => [$user['username']],
61 'userpassword' => [$user['password']], 59 'userpassword' => [$user['password']],
@@ -68,7 +66,6 @@ class LdapConnectionsTable extends AppTable { @@ -68,7 +66,6 @@ class LdapConnectionsTable extends AppTable {
68 'sn' => ['NOUVEL'], 66 'sn' => ['NOUVEL'],
69 'givenname' => ['UTILISATEUR'], 67 'givenname' => ['UTILISATEUR'],
70 'mail' => [$prefix.'email'], 68 'mail' => [$prefix.'email'],
71 - 'uid' => [$prefix.'login'],  
72 $this->authenticationType => [$prefix.'username'], 69 $this->authenticationType => [$prefix.'username'],
73 'userpassword' => [$prefix.'password'], 70 'userpassword' => [$prefix.'password'],
74 ]; 71 ];
@@ -168,11 +165,11 @@ class LdapConnectionsTable extends AppTable { @@ -168,11 +165,11 @@ class LdapConnectionsTable extends AppTable {
168 //EP added 165 //EP added
169 public function getFakeLdapUser($login) { 166 public function getFakeLdapUser($login) {
170 foreach ($this->fakeLDAPUsers as $user) { 167 foreach ($this->fakeLDAPUsers as $user) {
171 - if ($login == $user['uid'][0]) return $user; 168 + if ($login == $user[$this->authenticationType][0]) return $user;
172 } 169 }
173 return FALSE; 170 return FALSE;
174 } 171 }
175 - 172 +
176 /** 173 /**
177 * Return a list of Users with key = login & value = username 174 * Return a list of Users with key = login & value = username
178 */ 175 */
src/Template/Layout/default.ctp
@@ -94,7 +94,7 @@ $cakeDescription = 'Labinvent 2.0'; @@ -94,7 +94,7 @@ $cakeDescription = 'Labinvent 2.0';
94 </i></td> 94 </i></td>
95 <td id="version"> 95 <td id="version">
96 <!-- VERSION M.m.f.b (version (M)ajeure, version (m)ineure, numero de nouvelle (f)onctionnalite, numero de (b)ugfix) --> 96 <!-- VERSION M.m.f.b (version (M)ajeure, version (m)ineure, numero de nouvelle (f)onctionnalite, numero de (b)ugfix) -->
97 - <font color="black">VERSION 2.4.3.4 (10/06/2016)</font> 97 + <font color="black">VERSION 2.4.3.5 (10/06/2016)</font>
98 </td> 98 </td>
99 </tr> 99 </tr>
100 </table> 100 </table>
tests/TestCase/Controller/EmpruntsControllerTest.php
@@ -38,7 +38,6 @@ class EmpruntsControllerTest extends IntegrationTestCase @@ -38,7 +38,6 @@ class EmpruntsControllerTest extends IntegrationTestCase
38 'User' => [ 38 'User' => [
39 'sn' => [0 => 'test2'], 39 'sn' => [0 => 'test2'],
40 'mail' => [0 => 'test@test.fr'], 40 'mail' => [0 => 'test@test.fr'],
41 - 'uid' => [0 => 'testa'],  
42 'givenname' => [0 => 'test1'], 41 'givenname' => [0 => 'test1'],
43 'cn' => [0 => 'testa'], 42 'cn' => [0 => 'testa'],
44 'userpassword' => [0 => 'test'], 43 'userpassword' => [0 => 'test'],
tests/TestCase/Controller/MaterielsControllerTest.php
@@ -40,7 +40,6 @@ class MaterielsControllerTest extends IntegrationTestCase @@ -40,7 +40,6 @@ class MaterielsControllerTest extends IntegrationTestCase
40 'User' => [ 40 'User' => [
41 'sn' => [0 => 'test2'], 41 'sn' => [0 => 'test2'],
42 'mail' => [0 => 'testa@test.fr'], 42 'mail' => [0 => 'testa@test.fr'],
43 - 'uid' => [0 => 'testa'],  
44 'givenname' => [0 => 'test1'], 43 'givenname' => [0 => 'test1'],
45 'cn' => [0 => 'testa'], 44 'cn' => [0 => 'testa'],
46 'userpassword' => [0 => 'test'], 45 'userpassword' => [0 => 'test'],
@@ -61,7 +60,6 @@ class MaterielsControllerTest extends IntegrationTestCase @@ -61,7 +60,6 @@ class MaterielsControllerTest extends IntegrationTestCase
61 'User' => [ 60 'User' => [
62 'sn' => [0 => 'test4'], 61 'sn' => [0 => 'test4'],
63 'mail' => [0 => 'testz@test.fr'], 62 'mail' => [0 => 'testz@test.fr'],
64 - 'uid' => [0 => 'testz'],  
65 'givenname' => [0 => 'test3'], 63 'givenname' => [0 => 'test3'],
66 'cn' => [0 => 'testz'], 64 'cn' => [0 => 'testz'],
67 'userpassword' => [0 => 'test'], 65 'userpassword' => [0 => 'test'],
@@ -80,7 +78,6 @@ class MaterielsControllerTest extends IntegrationTestCase @@ -80,7 +78,6 @@ class MaterielsControllerTest extends IntegrationTestCase
80 'User' => [ 78 'User' => [
81 'sn' => [0 => 'test6'], 79 'sn' => [0 => 'test6'],
82 'mail' => [0 => 'teste@test.fr'], 80 'mail' => [0 => 'teste@test.fr'],
83 - 'uid' => [0 => 'teste'],  
84 'givenname' => [0 => 'test5'], 81 'givenname' => [0 => 'test5'],
85 'cn' => [0 => 'teste'], 82 'cn' => [0 => 'teste'],
86 'userpassword' => [0 => 'test'], 83 'userpassword' => [0 => 'test'],
@@ -99,7 +96,6 @@ class MaterielsControllerTest extends IntegrationTestCase @@ -99,7 +96,6 @@ class MaterielsControllerTest extends IntegrationTestCase
99 'User' => [ 96 'User' => [
100 'sn' => [0 => 'test8'], 97 'sn' => [0 => 'test8'],
101 'mail' => [0 => 'testr@test.fr'], 98 'mail' => [0 => 'testr@test.fr'],
102 - 'uid' => [0 => 'testr'],  
103 'givenname' => [0 => 'test7'], 99 'givenname' => [0 => 'test7'],
104 'cn' => [0 => 'testr'], 100 'cn' => [0 => 'testr'],
105 'userpassword' => [0 => 'test'], 101 'userpassword' => [0 => 'test'],
@@ -118,7 +114,6 @@ class MaterielsControllerTest extends IntegrationTestCase @@ -118,7 +114,6 @@ class MaterielsControllerTest extends IntegrationTestCase
118 'User' => [ 114 'User' => [
119 'sn' => [0 => 'test0'], 115 'sn' => [0 => 'test0'],
120 'mail' => [0 => 'testt@test.fr'], 116 'mail' => [0 => 'testt@test.fr'],
121 - 'uid' => [0 => 'testt'],  
122 'givenname' => [0 => 'test9'], 117 'givenname' => [0 => 'test9'],
123 'cn' => [0 => 'testt'], 118 'cn' => [0 => 'testt'],
124 'userpassword' => [0 => 'test'], 119 'userpassword' => [0 => 'test'],
tests/TestCase/Controller/PagesControllerTest.php
@@ -42,7 +42,6 @@ class PagesControllerTest extends IntegrationTestCase @@ -42,7 +42,6 @@ class PagesControllerTest extends IntegrationTestCase
42 'User' => [ 42 'User' => [
43 'sn' => [0 => 'test2'], 43 'sn' => [0 => 'test2'],
44 'mail' => [0 => 'test@test.fr'], 44 'mail' => [0 => 'test@test.fr'],
45 - 'uid' => [0 => 'testa'],  
46 'givenname' => [0 => 'test1'], 45 'givenname' => [0 => 'test1'],
47 'cn' => [0 => 'testa'], 46 'cn' => [0 => 'testa'],
48 'userpassword' => [0 => 'test'], 47 'userpassword' => [0 => 'test'],
tests/TestCase/Controller/SuivisControllerTest.php
@@ -39,7 +39,6 @@ class SuivisControllerTest extends IntegrationTestCase @@ -39,7 +39,6 @@ class SuivisControllerTest extends IntegrationTestCase
39 'User' => [ 39 'User' => [
40 'sn' => [0 => 'test2'], 40 'sn' => [0 => 'test2'],
41 'mail' => [0 => 'test@test.fr'], 41 'mail' => [0 => 'test@test.fr'],
42 - 'uid' => [0 => 'testa'],  
43 'givenname' => [0 => 'test1'], 42 'givenname' => [0 => 'test1'],
44 'cn' => [0 => 'testa'], 43 'cn' => [0 => 'testa'],
45 'userpassword' => [0 => 'test'], 44 'userpassword' => [0 => 'test'],
tests/TestCase/Controller/UsersControllerTest.php
@@ -38,7 +38,6 @@ class UsersControllerTest extends IntegrationTestCase @@ -38,7 +38,6 @@ class UsersControllerTest extends IntegrationTestCase
38 'User' => [ 38 'User' => [
39 'sn' => [0 => 'test2'], 39 'sn' => [0 => 'test2'],
40 'mail' => [0 => 'test@test.fr'], 40 'mail' => [0 => 'test@test.fr'],
41 - 'uid' => [0 => 'testa'],  
42 'givenname' => [0 => 'test1'], 41 'givenname' => [0 => 'test1'],
43 'cn' => [0 => 'testa'], 42 'cn' => [0 => 'testa'],
44 'userpassword' => [0 => 'test'], 43 'userpassword' => [0 => 'test'],