[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/auth/ldap/ -> ntlmsso_magic.php (source)

   1  <?php
   2  
   3  // Don't let lib/setup.php set any cookies
   4  // as we will be executing under the OS security
   5  // context of the user we are trying to login, rather than
   6  // of the webserver.
   7  $nomoodlecookie=true;
   8  
   9  require_once(dirname(dirname(dirname(__FILE__)))."/config.php");
  10  
  11  //HTTPS is potentially required in this page
  12  httpsrequired();
  13  
  14  $authsequence = get_enabled_auth_plugins(true); // auths, in sequence
  15  if (!in_array('ldap',$authsequence,true)) {
  16      print_error('ldap_isdisabled','auth');
  17  }
  18  
  19  $authplugin = get_auth_plugin('ldap');
  20  if (empty($authplugin->config->ntlmsso_enabled)) {
  21      print_error('ntlmsso_isdisabled','auth');
  22  }
  23  
  24  $sesskey = required_param('sesskey', PARAM_RAW);
  25  $file = $CFG->dirroot . '/pix/spacer.gif';
  26  
  27  if ($authplugin->ntlmsso_magic($sesskey) 
  28      && file_exists($file)) {
  29  
  30      // Serve GIF
  31      // Type
  32      header('Content-Type: image/gif');
  33      header('Content-Length: '.filesize($file));
  34  
  35      // Output file
  36      $handle=fopen($file,'r');
  37      fpassthru($handle);
  38      fclose($handle);
  39      exit;
  40  } else {
  41      print_error('ntlmsso_iwamagicnotenabled','auth');
  42  }
  43  
  44  ?>


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7