Commit f54284cd authored by Lukas Haemmerle's avatar Lukas Haemmerle

Merge branch 'master+custom_strings' into 'master'

allow custom strings in configuration

See merge request !3
parents ba277898 22de4b8c
...@@ -238,11 +238,6 @@ ...@@ -238,11 +238,6 @@
// operated on the same host // operated on the same host
//$instanceIdentifier = 'SWITCHwayf'; //$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 // 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 // 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 // Set to an empty string to hide the logo
...@@ -284,6 +279,10 @@ ...@@ -284,6 +279,10 @@
// Set to an empty string to hide the logo // Set to an empty string to hide the logo
//$privacyURL = 'http://www.example.org/%s/myFed/privacy/'; //$privacyURL = 'http://www.example.org/%s/myFed/privacy/';
// Additional strings form custom templates
//$customStrings = array(
// federationName = 'myFederation'
//);
// Development mode settings // Development mode settings
......
...@@ -45,6 +45,7 @@ function initConfigOptions(){ ...@@ -45,6 +45,7 @@ function initConfigOptions(){
global $logoURL; global $logoURL;
global $smallLogoURL; global $smallLogoURL;
global $organizationLogoURL; global $organizationLogoURL;
global $customStrings;
global $IDPConfigFile; global $IDPConfigFile;
global $backupIDPConfigFile; global $backupIDPConfigFile;
global $metadataFile; global $metadataFile;
...@@ -101,6 +102,7 @@ function initConfigOptions(){ ...@@ -101,6 +102,7 @@ function initConfigOptions(){
$defaults['WAYFLogFile'] = '/var/log/apache2/wayf.log'; $defaults['WAYFLogFile'] = '/var/log/apache2/wayf.log';
$defaults['kerberosRedirectURL'] = dirname($_SERVER['SCRIPT_NAME']).'kerberosRedirect.php'; $defaults['kerberosRedirectURL'] = dirname($_SERVER['SCRIPT_NAME']).'kerberosRedirect.php';
$defaults['developmentMode'] = false; $defaults['developmentMode'] = false;
$defaults['customStrings'] = array();
// Initialize independent defaults // Initialize independent defaults
foreach($defaults as $key => $value){ foreach($defaults as $key => $value){
......
...@@ -19,6 +19,7 @@ function printHeader(){ ...@@ -19,6 +19,7 @@ function printHeader(){
global $langStrings, $language, $imageURL, $javascriptURL, $cssURL, $logoURL; global $langStrings, $language, $imageURL, $javascriptURL, $cssURL, $logoURL;
global $useImprovedDropDownList, $disableRemoteLogos, $organizationLogoURL; global $useImprovedDropDownList, $disableRemoteLogos, $organizationLogoURL;
global $federationURL, $organizationURL, $faqURL, $helpURL, $privacyURL; global $federationURL, $organizationURL, $faqURL, $helpURL, $privacyURL;
global $customStrings;
// Check if custom header template exists // Check if custom header template exists
if(file_exists('custom-header.php')){ if(file_exists('custom-header.php')){
...@@ -35,6 +36,7 @@ function printHeader(){ ...@@ -35,6 +36,7 @@ function printHeader(){
function printWAYF(){ function printWAYF(){
global $selectedIDP, $language, $IDProviders, $SProviders, $redirectCookieName, $imageURL, $redirectStateCookieName, $showPermanentSetting; global $selectedIDP, $language, $IDProviders, $SProviders, $redirectCookieName, $imageURL, $redirectStateCookieName, $showPermanentSetting;
global $customStrings;
if (!isset($showPermanentSetting)){ if (!isset($showPermanentSetting)){
$showPermanentSetting = false; $showPermanentSetting = false;
...@@ -99,6 +101,7 @@ function printWAYF(){ ...@@ -99,6 +101,7 @@ function printWAYF(){
function printSettings(){ function printSettings(){
global $selectedIDP, $language, $IDProviders, $redirectCookieName; global $selectedIDP, $language, $IDProviders, $redirectCookieName;
global $customStrings;
$actionURL = $_SERVER['SCRIPT_NAME'].'?'.htmlentities($_SERVER['QUERY_STRING']); $actionURL = $_SERVER['SCRIPT_NAME'].'?'.htmlentities($_SERVER['QUERY_STRING']);
$defaultSelected = ($selectedIDP == '-') ? 'selected="selected"' : ''; $defaultSelected = ($selectedIDP == '-') ? 'selected="selected"' : '';
...@@ -238,6 +241,7 @@ function printOptionElement($IDProviders, $key, $selectedIDP){ ...@@ -238,6 +241,7 @@ function printOptionElement($IDProviders, $key, $selectedIDP){
function printNotice(){ function printNotice(){
global $redirectCookieName, $IDProviders; global $redirectCookieName, $IDProviders;
global $customStrings;
$actionURL = $_SERVER['SCRIPT_NAME'].'?'.htmlentities($_SERVER['QUERY_STRING']); $actionURL = $_SERVER['SCRIPT_NAME'].'?'.htmlentities($_SERVER['QUERY_STRING']);
...@@ -280,6 +284,8 @@ function printNotice(){ ...@@ -280,6 +284,8 @@ function printNotice(){
// Prints end of HTML page // Prints end of HTML page
function printFooter(){ function printFooter(){
global $customStrings;
// Check if footer template exists // Check if footer template exists
if(file_exists('custom-footer.php')){ if(file_exists('custom-footer.php')){
include('custom-footer.php'); include('custom-footer.php');
...@@ -294,6 +300,7 @@ function printFooter(){ ...@@ -294,6 +300,7 @@ function printFooter(){
function printError($message){ function printError($message){
global $langStrings, $language, $supportContactEmail; global $langStrings, $language, $supportContactEmail;
global $customStrings;
// Show Header // Show Header
printHeader(); printHeader();
...@@ -316,6 +323,7 @@ function printEmbeddedWAYFScript(){ ...@@ -316,6 +323,7 @@ function printEmbeddedWAYFScript(){
global $langStrings, $language, $imageURL, $javascriptURL, $cssURL, $logoURL, $smallLogoURL, $federationURL; global $langStrings, $language, $imageURL, $javascriptURL, $cssURL, $logoURL, $smallLogoURL, $federationURL;
global $selectedIDP, $IDProviders, $SAMLDomainCookieName, $redirectCookieName, $redirectStateCookieName, $federationName; global $selectedIDP, $IDProviders, $SAMLDomainCookieName, $redirectCookieName, $redirectStateCookieName, $federationName;
global $customStrings;
// Set values that are used in the java script // Set values that are used in the java script
$loginWithString = getLocalString('login_with'); $loginWithString = getLocalString('login_with');
...@@ -410,6 +418,7 @@ ENTRY; ...@@ -410,6 +418,7 @@ ENTRY;
// Print sample configuration script used for Embedded WAYF // Print sample configuration script used for Embedded WAYF
function printEmbeddedConfigurationScript(){ function printEmbeddedConfigurationScript(){
global $IDProviders; global $IDProviders;
global $customStrings;
$types = array(); $types = array();
foreach ($IDProviders as $IDProvider){ foreach ($IDProviders as $IDProvider){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment