diff --git a/etc/config.dist.php b/etc/config.dist.php index 90ac6ed5b94c88192b039f1ea91e49d8ba833b30..340ea619b4b9734200450313f062a6d63730c1a1 100644 --- a/etc/config.dist.php +++ b/etc/config.dist.php @@ -238,11 +238,6 @@ // operated on the same host //$instanceIdentifier = 'SWITCHwayf'; -// Name of the federation [deprecated] -// This value is not used anymore in the standard code. -// Please ensure it is not used anymore in templates -//$federationName = 'myFederation'; - // URL to send user to when clicking on federation logo // Insert %s as macro to be substituted by the language (e.g. 'en', 'de', 'fr', ...) the WAYF uses // Set to an empty string to hide the logo @@ -284,6 +279,10 @@ // Set to an empty string to hide the logo //$privacyURL = 'http://www.example.org/%s/myFed/privacy/'; +// Additional strings form custom templates +//$customStrings = array( +// federationName = 'myFederation' +//); // Development mode settings diff --git a/lib/functions.php b/lib/functions.php index 1b151b64650d8b8e9d466916672d7db57d6dd374..77e58aa1c426717039f4d732a5789ca6ce49925b 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -45,6 +45,7 @@ function initConfigOptions(){ global $logoURL; global $smallLogoURL; global $organizationLogoURL; + global $customStrings; global $IDPConfigFile; global $backupIDPConfigFile; global $metadataFile; @@ -101,6 +102,7 @@ function initConfigOptions(){ $defaults['WAYFLogFile'] = '/var/log/apache2/wayf.log'; $defaults['kerberosRedirectURL'] = dirname($_SERVER['SCRIPT_NAME']).'kerberosRedirect.php'; $defaults['developmentMode'] = false; + $defaults['customStrings'] = array(); // Initialize independent defaults foreach($defaults as $key => $value){ diff --git a/lib/templates.php b/lib/templates.php index 4cefcd0947c587bc17ba2ca4542a32a339a741db..f6a6523ae0dad5522385d0bdaa9f3c7cb305cfab 100644 --- a/lib/templates.php +++ b/lib/templates.php @@ -19,6 +19,7 @@ function printHeader(){ global $langStrings, $language, $imageURL, $javascriptURL, $cssURL, $logoURL; global $useImprovedDropDownList, $disableRemoteLogos, $organizationLogoURL; global $federationURL, $organizationURL, $faqURL, $helpURL, $privacyURL; + global $customStrings; // Check if custom header template exists if(file_exists('custom-header.php')){ @@ -35,6 +36,7 @@ function printHeader(){ function printWAYF(){ global $selectedIDP, $language, $IDProviders, $SProviders, $redirectCookieName, $imageURL, $redirectStateCookieName, $showPermanentSetting; + global $customStrings; if (!isset($showPermanentSetting)){ $showPermanentSetting = false; @@ -99,6 +101,7 @@ function printWAYF(){ function printSettings(){ global $selectedIDP, $language, $IDProviders, $redirectCookieName; + global $customStrings; $actionURL = $_SERVER['SCRIPT_NAME'].'?'.htmlentities($_SERVER['QUERY_STRING']); $defaultSelected = ($selectedIDP == '-') ? 'selected="selected"' : ''; @@ -238,6 +241,7 @@ function printOptionElement($IDProviders, $key, $selectedIDP){ function printNotice(){ global $redirectCookieName, $IDProviders; + global $customStrings; $actionURL = $_SERVER['SCRIPT_NAME'].'?'.htmlentities($_SERVER['QUERY_STRING']); @@ -280,6 +284,8 @@ function printNotice(){ // Prints end of HTML page function printFooter(){ + global $customStrings; + // Check if footer template exists if(file_exists('custom-footer.php')){ include('custom-footer.php'); @@ -294,6 +300,7 @@ function printFooter(){ function printError($message){ global $langStrings, $language, $supportContactEmail; + global $customStrings; // Show Header printHeader(); @@ -316,6 +323,7 @@ function printEmbeddedWAYFScript(){ global $langStrings, $language, $imageURL, $javascriptURL, $cssURL, $logoURL, $smallLogoURL, $federationURL; global $selectedIDP, $IDProviders, $SAMLDomainCookieName, $redirectCookieName, $redirectStateCookieName, $federationName; + global $customStrings; // Set values that are used in the java script $loginWithString = getLocalString('login_with'); @@ -410,6 +418,7 @@ ENTRY; // Print sample configuration script used for Embedded WAYF function printEmbeddedConfigurationScript(){ global $IDProviders; + global $customStrings; $types = array(); foreach ($IDProviders as $IDProvider){