Ignore:
Timestamp:
May 2, 2016, 12:09:23 PM (3 years ago)
Author:
jrpelegrina
Message:

Updated to moodle 3.0.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • moodle/trunk/fuentes/auth/shibboleth/logout.php

    r136 r1331  
    99require_once($CFG->dirroot."/auth/shibboleth/auth.php");
    1010
     11$action = optional_param('action', '', PARAM_ALPHA);
     12$redirect = optional_param('return', '', PARAM_URL);
    1113
    1214// Find out whether host supports https
     
    1618}
    1719
    18 // Front channel logout
    19 if (
    20         isset($_GET['return'])
    21         && isset($_GET['action'])
    22         && $_GET['action'] == 'logout'
    23    ){
    24 
    25     // Logout out user from application
    26     // E.g. destroy application session/cookie etc
    27     require_logout();
    28 
    29     // Finally, send user to the return URL
    30     redirect($_GET['return']);
    31 }
    32 
    33 // Back channel logout
    34 elseif (!empty($HTTP_RAW_POST_DATA)) {
    35 
    36     // Requires PHP 5
    37 
    38 
    39     // Set SOAP header
     20// If the shibboleth plugin is not enable, throw an exception.
     21if (!is_enabled_auth('shibboleth')) {
     22    throw new moodle_exception(get_string('pluginnotenabled', 'auth', 'shibboleth'));
     23}
     24
     25// Front channel logout.
     26if ($action == 'logout' && !empty($redirect)) {
     27
     28    if ($USER->auth == 'shibboleth') {
     29        // Logout out user from application.
     30        require_logout();
     31         // Finally, send user to the return URL.
     32        redirect($redirect);
     33    }
     34
     35} else if (!file_get_contents("php://input")) {
     36
     37    // Back channel logout.
     38    // Set SOAP header.
    4039    $server = new SoapServer($protocol.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'/LogoutNotification.wsdl');
    41 
    42 
    4340    $server->addFunction("LogoutNotification");
    4441    $server->handle();
    45 }
    46 
    47 // Return WSDL
    48 else {
    49 
     42
     43} else {
     44
     45    // Return WSDL.
    5046    header('Content-Type: text/xml');
    5147
     
    120116WSDL;
    121117    exit;
    122 
    123 }
    124 
     118}
    125119/******************************************************************************/
    126120
Note: See TracChangeset for help on using the changeset viewer.