]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trail...
authorPetr Skoda <skodak@moodle.org>
Sun, 1 Nov 2009 11:55:14 +0000 (11:55 +0000)
committerPetr Skoda <skodak@moodle.org>
Sun, 1 Nov 2009 11:55:14 +0000 (11:55 +0000)
34 files changed:
auth/README.txt
auth/cas/auth.php
auth/cas/cas_ldap_sync_users.php
auth/cas/config.html
auth/cas/languages.php
auth/db/auth.php
auth/db/auth_db_sync_users.php
auth/email/auth.php
auth/email/config.html
auth/fc/auth.php
auth/imap/auth.php
auth/ldap/auth.php
auth/ldap/auth_ldap_sync_users.php
auth/ldap/config.html
auth/ldap/ntlmsso_finish.php
auth/ldap/ntlmsso_magic.php
auth/manual/auth.php
auth/mnet/auth.php
auth/mnet/jump.php
auth/mnet/land.php
auth/nntp/auth.php
auth/nologin/auth.php
auth/none/auth.php
auth/pam/auth.php
auth/pop3/auth.php
auth/radius/auth.php
auth/shibboleth/README.txt
auth/shibboleth/auth.php
auth/shibboleth/config.html
auth/shibboleth/index.php
auth/shibboleth/index_form.html
auth/shibboleth/login.php
auth/shibboleth/logout.php
auth/webservice/auth.php

index 7597615f0645b4d2d1e9bfb33b3ece603545a721..48337b4e7f44abde97338de13da8f8e4709eac71 100644 (file)
@@ -120,7 +120,7 @@ They contain the same functions that were previously in each plugin's lib.php fi
 but refactored to become class methods, and tweaked to reference the plugin's instantiated
 config to get at the settings, rather than the global $CFG variable.
 
-When creating new plugins you can either extend the abstract auth_plugin_base class 
+When creating new plugins you can either extend the abstract auth_plugin_base class
 (defined in lib/authlib.php) or create a new one and implement all methods from
 auth_plugin_base.
 
index 0ecb2053873de1ed22c2481c1ed4bb8412f9037b..d9ec82969f6c399d9ca7f092168fc8d32ff25a52 100644 (file)
@@ -122,7 +122,7 @@ class auth_plugin_cas extends auth_plugin_base {
                        $frm->password="guest";
                        return;
          }             
-        
+       
      if ($this->config->multiauth) {
           $authCAS = optional_param("authCAS", '', PARAM_RAW);
           if ($authCAS=="NOCAS")
@@ -443,7 +443,7 @@ if ( !is_object($PHPCAS_CLIENT) ) {
      */
     function ldap_connect($binddn='',$bindpwd='') {
         // Cache ldap connections (they are expensive to set up
-        // and can drain the TCP/IP ressources on the server if we 
+        // and can drain the TCP/IP ressources on the server if we
         // are syncing a lot of users (as we try to open a new connection
         // to get the user details). This is the least invasive way
         // to reuse existing connections without greater code surgery.
@@ -488,7 +488,7 @@ if ( !is_object($PHPCAS_CLIENT) ) {
             if ($bindresult) {
                 // Set the connection counter so we can call PHP's ldap_close()
                 // when we call $this->ldap_close() for the last 'open' connection.
-                $this->ldapconns = 1;  
+                $this->ldapconns = 1;
                 $this->ldapconnection = $connresult;
                 return $connresult;
             }
@@ -695,7 +695,7 @@ if ( !is_object($PHPCAS_CLIENT) ) {
         // find users in DB that aren't in ldap -- to be removed!
         // this is still not as scalable (but how often do we mass delete?)
         if (!empty($this->config->removeuser)) {
-            $sql = "SELECT u.id, u.username, u.email, u.auth 
+            $sql = "SELECT u.id, u.username, u.email, u.auth
                       FROM {user} u
                       LEFT JOIN {tmp_extuser} e ON (u.username = e.username AND u.mnethostid = ?)
                      WHERE u.auth='cas'
@@ -1139,4 +1139,4 @@ if (!empty($this->config->attrcreators)) {
         return $text;
     }
 }
-?>
+
index 15454bc7c21d334ed920ca9d80e052f56e53387c..2c16f13bda5d3ec95242e200eb273a451d4e8f47 100644 (file)
@@ -44,4 +44,3 @@ if (!is_enabled_auth('cas')) {
 $casauth = get_auth_plugin('cas');
 $casauth->sync_users(true);
 
-?>
\ No newline at end of file
index a4ceb20212b4be03adf283061ccb367d5e48c674..1bb2fe8d1f7e8909f47f21e1dc76084398a67d6c 100644 (file)
 
     // set to defaults if undefined (CAS)
 
-    if (!isset ($config->hostname)) 
+    if (!isset ($config->hostname))
 
         $config->hostname = '';
 
-    if (!isset ($config->port)) 
+    if (!isset ($config->port))
 
         $config->port = '';
 
-    if (!isset ($config->casversion)) 
+    if (!isset ($config->casversion))
 
         $config->casversion = '';
 
-    if (!isset ($config->baseuri)) 
+    if (!isset ($config->baseuri))
 
         $config->baseuri = '';
 
-    if (!isset ($config->language)) 
+    if (!isset ($config->language))
 
         $config->language = '';
 
-    if (!isset ($config->proxycas)) 
+    if (!isset ($config->proxycas))
 
         $config->proxycas = '';
 
-    if (!isset ($config->logoutcas)) 
+    if (!isset ($config->logoutcas))
 
         $config->logoutcas = '';
 
index 9edb8e768ed3f7024d8b1d7e08ff00a6b7944315..88007856fdd4ee45a3ec5f227b13861bb9775b89 100644 (file)
@@ -1,7 +1,5 @@
 <?PHP
 
-// version $Id$
-
 // List of CAS langages.
 
 // You can add langages in /CAS/langage.
@@ -13,5 +11,3 @@ $CASLANGUAGES = array (
 "english" => "English",
 
 "french" => "French");
-
-?>
index b23b65ce32efd233c86ca34879535a23cfe4a691..4cc1865ba44b4b5fa9c25f607d04e63705c3c60d 100644 (file)
@@ -702,4 +702,4 @@ class auth_plugin_db extends auth_plugin_base {
     }
 }
 
-?>
+
index d6eb5e7c71486979b4490b3efd5aefd40f02bce8..fe476a5b85868c1efa575d4bd96727401f0aab9d 100644 (file)
@@ -43,4 +43,3 @@ if (!is_enabled_auth('db')) {
 $dbauth = get_auth_plugin('db');
 $dbauth->sync_users(true);
 
-?>
\ No newline at end of file
index 01304c8611590f107f46d415e471e3c1c7b065a5..5b709d2cc89bb666498277d7fe32c149be6fdb7f 100644 (file)
@@ -76,13 +76,13 @@ class auth_plugin_email extends auth_plugin_base {
     function user_signup($user, $notify=true) {
         global $CFG, $DB;
         require_once($CFG->dirroot.'/user/profile/lib.php');
-        
+
         $user->password = hash_internal_user_password($user->password);
 
         if (! ($user->id = $DB->insert_record('user', $user)) ) {
             print_error('auth_emailnoinsert','auth_email');
         }
-        
+
         /// Save any custom profile field information
         profile_save_data($user);
 
@@ -201,15 +201,15 @@ class auth_plugin_email extends auth_plugin_base {
      */
     function process_config($config) {
         // set to defaults if undefined
-        if (!isset($config->recaptcha)) { 
-            $config->recaptcha = false; 
+        if (!isset($config->recaptcha)) {
+            $config->recaptcha = false;
         }
-        
+
         // save settings
         set_config('recaptcha', $config->recaptcha, 'auth/email');
         return true;
     }
-    
+
     /**
      * Returns whether or not the captcha element is enabled, and the admin settings fulfil its requirements.
      * @return bool
@@ -221,4 +221,4 @@ class auth_plugin_email extends auth_plugin_base {
 
 }
 
-?>
+
index 7ef72f6435f8bcab89d8765c1b28e21a81ed534d..b7a558d9c1e241da692ae9d25b096f7a719dc1ec 100644 (file)
@@ -22,7 +22,7 @@
         echo $OUTPUT->select(html_select::make($yesno, 'recaptcha', $config->recaptcha, false));
         ?></td>
     <td><?php print_string('auth_emailrecaptcha', 'auth_email') ?></td>
-</tr>    
+</tr>
 <?php
 
 print_auth_lock_options('email', $user_fields, get_string('auth_fieldlocks_help', 'auth'), false, false);
index 9ef341b3521176d814c43ab1af9f22c147c33567..51035232e1f2d4acd4629a05bbae7e7a84555196 100644 (file)
@@ -236,4 +236,4 @@ class auth_plugin_fc extends auth_plugin_base {
 
 }
 
-?>
+
index a8ed884cc96a8adb3d80f8427b3d422ee8eb45c3..e8028c3054d4a887bd159cb037299950d3bb37a1 100644 (file)
@@ -151,4 +151,4 @@ class auth_plugin_imap extends auth_plugin_base {
 
 }
 
-?>
+
index 2bcf07ad582d43a372e8b773113d1334bd37d204..bc65003facc00207a3ca313b1d51d5208913084f 100644 (file)
@@ -628,7 +628,7 @@ class auth_plugin_ldap extends auth_plugin_base {
         // find users in DB that aren't in ldap -- to be removed!
         // this is still not as scalable (but how often do we mass delete?)
         if (!empty($this->config->removeuser)) {
-            $sql = "SELECT u.id, u.username, u.email, u.auth 
+            $sql = "SELECT u.id, u.username, u.email, u.auth
                       FROM {user} u
                       LEFT JOIN {tmp_extuser} e ON (u.username = e.username AND u.mnethostid = ?)
                      WHERE u.auth='ldap'
@@ -1518,7 +1518,7 @@ class auth_plugin_ldap extends auth_plugin_base {
      */
     function ldap_connect($binddn='',$bindpwd='') {
         // Cache ldap connections (they are expensive to set up
-        // and can drain the TCP/IP ressources on the server if we 
+        // and can drain the TCP/IP ressources on the server if we
         // are syncing a lot of users (as we try to open a new connection
         // to get the user details). This is the least invasive way
         // to reuse existing connections without greater code surgery.
@@ -1575,7 +1575,7 @@ class auth_plugin_ldap extends auth_plugin_base {
             if ($bindresult) {
                // Set the connection counter so we can call PHP's ldap_close()
                // when we call $this->ldap_close() for the last 'open' connection.
-                $this->ldapconns = 1;  
+                $this->ldapconns = 1;
                 $this->ldapconnection = $connresult;
                 return $connresult;
             }
@@ -1799,7 +1799,7 @@ class auth_plugin_ldap extends auth_plugin_base {
 
         // HTTPS is potentially required
         httpsrequired();
+
         if (($_SERVER['REQUEST_METHOD'] === 'GET'         // Only on initial GET of loginpage
                 || ($_SERVER['REQUEST_METHOD'] === 'POST'
                    && (get_referer() != strip_querystring(qualified_me()))))
@@ -1834,7 +1834,7 @@ class auth_plugin_ldap extends auth_plugin_base {
                 redirect($CFG->wwwroot.'/auth/ldap/ntlmsso_attempt.php');
             }
         }
+
         // No NTLM SSO, Use the normal login page instead.
 
         // If $SESSION->wantsurl is empty and we have a 'Referer:' header, the login
@@ -1852,9 +1852,9 @@ class auth_plugin_ldap extends auth_plugin_base {
 
     /**
      * To be called from a page running under NTLM's
-     * "Integrated Windows Authentication". 
+     * "Integrated Windows Authentication".
      *
-     * If successful, it will set a special "cookie" (not an HTTP cookie!) 
+     * If successful, it will set a special "cookie" (not an HTTP cookie!)
      * in cache_flags under the "auth/ldap/ntlmsess" "plugin" and return true.
      * The "cookie" will be picked up by ntlmsso_finish() to complete the
      * process.
@@ -1862,7 +1862,7 @@ class auth_plugin_ldap extends auth_plugin_base {
      * On failure it will return false for the caller to display an appropriate
      * error message (probably saying that Integrated Windows Auth isn't enabled!)
      *
-     * NOTE that this code will execute under the OS user credentials, 
+     * NOTE that this code will execute under the OS user credentials,
      * so we MUST avoid dealing with files -- such as session files.
      * (The caller should define('NO_MOODLE_COOKIES', true) before including config.php)
      *
@@ -1886,13 +1886,13 @@ class auth_plugin_ldap extends auth_plugin_base {
     }
 
     /**
-     * Find the session set by ntlmsso_magic(), validate it and 
+     * Find the session set by ntlmsso_magic(), validate it and
      * call authenticate_user_login() to authenticate the user through
      * the auth machinery.
-     * 
+     *
      * It is complemented by a similar check in user_login().
-     * 
-     * If it succeeds, it never returns. 
+     *
+     * If it succeeds, it never returns.
      *
      */
     function ntlmsso_finish() {
@@ -1932,7 +1932,7 @@ class auth_plugin_ldap extends auth_plugin_base {
         }
         // Should never reach here.
         return false;
-    }    
+    }
 
     /**
      * Sync roles for this user
@@ -2236,4 +2236,4 @@ class auth_plugin_ldap extends auth_plugin_base {
 
 }
 
-?>
+
index 22a38d50f7a18750e300e864a63eed3cab9d3ab6..45cbb8e404643466e7483a0df3b2ad78515fed9b 100755 (executable)
@@ -42,4 +42,4 @@ if (!is_enabled_auth('ldap')) {
 $ldapauth = get_auth_plugin('ldap');
 $ldapauth->sync_users(true);
 
-?>
+
index 4c6a8b22473fe88e7f6efac27f3c9dea13cef091..d00f7dd012d4170d0f386ef6342f63170cc3717e 100644 (file)
@@ -49,7 +49,7 @@
         {$config->forcechangepassword = 0; }
     if (!isset($config->stdchangepassword))
         {$config->stdchangepassword = 0; }
-    if (!isset($config->passtype)) 
+    if (!isset($config->passtype))
         {$config->passtype = 'plaintext';}
     if (!isset($config->changepasswordurl))
         {$config->changepasswordurl = ''; }
index 93e7455980ace102fa14cd24c3daa0d45daba35d..5e26b76c889c2b91cb1b914fecb25e1242065cfe 100644 (file)
@@ -31,6 +31,6 @@ if (!$authplugin->ntlmsso_finish()) {
     $PAGE->set_title("$site->fullname: $loginsite");
     $PAGE->set_heading($site->fullname);
     echo $OUTPUT->header();
-    redirect($CFG->httpswwwroot . '/login/index.php?authldap_skipntlmsso=1', 
+    redirect($CFG->httpswwwroot . '/login/index.php?authldap_skipntlmsso=1',
              get_string('ntlmsso_failed','auth_ldap'), 3);
 }
index 8636a913c3fb4dbd379f7fdf85f13eb9bc635992..e42cbeece1e51938ae4d62c54efaafc6d3d7b7b7 100644 (file)
@@ -24,14 +24,14 @@ if (empty($authplugin->config->ntlmsso_enabled)) {
 $sesskey = required_param('sesskey', PARAM_RAW);
 $file = $CFG->dirroot . '/pix/spacer.gif';
 
-if ($authplugin->ntlmsso_magic($sesskey) 
+if ($authplugin->ntlmsso_magic($sesskey)
     && file_exists($file)) {
 
     if (!empty($authplugin->config->ntlmsso_ie_fastpath)) {
         if (check_browser_version('MSIE')) {
             redirect($CFG->wwwroot . '/auth/ldap/ntlmsso_finish.php');
         }
-    } 
+    }
 
     // Serve GIF
     // Type
@@ -47,4 +47,4 @@ if ($authplugin->ntlmsso_magic($sesskey)
     print_error('ntlmsso_iwamagicnotenabled','auth_ldap');
 }
 
-?>
+
index cdc2225105322e67b0040a57edb3afc4f0c246ac..4010c8f9b620e9b6b205a23f084c62e3286db150 100644 (file)
@@ -121,10 +121,10 @@ class auth_plugin_manual extends auth_plugin_base {
 
    /**
      * Confirm the new user as registered. This should normally not be used,
-     * but it may be necessary if the user auth_method is changed to manual 
+     * but it may be necessary if the user auth_method is changed to manual
      * before the user is confirmed.
      */
-    function user_confirm($username, $confirmsecret = null) {      
+    function user_confirm($username, $confirmsecret = null) {
         global $DB;
 
         $user = get_complete_user_data('username', $username);
@@ -132,7 +132,7 @@ class auth_plugin_manual extends auth_plugin_base {
         if (!empty($user)) {
             if ($user->confirmed) {
                 return AUTH_CONFIRM_ALREADY;
-            } else { 
+            } else {
                 if (!$DB->set_field("user", "confirmed", 1, array("id"=>$user->id))) {
                     return AUTH_CONFIRM_FAIL;
                 }
@@ -148,4 +148,4 @@ class auth_plugin_manual extends auth_plugin_base {
 
 }
 
-?>
+
index 052fdf52046410ac9adb554da38065c1f690730d..c3a4f999ad78c1e6a7a362cbb847ee064e11fc7d 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 /**
  * @author Martin Dougiamas
@@ -874,7 +874,7 @@ class auth_plugin_mnet extends auth_plugin_base {
             unset($logEntryObj->username);
 
             $logEntryObj = $this->trim_logline($logEntryObj);
-            $insertok = $DB->insert_record('mnet_log', $logEntryObj, false);           
+            $insertok = $DB->insert_record('mnet_log', $logEntryObj, false);
 
             if ($insertok) {
                 $MNET_REMOTE_CLIENT->last_log_id = $logEntryObj->remoteid;
@@ -1349,5 +1349,3 @@ class auth_plugin_mnet extends auth_plugin_base {
 
 
 }
-
-?>
index 6a4f23cb8300343e569cc07d64eb8aa9309f22ff..f65a25c9385bb511cc05e8c1425209f53c05fcdb 100644 (file)
@@ -46,4 +46,4 @@ if (empty($url)) {
 }
 redirect($url);
 
-?>
+
index 96ba3e9acbc61dc46b0721ea0fd022bf7868fb62..e3ae0fe4c571ef0aba5b3b39ecf2973f0d8980a0 100644 (file)
@@ -49,4 +49,4 @@ if ($wantsremoteurl) {
 }
 redirect($CFG->wwwroot . $wantsurl);
 
-?>
+
index e24e1e37462706ebb4627c01d360185322bf7e51..36cdeb395ca4e4ba675dd49d256868c5a78ca5eb 100644 (file)
@@ -120,4 +120,4 @@ class auth_plugin_nntp extends auth_plugin_base {
 
 }
 
-?>
+
index 9107059367365a7a7eea42077fa91e067a49deb9..20794da7194004ee86011b3e51ed62f877a71104 100644 (file)
@@ -74,4 +74,4 @@ class auth_plugin_nologin extends auth_plugin_base {
 
 }
 
-?>
+
index 740d4dd1f57b8bda85570c57f4ebfc990f526f1b..e6022cdc38780f3ad6250583d7b56aea9a51e780 100644 (file)
@@ -121,4 +121,4 @@ class auth_plugin_none extends auth_plugin_base {
 
 }
 
-?>
+
index 428479a340c008ae73617a5e8baa30b2f9424edc..5bb65831a61e2ac1509ab743985eb399432fc78e 100644 (file)
@@ -117,4 +117,4 @@ class auth_plugin_pam extends auth_plugin_base {
 
 }
 
-?>
+
index 3e93d375f32ff30eb543c60658af0a2a3778e4eb..d4abd780e126a28b8122f9968e8fe0497f5ae8e6 100644 (file)
@@ -155,4 +155,4 @@ class auth_plugin_pop3 extends auth_plugin_base {
 
 }
 
-?>
+
index d84e2a956e733b993c0f554fbe90b7b8f85c1cd7..976432d968009d82e6d529cd8691740bf81b3799 100644 (file)
@@ -190,4 +190,4 @@ class auth_plugin_radius extends auth_plugin_base {
 
 }
 
-?>
+
index 1a39df422864c8f8fe8c46f8ec90380c30a548e8..038401b20aedbdd23a52fb722a32836639e0233a 100644 (file)
@@ -21,9 +21,9 @@ Changes:
             attributes on request of Markus Hagman
 - 11. 2007: Integrated WAYF Service in Moodle
 - 12. 2008: Shibboleth 2.x and Single Logout support added
-- 1.  2008: Added logout hook and moved Shibboleth config strings to utf8 auth 
+- 1.  2008: Added logout hook and moved Shibboleth config strings to utf8 auth
             language files.
-- 3.  2009: Added various improvements and bug fixes reported by Ina Müller from
+- 3.  2009: Added various improvements and bug fixes reported by Ina M�ller from
             university Tuebingen and Peter Ellis of University of Washington
 - 4.  2009: Added another requirement for logout regarding the call back script
 - 6.  2009: Changed handler URL when integrated Discovery Service is used
@@ -47,9 +47,9 @@ Moodle Configuration with Dual login
    with something that fits your needs, e.g. 'require affiliation student'.
 
    For IIS you have protect the auth/shibboleth directory directly in the
-   RequestMap of the Shibboleth configuration file (shibboleth.xml or 
-   shibboleth2.xml). 
-   
+   RequestMap of the Shibboleth configuration file (shibboleth.xml or
+   shibboleth2.xml).
+
 --
 <Path name="moodle" requireSession="false" >
    <Path name="auth/shibboleth/index.php" requireSession="true" >
@@ -57,14 +57,14 @@ Moodle Configuration with Dual login
           ...
       </AccessControl>
    </Path>
-</Path> 
+</Path>
 --
-   
+
    Also see:
    https://spaces.internet2.edu/display/SHIB2/NativeSPRequestMapper and
    https://spaces.internet2.edu/display/SHIB2/NativeSPAccessControl
 
-2. As Moodle admin, go to the 'Administrations >> Users >> Authentication' and 
+2. As Moodle admin, go to the 'Administrations >> Users >> Authentication' and
    click on the the 'Shibboleth' settings.
 
 3. Fill in the fields of the form. The fields 'Username', 'First name',
@@ -79,37 +79,37 @@ Moodle Configuration with Dual login
    #############################################################################
    Shibboleth Attributes needed by Moodle:
    For Moodle to work properly Shibboleth should at least provide the attribute
-   that is used as username in Moodle. It has to be unique for all Shibboleth 
+   that is used as username in Moodle. It has to be unique for all Shibboleth
    Be aware that Moodle converts the username to lowercase. So, the overall
    behaviour of the username will be case-insensitive.
-   All attributes used for moodle must obey a certain length, otherwise Moodle 
-   cuts off the ends. Consult the Moodle documentation for further information 
+   All attributes used for moodle must obey a certain length, otherwise Moodle
+   cuts off the ends. Consult the Moodle documentation for further information
    on the maximum lengths for each field in the user profile.
    #############################################################################
 
 4.a  If you want Shibboleth as your only authentication method with an external
-     Where Are You From (WAYF) Service , set the 'Alternate Login URL' in the 
-     'Common settings' in 'Administrations >> Users >> Authentication Options' 
-     to the the URL of the file 'moodle/auth/shibboleth/index.php'. 
+     Where Are You From (WAYF) Service , set the 'Alternate Login URL' in the
+     'Common settings' in 'Administrations >> Users >> Authentication Options'
+     to the the URL of the file 'moodle/auth/shibboleth/index.php'.
      This will enforce Shibboleth login.
 
 4.b If you want to use the Moodle integrated WAYF service, you have to activate it
-    in the Moodle Shibboleth authentication settings by checking the 
-    'Moodle WAYF Service' checkbox and providing a list of entity IDs in the 
-    'Identity Providers' textarea together with a name and an optional 
-    SessionInitiator URL, which usually is an absolute or relative URL pointing 
-    to the same host. If no SessionInitiator URL is given, the default one 
-    '/Shibboleth.sso' (only works for Shibboleth 1.3.x) will be used. For 
+    in the Moodle Shibboleth authentication settings by checking the
+    'Moodle WAYF Service' checkbox and providing a list of entity IDs in the
+    'Identity Providers' textarea together with a name and an optional
+    SessionInitiator URL, which usually is an absolute or relative URL pointing
+    to the same host. If no SessionInitiator URL is given, the default one
+    '/Shibboleth.sso' (only works for Shibboleth 1.3.x) will be used. For
     Shibboleth 2.x you have to add '/Shibboleth.sso/DS' as a SessionInitiator.
     Also see https://spaces.internet2.edu/display/SHIB/SessionInitiator
     and https://spaces.internet2.edu/display/SHIB2/NativeSPSessionInitiator
 
     Important Note: If you upgraded from a previous version of Moodle and now
                     want to use the integrated WAYF, you have to make sure that
-                    in step 1 only the index.php script in 
-                    moodle/auth/shibboleth/ is protected but *not* the other 
+                    in step 1 only the index.php script in
+                    moodle/auth/shibboleth/ is protected but *not* the other
                     scripts and especially not the login.php script.
-    
+
     If you were using the integrated WAYF alread with Shibboleth 1.3, it could
     be that the integrated WAYF is not working anymore after you updated Moodle.
     The reason is that the implicitly set default SessionInitiator changed in
@@ -120,12 +120,12 @@ Moodle Configuration with Dual login
 
 5.  Save the changes for the 'Shibboleth settings'.
 
-    Important Note: If you went for 4.b (integrated WAYF service), saving the 
+    Important Note: If you went for 4.b (integrated WAYF service), saving the
                     settings will overwrite the Moodle Alternate Login URL
                     using the Moodle web root URL.
 
 6.  If you want to use Shibboleth in addition to another authentication method
-    not using the integrated WAYF service from 4.b, change the 'Instructions' in 
+    not using the integrated WAYF service from 4.b, change the 'Instructions' in
     'Administrations >> Users >> Manage authentication' to contain a link to the
      moodle/auth/shibboleth/index.php file which is protected by
      Shibboleth (see step 1.) and causes the Shibboleth login procedure to start.
@@ -144,7 +144,7 @@ Shibboleth-protected page /auth/shibboleth/index.php. If Shibboleth is the only
 authentication method (see 4.a), this happens automatically when a user selects
 his home organization in the Moodle WAYF service or if the alternate login URL
 is configured to be the protected /auth/shibboleth/index.php
-Otherwise, the user has to click on the link on the dual login page you 
+Otherwise, the user has to click on the link on the dual login page you
 provided in step 5.b.
 
 Moodle basically checks whether the Shibboleth attribute that you mapped
@@ -169,11 +169,11 @@ authentication method unless they have two accounts in Moodle.
 Shibboleth dual login with custom login page
 --------------------------------------------------------------------------------
 You can create a dual login page that better fits your needs. For this
-to work, you have to set up the two authentication methods (e.g. 'Manual 
+to work, you have to set up the two authentication methods (e.g. 'Manual
 Accounts' and 'Shibboleth') and specify an alternate login link to your own dual
 login page. On that page you basically need a link to the Shibboleth-protected
 page ('/auth/shibboleth/index.php') for the Shibboleth login and a
-form that sends 'username' and 'password' to moodle/login/index.php. Set this 
+form that sends 'username' and 'password' to moodle/login/index.php. Set this
 web page then als alternate login page.
 Consult the Moodle documentation for further instructions and requirements.
 
@@ -209,16 +209,16 @@ Example file:
     if ($_SERVER[$this->config->field_map_address] != '')
     {
         // $address contains something like 'SWITCH$Limmatquai 138$CH-8021 Zurich'
-        // We want to split this up to get: 
+        // We want to split this up to get:
         // institution, street, zipcode, city and country
         $address = $_SERVER[$this->config->field_map_address];
         list($institution, $street, $zip_city) = split('\$', $address);
         ereg(' (.+)',$zip_city, $regs);
         $city = $regs[1];
-        
+
         ereg('(.+)-',$zip_city, $regs);
         $country = $regs[1];
-        
+
         $result["address"] = $street;
         $result["city"] = $city;
         $result["country"] = $country;
@@ -233,32 +233,32 @@ Example file:
 How to upgrade your Service Provider to 2.x
 -------------------------------------------------------------------------------
 
-In case your upgrade your Service Provider 1.3.x to 2.x, be aware of the fact 
-that in version 2.0 the default behaviour regarding attribute propagation 
+In case your upgrade your Service Provider 1.3.x to 2.x, be aware of the fact
+that in version 2.0 the default behaviour regarding attribute propagation
 changed.
 While the Service Provider 1.3.x published the Shibboleth attributes to the
-web server environment as HTTP Request headers, the Service Provider 2.x 
+web server environment as HTTP Request headers, the Service Provider 2.x
 publishes attributes as environment variables, which increases the security for
 some platforms.
 However, this change has the effect that the attribute names change.
-E.g. while the surname attribute was published as 'HTTP_SHIB_PERSON_SURNAME' 
+E.g. while the surname attribute was published as 'HTTP_SHIB_PERSON_SURNAME'
 with 1.3.x, this attribute will be available in $_SERVER['Shib-Person-surname']
-or depending on your /etc/shibboleth/attribute-map.xml file just as 
+or depending on your /etc/shibboleth/attribute-map.xml file just as
 $_SERVER['sn'].
 Because Moodle needs to know what Shibboleth attributes it shall map onto which
 Moodle user profile field, one has to make sure the mapping is updated as well
 after the Service Provider upgrade.
 
 ********************************************************************************
-Because you risk locking yourself out of Moodle it is strongly 
+Because you risk locking yourself out of Moodle it is strongly
 recommended to use the following approach when upgrading the Service Provider:
-1. Enable manual authentication before the upgrade. 
-2. Make sure that you have at least one manual account with administration 
+1. Enable manual authentication before the upgrade.
+2. Make sure that you have at least one manual account with administration
    privileges working before upgrading your Service Provider to 2.x.
-3. After the SP upgrade, use this account to log into Moodle and adapt the 
-   attribute mapping in 'Site Administration -> Users -> Shibboleth' to reflect 
+3. After the SP upgrade, use this account to log into Moodle and adapt the
+   attribute mapping in 'Site Administration -> Users -> Shibboleth' to reflect
    the changed attribute names.
-   You find the attribute names in the file /etc/shibboleth/attribute-map.xml 
+   You find the attribute names in the file /etc/shibboleth/attribute-map.xml
    listed as the 'id' value of an attribute definition.
 4. If you are using the integrated WAYF, you may have to set the third parameter
    of each entry to '/Shibboleth.sso/DS'
@@ -268,8 +268,8 @@ recommended to use the following approach when upgrading the Service Provider:
 
 How to add logout support
 --------------------------------------------------------------------------------
-In order make Moodle support Shibboleth logout, one has to make the Shibboleth 
-Service Provider (SP) aware of the Moodle logout capability. Only then the SP 
+In order make Moodle support Shibboleth logout, one has to make the Shibboleth
+Service Provider (SP) aware of the Moodle logout capability. Only then the SP
 can trigger Moodle's front or back channel logout handler.
 
 To make the SP aware of the Moodle logout, you have to add the following to the
@@ -277,17 +277,17 @@ Shibboleth main configuration file shibboleth2.xml (usually in /etc/shibboleth/)
 just before the <MetadataProvider> element.
 
 --
-<Notify 
+<Notify
        Channel="back"
        Location="https://#YOUR_MOODLE_HOSTNAME#/moodle/auth/shibboleth/logout.php" />
 --
 
-Then restart the Shibboleth daemon and check the log file for errors. If there 
-were no errors, you can test the logout feature by accessing Moodle, 
+Then restart the Shibboleth daemon and check the log file for errors. If there
+were no errors, you can test the logout feature by accessing Moodle,
 authenticating via Shibboleth and the access the URL:
-#YOUR_MOODLE_HOSTNAME#/Shibboleth.sso/Logout (assuming you have a standard 
+#YOUR_MOODLE_HOSTNAME#/Shibboleth.sso/Logout (assuming you have a standard
 Shibboleth installation). If everything worked well, you should see a Shibboleth
-page saying that you were successfully logged out and if you go back to Moodle 
+page saying that you were successfully logged out and if you go back to Moodle
 you also should be logged out from Moodle.
 
 Requirements:
@@ -318,14 +318,14 @@ As of October 2009, the Shibboleth Identity Provider 2.1.4 does not yet support
 Single Logout (SLO). Therefore, the single logout feature cannot be used yet
 in a Shibboleth only setup but there may be other SAML2 products that could
 be used as Identity Provider, e.g. SimpleSAML PHP.
-One of the reasons why SLO isn't supported yet is because there aren't many 
-applications yet that were adapted to support front and back channel 
-logout. Hopefully, the Moodle logout helps to motivate the developers to 
+One of the reasons why SLO isn't supported yet is because there aren't many
+applications yet that were adapted to support front and back channel
+logout. Hopefully, the Moodle logout helps to motivate the developers to
 implement SLO. On the other hand, the easiest and safest way to log out
 still is to tell users to quit their web browsers :)
 
-Also see https://spaces.internet2.edu/display/SHIB2/SLOIssues and 
-https://spaces.internet2.edu/display/SHIB2/NativeSPLogoutInitiator for some 
+Also see https://spaces.internet2.edu/display/SHIB2/SLOIssues and
+https://spaces.internet2.edu/display/SHIB2/NativeSPLogoutInitiator for some
 background information on this topic.
 
 --------------------------------------------------------------------------------
index f69bee1e976e6bc0c5f8b56691b278e0ded6ed66..1cfaa462bca351eec995343dd81b0792252e1ecd 100644 (file)
@@ -68,7 +68,7 @@ class auth_plugin_shibboleth extends auth_plugin_base {
                     }
                 }
             }
-            
+
             // Set shibboleth session ID for logout
             $SESSION->shibboleth_session_id  = $sessionkey;
 
@@ -81,7 +81,7 @@ class auth_plugin_shibboleth extends auth_plugin_base {
     }
 
 
-    
+
     /**
      * Returns the user information for 'external' users. In this case the
      * attributes provided by Shibboleth
@@ -103,7 +103,7 @@ class auth_plugin_shibboleth extends auth_plugin_base {
         $search_attribs = array();
 
         foreach ($attrmap as $key=>$value) {
-            // Check if attribute is present  
+            // Check if attribute is present
             if (!isset($_SERVER[$value])){
                 $result[$key] = '';
                 continue;
@@ -183,22 +183,22 @@ class auth_plugin_shibboleth extends auth_plugin_base {
 
         return;
     }
-    
+
      /**
      * Hook for logout page
      *
      */
     function logoutpage_hook() {
         global $redirect;
-        
+
         // Only do this if logout handler is defined
         if (
-              isset($this->config->logout_handler) 
+              isset($this->config->logout_handler)
               && !empty($this->config->logout_handler)
            ){
             // Check if there is an alternative logout return url defined
             if (
-                  isset($this->config->logout_return_url) 
+                  isset($this->config->logout_return_url)
                   && !empty($this->config->logout_return_url)
                ){
                 // Set temp_redirect to alternative return url
@@ -207,7 +207,7 @@ class auth_plugin_shibboleth extends auth_plugin_base {
                 // Backup old redirect url
                 $temp_redirect = $redirect;
             }
-            
+
             // Overwrite redirect in order to send user to Shibboleth logout page and let him return back
             $redirect = $this->config->logout_handler.'?return='.urlencode($temp_redirect);
         }
@@ -246,15 +246,15 @@ class auth_plugin_shibboleth extends auth_plugin_base {
         if (!isset ($config->convert_data)) {
             $config->convert_data = '';
         }
-        
+
         if (!isset($config->changepasswordurl)) {
             $config->changepasswordurl = '';
         }
-        
+
         if (!isset($config->login_name)) {
             $config->login_name = 'Shibboleth Login';
         }
-        
+
         // Clean idp list
         if (isset($config->organization_selection) && !empty($config->organization_selection) && isset($config->alt_login) && $config->alt_login == 'on') {
             $idp_list = get_idp_list($config->organization_selection);
@@ -266,11 +266,11 @@ class auth_plugin_shibboleth extends auth_plugin_base {
                 $config->organization_selection .= $idp.', '.$value[0].', '.$value[1]."\n";
             }
         }
-        
+
 
         // save settings
         set_config('user_attribute',    $config->user_attribute,    'auth/shibboleth');
-        
+
         if (isset($config->organization_selection) && !empty($config->organization_selection)) {
             set_config('organization_selection',    $config->organization_selection,    'auth/shibboleth');
         }
@@ -280,27 +280,27 @@ class auth_plugin_shibboleth extends auth_plugin_base {
         set_config('convert_data',      $config->convert_data,      'auth/shibboleth');
         set_config('auth_instructions', $config->auth_instructions, 'auth/shibboleth');
         set_config('changepasswordurl', $config->changepasswordurl, 'auth/shibboleth');
-        
+
         // Overwrite alternative login URL if integrated WAYF is used
         if (isset($config->alt_login) && $config->alt_login == 'on'){
             set_config('alt_login',    $config->alt_login,    'auth/shibboleth');
             set_config('alternateloginurl', $CFG->wwwroot.'/auth/shibboleth/login.php');
         } else {
             // Check if integrated WAYF was enabled and is now turned off
-            // If it was and only then, reset the Moodle alternate URL 
+            // If it was and only then, reset the Moodle alternate URL
             if ($this->config->alt_login == 'on'){
                 set_config('alt_login',    'off',    'auth/shibboleth');
                 set_config('alternateloginurl', '');
             }
             $config->alt_login = 'off';
         }
-        
+
         // Check values and return false if something is wrong
         // Patch Anyware Technologies (14/05/07)
         if (($config->convert_data != '')&&(!file_exists($config->convert_data) || !is_readable($config->convert_data))){
             return false;
         }
-        
+
         // Check if there is at least one entry in the IdP list
         if (isset($config->organization_selection) && empty($config->organization_selection) && isset($config->alt_login) && $config->alt_login == 'on'){
             return false;
@@ -322,7 +322,7 @@ class auth_plugin_shibboleth extends auth_plugin_base {
     }
 }
 
-    
+
     /**
      * Sets the standard SAML domain cookie that is also used to preselect
      * the right entry on the local wayf
@@ -341,25 +341,25 @@ class auth_plugin_shibboleth extends auth_plugin_base {
         $IDPArray = appendCookieValue($selectedIDP, $IDPArray);
         setcookie ('_saml_idp', generate_cookie_value($IDPArray), time() + (100*24*3600));
     }
-    
+
      /**
-     * Prints the option elements for the select element of the drop down list 
+     * Prints the option elements for the select element of the drop down list
      *
      */
     function print_idp_list(){
         $config = get_config('auth/shibboleth');
-        
+
         $IdPs = get_idp_list($config->organization_selection);
         if (isset($_COOKIE['_saml_idp'])){
             $idp_cookie = generate_cookie_array($_COOKIE['_saml_idp']);
             do {
                 $selectedIdP = array_pop($idp_cookie);
             } while (!isset($IdPs[$selectedIdP]) && count($idp_cookie) > 0);
-            
+
         } else {
             $selectedIdP = '-';
         }
-        
+
         foreach($IdPs as $IdP => $data){
             if ($IdP == $selectedIdP){
                 echo '<option value="'.$IdP.'" selected="selected">'.$data[0].'</option>';
@@ -368,80 +368,80 @@ class auth_plugin_shibboleth extends auth_plugin_base {
             }
         }
     }
-    
-    
+
+
      /**
      * Generate array of IdPs from Moodle Shibboleth settings
      *
      * @param string Text containing tuble/triple of IdP entityId, name and (optionally) session initiator
-     * @return array Identifier of IdPs and their name/session initiator 
+     * @return array Identifier of IdPs and their name/session initiator
      */
 
     function get_idp_list($organization_selection) {
         $idp_list = array();
-        
+
         $idp_raw_list = split("\n",  $organization_selection);
-        
+
         foreach ($idp_raw_list as $idp_line){
             $idp_data = split(',', $idp_line);
             if (isset($idp_data[2]))
             {
-                $idp_list[trim($idp_data[0])] = array(trim($idp_data[1]),trim($idp_data[2])); 
+                $idp_list[trim($idp_data[0])] = array(trim($idp_data[1]),trim($idp_data[2]));
             }
             elseif(isset($idp_data[1]))
             {
                 $idp_list[trim($idp_data[0])] = array(trim($idp_data[1]));
             }
         }
-        
+
         return $idp_list;
     }
-    
+
     /**
      * Generates an array of IDPs using the cookie value
      *
-     * @param string Value of SAML domain cookie 
-     * @return array Identifiers of IdPs 
+     * @param string Value of SAML domain cookie
+     * @return array Identifiers of IdPs
      */
     function generate_cookie_array($value) {
-        
+
         // Decodes and splits cookie value
         $CookieArray = split(' ', $value);
         $CookieArray = array_map('base64_decode', $CookieArray);
-        
+
         return $CookieArray;
     }
-    
+
     /**
      * Generate the value that is stored in the cookie using the list of IDPs
      *
-     * @param array IdP identifiers 
+     * @param array IdP identifiers
      * @return string SAML domain cookie value
      */
     function generate_cookie_value($CookieArray) {
-    
+
         // Merges cookie content and encodes it
         $CookieArray = array_map('base64_encode', $CookieArray);
         $value = implode(' ', $CookieArray);
         return $value;
     }
-    
+
     /**
      * Append a value to the array of IDPs
      *
      * @param string IdP identifier
      * @param array IdP identifiers
-     * @return array IdP identifiers with appended IdP 
+     * @return array IdP identifiers with appended IdP
      */
     function appendCookieValue($value, $CookieArray) {
-        
+
         array_push($CookieArray, $value);
         $CookieArray = array_reverse($CookieArray);
         $CookieArray = array_unique($CookieArray);
         $CookieArray = array_reverse($CookieArray);
-        
+
         return $CookieArray;
     }
 
 
-?>
+
index 07744278514319ce237b4925ac3f6508ad461bcc..3e3012427eeab0acb2e563d1ea39c9afc7412c60 100755 (executable)
@@ -47,7 +47,7 @@
 <tr valign="top">
     <td align="right"><?php print_string("auth_shib_integrated_wayf", "auth_shibboleth") ?>:</td>
     <td>
-        <input name="alt_login" type="checkbox" <?php 
+        <input name="alt_login" type="checkbox" <?php
         if ( isset($config->alt_login) and $config->alt_login == 'on' ){
                 echo 'checked="checked"';
             }
@@ -60,7 +60,7 @@
     <td align="right"><?php print_string("auth_shib_idp_list", "auth_shibboleth") ?>:</td>
     <td>
         <textarea name="organization_selection" rows="10" cols="30" style="overflow: auto; white-space: nowrap;"
-><?php 
+><?php
         if (!isset($config->organization_selection)){
             echo  'urn:mace:organization1:providerID, Example Organization 1
 https://another.idp-id.com/shibboleth, Other Example Organization, /Shibboleth.sso/DS/SWITCHaai
@@ -84,7 +84,7 @@ urn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/
 <tr valign="top">
     <td align="right"><?php print_string("auth_shib_logout_url", "auth_shibboleth") ?>:</td>
     <td>
-        <input name="logout_handler" type="text" size="30" value="<?php 
+        <input name="logout_handler" type="text" size="30" value="<?php
         if ( isset($config->logout_handler) and !empty($config->logout_handler)){
             echo $config->logout_handler;
         }
@@ -96,7 +96,7 @@ urn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/
 <tr valign="top">
     <td align="right"><?php print_string("auth_shib_logout_return_url", "auth_shibboleth") ?>:</td>
     <td>
-        <input name="logout_return_url" type="text" size="30" value="<?php 
+        <input name="logout_return_url" type="text" size="30" value="<?php
         if ( isset($config->logout_return_url) and !empty($config->logout_return_url)){
             echo $config->logout_return_url;
         }
@@ -108,7 +108,7 @@ urn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/
 <tr valign="top">
     <td align="right"><?php print_string("auth_shib_auth_method", "auth_shibboleth") ?>:</td>
     <td>
-        <input name="login_name" type="text" size="30" value="<?php 
+        <input name="login_name" type="text" size="30" value="<?php
         if ( isset($config->login_name) and !empty($config->login_name)){
             echo htmlentities($config->login_name);
         } else {
index 0744ed925ef94c426d86924da4da22111b7fd215..b8925a18e4db5d743bfdc4ebe623c9deb60926c8 100644 (file)
         }
 
         redirect($urltogo);
-        
+
     }
 
     $pluginconfig   = get_config('auth/shibboleth');
     $shibbolethauth = get_auth_plugin('shibboleth');
-    
+
     // Check whether Shibboleth is configured properly
     if (empty($pluginconfig->user_attribute)) {
         print_error('shib_not_set_up_error', 'auth');
     /// Check if the user has actually submitted login data to us
 
         if ($shibbolethauth->user_login($frm->username, $frm->password)) {
-            
+
             $USER = authenticate_user_login($frm->username, $frm->password);
-            
+
             $USER->loggedin = true;
-            $USER->site     = $CFG->wwwroot; // for added security, store the site in the 
-            
+            $USER->site     = $CFG->wwwroot; // for added security, store the site in the
+
             update_user_login_times();
-            
+
             // Don't show username on login page
             set_moodle_cookie('nobody');
 
             set_login_session_preferences();
-            
+
             unset($SESSION->lang);
             $SESSION->justloggedin = true;
-            
+
             add_to_log(SITEID, 'user', 'login', "view.php?id=$USER->id&course=".SITEID, $USER->id, 0, $USER->id);
-            
+
             if (user_not_fully_set_up($USER)) {
                 $urltogo = $CFG->wwwroot.'/user/edit.php?id='.$USER->id.'&amp;course='.SITEID;
                 // We don't delete $SESSION->wantsurl yet, so we get there later
             load_all_capabilities();     /// This is what lets the user do anything on the site  :-)
 
             redirect($urltogo);
-            
+
             exit;
-        } 
-        
+        }
+
         else {
             // For some weird reason the Shibboleth user couldn't be authenticated
         }
@@ -97,4 +97,4 @@
         print_error('shib_not_set_up_error', 'auth');
     }
 
-?>
+
index ade24491d5e3e00cefbd30866e82258bf7c903a6..af70ca4006a2d4272716e906aedc19a6ee97a12b 100644 (file)
@@ -10,8 +10,8 @@ if ($show_instructions) {
 <div class="loginbox clearfix <?php echo $columns ?>">
   <div class="loginpanel">
     <!--<h2><?php print_string("returningtosite") ?></h2>-->
-    
-    <h2><?php 
+
+    <h2><?php
         if (isset($config->login_name) && !empty($config->login_name)){
             echo $config->login_name;
         } else {
@@ -31,7 +31,7 @@ if ($show_instructions) {
           <div class="guestsub">
           <p><?php print_string("auth_shibboleth_select_organization", "auth_shibboleth"); ?></p>
             <form action="login.php" method="post" id="guestlogin">
-            <select name="idp"> 
+            <select name="idp">
                 <option value="-" ><?php print_string("auth_shibboleth_select_member", "auth_shibboleth"); ?></option>
                 <?php
                     print_idp_list();
@@ -39,7 +39,7 @@ if ($show_instructions) {
             </select><p><input type="submit" value="<?php print_string("select"); ?>" accesskey="s" /></p>
             </form>
             <p>
-            <?php 
+            <?php
                 print_string("auth_shibboleth_contact_administrator", "auth_shibboleth");
                 echo '<a href="mailto:'.get_admin()->email.'"> Moodle Administrator</a>.';
             ?>
@@ -70,7 +70,7 @@ if ($show_instructions) {
     <div class="signuppanel">
       <h2><?php print_string("firsttime") ?></h2>
       <div class="subcontent">
-<?php     if (is_enabled_auth('none')) { // instructions override the rest for security reasons 
+<?php     if (is_enabled_auth('none')) { // instructions override the rest for security reasons
               print_string("loginstepsnone");
           } else if ($CFG->registerauth == 'email') {
               if (!empty($CFG->auth_instructions)) {
index 328c32ae03506a2f2d69b6b7049e9538c6c1e0b2..58c7882873eecd692b68ab4c9b1b97441e74447f 100644 (file)
@@ -2,7 +2,7 @@
 
     require_once("../../config.php");
     require_once($CFG->dirroot."/auth/shibboleth/auth.php");
-    
+
     //initialize variables
     $errormsg = '';
 
@@ -37,7 +37,7 @@ httpsrequired();
     $loginurl = (!empty($CFG->alternateloginurl)) ? $CFG->alternateloginurl : '';
 
 
-    if (get_moodle_cookie() == '') {   
+    if (get_moodle_cookie() == '') {
         set_moodle_cookie('nobody');   // To help search for cookies
     }
 
@@ -49,13 +49,13 @@ httpsrequired();
 
     // Set SAML domain cookie
     $config = get_config('auth/shibboleth');
-    
+
 
     $IdPs = get_idp_list($config->organization_selection);
     if (isset($_POST['idp']) && isset($IdPs[$_POST['idp']])){
         $selectedIdP = $_POST['idp'];
         set_saml_cookie($selectedIdP);
-        
+
         // Redirect to SessionInitiator with entityID as argument
         if (isset($IdPs[$selectedIdP][1]) && !empty($IdPs[$selectedIdP][1])){
             // For Shibbolet 1.x Service Providers
@@ -83,9 +83,9 @@ httpsrequired();
     $PAGE->set_heading($site->fullname);
     $PAGE->set_focuscontrol('idp');
     $PAGE->set_headingmenu('<div class="langmenu">'.$langmenu.'</div>');
-    
+
     echo $OUTPUT->header();
     include("index_form.html");
     echo $OUTPUT->footer();
 
-?>
+
index 783419b28d72477adc68dca279041ca16ee28f61..5690a9e06218417b3677d9f58f71adf83f766109 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 // Implements logout for Shibboleth authenticated users according to:
 // - https://spaces.internet2.edu/display/SHIB2/NativeSPLogoutInitiator
@@ -13,42 +13,42 @@ require_once($CFG->dirroot."/auth/shibboleth/auth.php");
 $protocol = 'http://';
 if ( isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'){
        $protocol = 'https://';
-} 
+}
 
 // Front channel logout
 if (
-        isset($_GET['return']) 
+        isset($_GET['return'])
         && isset($_GET['action'])
         && $_GET['action'] == 'logout'
    ){
-    
+
     // Logout out user from application
     // E.g. destroy application session/cookie etc
     require_logout();
-    
+
     // Finally, send user to the return URL
     redirect($_GET['return']);
 }
 
 // Back channel logout
 elseif (!empty($HTTP_RAW_POST_DATA)) {
-    
+
     // Requires PHP 5
-    
-    
+
+
     // Set SOAP header
     $server = new SoapServer($protocol.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'/LogoutNotification.wsdl');
-    
-    
+
+
     $server->addFunction("LogoutNotification");
     $server->handle();
-} 
+}
 
 // Return WSDL
 else {
-    
+
     header('Content-Type: text/xml');
-    
+
     echo <<<WSDL
 <?xml version ="1.0" encoding ="UTF-8" ?>
 <definitions name="LogoutNotification"
@@ -59,10 +59,10 @@ else {
 
 <!--
 This page either has to be called with the GET arguments 'action' and 'return' via
-a redirect from the Shibboleth Service Provider logout handler (front-channel 
-logout) or via a SOAP request by a Shibboleth Service Provider (back-channel 
+a redirect from the Shibboleth Service Provider logout handler (front-channel
+logout) or via a SOAP request by a Shibboleth Service Provider (back-channel
 logout).
-Because neither of these two variants seems to be the case, the WSDL file for 
+Because neither of these two variants seems to be the case, the WSDL file for
 the web service is returned.
 
 For more information see:
@@ -74,43 +74,43 @@ For more information see:
        <schema targetNamespace="urn:mace:shibboleth:2.0:sp:notify"
            xmlns="http://www.w3.org/2000/10/XMLSchema"
            xmlns:notify="urn:mace:shibboleth:2.0:sp:notify">
-            
+
             <simpleType name="string">
                 <restriction base="string">
                     <minLength value="1"/>
                 </restriction>
             </simpleType>
-            
+
             <element name="OK" type="notify:OKType"/>
             <complexType name="OKType">
                 <sequence/>
             </complexType>
-            
+
         </schema>
     </types>
-    
+
     <message name="getLogoutNotificationRequest">
         <part name="SessionID" type="notify:string" />
     </message>
-    
+
     <message name="getLogoutNotificationResponse" >
         <part name="OK"/>
     </message>
-    
+
     <portType name="LogoutNotificationPortType">
         <operation name="LogoutNotification">
             <input message="getLogoutNotificationRequest"/>
             <output message="getLogoutNotificationResponse"/>
         </operation>
     </portType>
-    
+
     <binding name="LogoutNotificationBinding" type="notify:LogoutNotificationPortType">
         <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
         <operation name="LogoutNotification">
             <soap:operation soapAction="urn:xmethods-logout-notification#LogoutNotification"/>
         </operation>
     </binding>
-    
+
     <service name="LogoutNotificationService">
           <port name="LogoutNotificationPort" binding="notify:LogoutNotificationBinding">
             <soap:address location="{$protocol}{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}"/>
@@ -125,12 +125,12 @@ WSDL;
 /******************************************************************************/
 
 function LogoutNotification($SessionID){
-    
+
     global $CFG, $SESSION, $DB;
-    
+
     // Delete session of user using $SessionID
     if(empty($CFG->dbsessions)) {
-        
+
         // File session
         $dir = $CFG->dataroot .'/sessions';
         if (is_dir($dir)) {
@@ -140,15 +140,15 @@ function LogoutNotification($SessionID){
                     // Check if it is a file
                     if (is_file($dir.'/'.$file)){
                         $session_key = ereg_replace('sess_', '', $file);
-                        
+
                         // Read session file data
                         $data = file($dir.'/'.$file);
                         if (isset($data[0])){
                             $user_session = unserializesession($data[0]);
-                            
-                            // Check if we have found session that shall be deleted 
+
+                            // Check if we have found session that shall be deleted
                             if (isset($user_session['SESSION']) && isset($user_session['SESSION']->shibboleth_session_id)){
-                                
+
                                 // If there is a match, delete file
                                 if ($user_session['SESSION']->shibboleth_session_id == $SessionID){
                                     // Delete session file
@@ -168,15 +168,15 @@ function LogoutNotification($SessionID){
         if (!empty($CFG->sessiontimeout)) {
             $ADODB_SESS_LIFE   = $CFG->sessiontimeout;
         }
-        
+
             if ($user_session_data = $DB->get_records_sql('SELECT sesskey, sessdata FROM {sessions2} WHERE expiry > NOW()')) {
             foreach ($user_session_data as $session_data) {
-                
+
                 // Get user session
                 $user_session = adodb_unserialize( urldecode($session_data->sessdata) );
-                
+
                 if (isset($user_session['SESSION']) && isset($user_session['SESSION']->shibboleth_session_id)){
-                    
+
                     // If there is a match, delete file
                     if ($user_session['SESSION']->shibboleth_session_id == $SessionID){
                         // Delete this session entry
@@ -188,9 +188,9 @@ function LogoutNotification($SessionID){
             }
         }
     }
-    
+
     // If now SoapFault was thrown the function will return OK as the SP assumes
-    
+
 }
 
 /*****************************************************************************/
@@ -204,5 +204,3 @@ function unserializesession( $serialized_string ){
     }
     return( $variables );
 }
-
-?>
index d92bb382c548dfec5287cfbf5db4e557993137d4..a2315b67f8a8153b2c21d2a6d4ae637d10f39f73 100644 (file)
@@ -146,11 +146,11 @@ class auth_plugin_webservice extends auth_plugin_base {
 
    /**
      * Confirm the new user as registered. This should normally not be used,
-     * but it may be necessary if the user auth_method is changed to manual 
+     * but it may be necessary if the user auth_method is changed to manual
      * before the user is confirmed.
      */
     function user_confirm($username, $confirmsecret = null) {
-        return AUTH_CONFIRM_ERROR;      
+        return AUTH_CONFIRM_ERROR;
     }
 
 }