@@ -28,6 +28,7 @@ public static function setup(Event $event) {
2828 $ _spOrganizationDisplayName = "Organization Display Name " ;
2929 $ _spOrganizationURL = "https://www.organization.org " ;
3030 $ _entityID = "https://localhost " ;
31+ $ _spDomain = "localhost " ;
3132 $ _acsIndex = 0 ;
3233 $ _adminPassword = "admin " ;
3334 $ _technicalContactName = "" ;
@@ -91,14 +92,42 @@ public static function setup(Event $event) {
9192 }
9293
9394 if (!isset ($ config ['entityID ' ])) {
94- echo "Please insert your EntityID ( " .
95+ echo "Please insert your EntityID, must start with http:// or https:// ( " .
9596 $ colors ->getColoredString ($ _entityID , "green " ) . "): " ;
9697 $ config ['entityID ' ] = readline ();
9798 if ($ config ['entityID ' ] == null || $ config ['entityID ' ] == "" ) {
9899 $ config ['entityID ' ] = $ _entityID ;
99100 }
100101 }
101102
103+ if (!isset ($ config ['spDomain ' ])) {
104+ $ lowerEntityId = strtolower ($ config ['entityID ' ]);
105+
106+ if (substr ($ lowerEntityId , 0 , 8 )==='https:// ' ) {
107+ $ _spDomain = substr ($ config ['entityID ' ], 8 );
108+ }
109+
110+ if (substr ($ lowerEntityId , 0 , 7 )==='http:// ' ) {
111+ $ _spDomain = substr ($ config ['entityID ' ], 7 );
112+ }
113+
114+ if (substr (strtolower ($ _spDomain ), 0 , 4 )==='www. ' ) {
115+ $ _spDomain = substr ($ _spDomain , 4 );
116+ }
117+
118+
119+ echo "Please insert your Service Provider Domain, without www. ( " .
120+ $ colors ->getColoredString ($ _spDomain , "green " ) . "): " ;
121+ $ config ['spDomain ' ] = readline ();
122+ if ($ config ['spDomain ' ] == null || $ config ['spDomain ' ] == "" ) {
123+ $ config ['spDomain ' ] = $ _spDomain ;
124+ }
125+
126+ if ($ config ['spDomain ' ]!=$ _spDomain ) {
127+ echo $ colors ->getColoredString ("WARNING: the EntityID must be related to organization's domain " , "yellow " );
128+ }
129+ }
130+
102131 if (!isset ($ config ['spName ' ])) {
103132 echo "Please insert your Service Provider Name ( " .
104133 $ colors ->getColoredString ($ _spName , "green " ) . "): " ;
@@ -568,6 +597,7 @@ public static function setup(Event $event) {
568597 echo $ colors ->getColoredString ("\nWeb root directory: " . $ config ['wwwDir ' ], "yellow " );
569598 echo $ colors ->getColoredString ("\nService Name: " . $ config ['serviceName ' ], "yellow " );
570599 echo $ colors ->getColoredString ("\nEntity ID: " . $ config ['entityID ' ], "yellow " );
600+ echo $ colors ->getColoredString ("\nService Provider Domain: " . $ config ['spDomain ' ], "yellow " );
571601 echo $ colors ->getColoredString ("\nService Provider Name: " . $ config ['spName ' ], "yellow " );
572602 echo $ colors ->getColoredString ("\nService Provider Description: " . $ config ['spDescription ' ], "yellow " );
573603 echo $ colors ->getColoredString ("\nOrganization Name: " . $ config ['spOrganizationName ' ], "yellow " );
@@ -715,7 +745,8 @@ public static function setup(Event $event) {
715745 "{{TECHCONTACT_NAME}} " => "' " . $ config ['technicalContactName ' ] . "' " ,
716746 "{{TECHCONTACT_EMAIL}} " => "' " . $ config ['technicalContactEmail ' ] . "' " ,
717747 "{{ACSCUSTOMLOCATION}} " => "' " . $ config ['acsCustomLocation ' ] . "' " ,
718- "{{SLOCUSTOMLOCATION}} " => "' " . $ config ['sloCustomLocation ' ] . "' "
748+ "{{SLOCUSTOMLOCATION}} " => "' " . $ config ['sloCustomLocation ' ] . "' " ,
749+ "{{SP_DOMAIN}} " => "'. " . $ config ['spDomain ' ] . "' "
719750 );
720751 $ template = file_get_contents ($ config ['installDir ' ] . '/setup/config/config.tpl ' , true );
721752 $ customized = str_replace (array_keys ($ vars ), $ vars , $ template );
0 commit comments