Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
🚀
This server has been upgraded to GitLab release
15.7
.
🚀
Open sidebar
GIP RENATER
switch-wayf
Commits
af8208ed
Commit
af8208ed
authored
Jul 02, 2010
by
haemmer
Browse files
Renamed favourite_idp setting to most-used favourite_idp setting on suggestion of UniBE
parent
d7008980
Changes
5
Hide whitespace changes
Inline
Side-by-side
README
View file @
af8208ed
...
...
@@ -2,7 +2,7 @@ SWITCH WAYF
-------------------------------------------------------------------------------
Copyright 2010 SWITCH - Serving Swiss Universities
Contact: aai@switch.ch or go to http://www.switch.ch/aai/wayf
Version: See head of file 'WAYF' in the same directory
-------------------------------------------------------------------------------
Description:
...
...
@@ -64,7 +64,20 @@ or for PHP5
</Location>
--
If you use Apache 1.3, you may have to rename the file 'WAYF' to 'WAYF.php' or
In some clustered environments with FastCGI it may be necessary to use something
like
--
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^WAYF/(.*)$ WAYF.php/$1 [QSA,L]
RewriteRule ^WAYF$ WAYF.php [QSA,L]
</IfModule>
--
You also could rename the file 'WAYF' to 'WAYF.php' or
make a directory called 'WAYF', rename WAYF to 'index.php' and put it in that
directory.
...
...
@@ -243,9 +256,15 @@ flexible when it comes to ordering the category and IdP entries.
Changes:
1.13 - Added Favourite IdPs to Embedded WAYF
1.12.3 - Fixed an error in function appendValueToIdPArray
- Fixed Remember Selection preference
1.12.2 - Fixed a XSS security vulnerability
- Fixed an error in function appendValueToIdPArray
Thanks to Martins Purins from Latvijas Universitates for reporting this
1.12.2 - Fixed inconsistency in default Embedded WAYF snippet
- Improved description for setting PHP handler on WAYF script.
- Removed newly introduced PHP short tag in default-body.php
- Fixed inconsistency in default Embedded WAYF snippet
Thanks to Huân Thebault from Centre de Calcul de l'IN2P3 for
reporting most of the above issues
1.12.1 - Fixed a bug in the the getToplevelDomain function.
Thanks to Olivier Salaün.
1.12 - Added code contributions from CRU. Thanks to Olivier Salaün and co.
...
...
default-body.php
View file @
af8208ed
...
...
@@ -13,9 +13,9 @@
<input
type=
"submit"
name=
"Select"
accesskey=
"s"
tabindex=
"10"
value=
"
<?php
echo
getLocalString
(
'select_button'
)
?>
"
>
</p>
<p>
<input
tabindex=
"8"
type=
"checkbox"
<?php
$rememberSelectionChecked
?>
name=
"session"
value=
"true"
>
<input
tabindex=
"8"
type=
"checkbox"
<?php
echo
$rememberSelectionChecked
?>
name=
"session"
value=
"true"
>
<span
class=
"warning"
>
<?php
echo
getLocalString
(
'remember_selection'
)
?>
</span><br>
<?
if
(
$showPermanentSetting
)
:
?>
<?
php
if
(
$showPermanentSetting
)
:
?>
<!-- Value permanent must be a number which is equivalent to the days the cookie shall be valid -->
<input
type=
"checkbox"
tabindex=
"9"
name=
"permanent"
value=
"100"
>
<span
class=
"warning"
>
<?php
echo
getLocalString
(
'permanently_remember_selection'
)
?>
</span>
...
...
default-embedded-wayf.php
View file @
af8208ed
...
...
@@ -82,10 +82,10 @@ var wayf_hide_after_login = true;
var
wayf_show_categories
=
true
;
//
Favourite
Identity Providers will be shown as top category in the drop down
//
Most used
Identity Providers will be shown as top category in the drop down
// list if this feature is used.
// [Optional, commented out by default]
// var wayf_
favourite
_idps = new Array("urn:mace:switch.ch:SWITCHaai:unibas.ch", "https://aai.unil.ch/idp/shibboleth");
// var wayf_
most_used
_idps = new Array("urn:mace:switch.ch:SWITCHaai:unibas.ch", "https://aai.unil.ch/idp/shibboleth");
// Categories of Identity Provider that shall not be shown
...
...
functions.php
View file @
af8208ed
...
...
@@ -82,13 +82,14 @@ function checkIDP($IDP, $showError = true){
}
elseif
(
!
$showError
){
return
false
;
}
else
{
$message
=
sprintf
(
getLocalString
(
'invalid_user_idp'
),
$IDP
)
.
"</p><p>
\n
<tt>"
;
$message
=
sprintf
(
getLocalString
(
'invalid_user_idp'
),
htmlentities
(
$IDP
)
)
.
"</p><p>
\n
<tt>"
;
foreach
(
$IDProviders
as
$key
=>
$value
){
if
(
isset
(
$value
[
'SSO'
])){
$message
.
=
$key
.
"<br>
\n
"
;
}
}
$message
.
=
"</tt>
\n
"
;
printError
(
$message
);
exit
;
}
...
...
templates.php
View file @
af8208ed
...
...
@@ -223,7 +223,7 @@ function printEmbeddedWAYFScript(){
$loginString
=
addslashes
(
getLocalString
(
'login'
));
$selectIdPString
=
addslashes
(
getLocalString
(
'select_idp'
));
$otherFederationString
=
addslashes
(
getLocalString
(
'other_federation'
));
$
favourite
sString
=
addslashes
(
getLocalString
(
'
favourites
'
));
$
mostUsedIdP
sString
=
addslashes
(
getLocalString
(
'
most_used
'
));
echo
<<<SCRIPT
...
...
@@ -252,7 +252,7 @@ var wayf_hide_logo;
var wayf_auto_login;
var wayf_logged_in_messsage;
var wayf_hide_after_login;
var wayf_
favourite
_idps;
var wayf_
most_used
_idps;
var wayf_show_categories;
var wayf_hide_categories;
var wayf_hide_idps;
...
...
@@ -651,10 +651,10 @@ function decodeBase64(input) {
}
if(
typeof(wayf_
favourite
_idps) == "undefined"
|| typeof(wayf_
favourite
_idps) != "object"
typeof(wayf_
most_used
_idps) == "undefined"
|| typeof(wayf_
most_used
_idps) != "object"
){
wayf_
favourite
_idps = new Array();
wayf_
most_used
_idps = new Array();
}
if(
...
...
@@ -845,13 +845,13 @@ SCRIPT;
// Favourites
if (wayf_
favourite
_idps.length > 0){
writeHTML('<optgroup label="{$
favourite
sString}">');
if (wayf_
most_used
_idps.length > 0){
writeHTML('<optgroup label="{$
mostUsedIdP
sString}">');
// Show additional IdPs in the order they are defined
for ( var i=0; i < wayf_
favourite
_idps.length; i++){
if (wayf_idps[wayf_
favourite
_idps[i]]){
writeHTML('<option value="' + wayf_
favourite
_idps[i] + '">' + wayf_idps[wayf_
favourite
_idps[i]].name + '</option>');
for ( var i=0; i < wayf_
most_used
_idps.length; i++){
if (wayf_idps[wayf_
most_used
_idps[i]]){
writeHTML('<option value="' + wayf_
most_used
_idps[i] + '">' + wayf_idps[wayf_
most_used
_idps[i]].name + '</option>');
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment