@@ -41,25 +41,12 @@ public function insertLogin(&$request, &$date)
4141 $ spName = isset ($ request ['Destination ' ]['name ' ]) ? $ request ['Destination ' ]['name ' ]['en ' ] : '' ;
4242 }
4343
44- if (!in_array ($ databaseConnector ->getMode (), ['PROXY ' , 'IDP ' , 'SP ' ])) {
45- throw new Exception ('Unknown mode is set. Mode has to be one of the following: PROXY, IDP, SP. ' );
46- }
47-
48- if ($ databaseConnector ->getMode () !== 'IDP ' ) {
49- $ idpName = $ request ['Attributes ' ]['sourceIdPName ' ][0 ];
50- $ idpEntityID = $ request ['saml:sp:IdP ' ];
51- }
52- if ($ databaseConnector ->getMode () !== 'SP ' ) {
53- $ spEntityId = $ request ['Destination ' ]['entityid ' ];
54- $ spName = isset ($ request ['Destination ' ]['name ' ]) ? $ request ['Destination ' ]['name ' ]['en ' ] : '' ;
55- }
56-
57- if ($ databaseConnector ->getMode () === 'IDP ' ) {
58- $ idpName = $ databaseConnector ->getIdpName ();
59- $ idpEntityID = $ databaseConnector ->getIdpEntityId ();
60- } elseif ($ databaseConnector ->getMode () === 'SP ' ) {
61- $ spEntityId = $ databaseConnector ->getSpEntityId ();
62- $ spName = $ databaseConnector ->getSpName ();
44+ if ($ this ->databaseConnector ->getMode () === 'IDP ' ) {
45+ $ idpName = $ $ this ->databaseConnector ->getIdpName ();
46+ $ idpEntityID = $ $ this ->databaseConnector ->getIdpEntityId ();
47+ } elseif ($ this ->databaseConnector ->getMode () === 'SP ' ) {
48+ $ spEntityId = $ $ this ->databaseConnector ->getSpEntityId ();
49+ $ spName = $ $ this ->databaseConnector ->getSpName ();
6350 }
6451
6552 $ year = $ date ->format ('Y ' );
@@ -97,7 +84,6 @@ public function insertLogin(&$request, &$date)
9784 }
9885 }
9986
100- $ conn ->close ();
10187 }
10288
10389 public function getSpNameBySpIdentifier ($ identifier )
0 commit comments