change _redirect suffi to _url, add new public api lassospkit_configure_url
This commit is contained in:
parent
cf5c82d67f
commit
0daab03bd6
|
@ -19,6 +19,8 @@ require_once('lassospkit_config.inc.php');
|
|||
/** Build an url for redirecting to one of the Liberty endpoints,
|
||||
use $endpoint as the endpoint name, $return_url as the destrination url
|
||||
after Liberty transaction, and params as key-value dictionarry for generating other params. */
|
||||
|
||||
|
||||
function _lassospkit_make_redirect_url($endpoint, $return_url, $params) {
|
||||
// Endpoints base
|
||||
$redirect = LassoSPKitConfig::get('baseUrl');
|
||||
|
@ -78,7 +80,7 @@ function lassospkit_set_federation($federation) {
|
|||
/* Return the URL where to redirect a user when liberty authentification
|
||||
* is required for existing federation or to get a transient one.
|
||||
*/
|
||||
function lassospkit_login_redirect($return_url, $persistent = TRUE) {
|
||||
function lassospkit_login_url($return_url, $persistent = TRUE) {
|
||||
if ($persistent) {
|
||||
$params = array( 'persistent' => 1 );
|
||||
} else {
|
||||
|
@ -91,7 +93,7 @@ function lassospkit_login_redirect($return_url, $persistent = TRUE) {
|
|||
* get an existing one.
|
||||
* Eventually pass a username to auto-store the new federation.
|
||||
*/
|
||||
function lassospkit_federate_redirect($return_url) {
|
||||
function lassospkit_federate_url($return_url) {
|
||||
return _lassospkit_make_redirect_url('federate',$return_url, array());
|
||||
}
|
||||
|
||||
|
@ -103,10 +105,19 @@ function lassospkit_set_userid($userid) {
|
|||
}
|
||||
|
||||
/* Return the URL where to redirect a user to initiated defederation of the current nameid. */
|
||||
function lassospkit_defederation_redirect($return_url) {
|
||||
function lassospkit_defederation_url($return_url) {
|
||||
return _lassospkit_make_redirect_url('defederate',$return_url, array());
|
||||
}
|
||||
|
||||
function lassospkit_logout_redirect($return_url) {
|
||||
function lassospkit_logout_url($return_url) {
|
||||
return _lassospkit_make_redirect_url('slo',$return_url, array());
|
||||
}
|
||||
|
||||
function lassospkit_configure_url() {
|
||||
$url = LassoSPKitConfig::get('baseUrl') . '/configure';
|
||||
// saml2 or liberty
|
||||
if (LassoSPKitConfig::get('showExtension')) {
|
||||
$url = $url . '.php';
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
|
Reference in New Issue