Location: PHPKode > projects > Meeting Request Scheduling and Booking System > mrsbs/php/lib/auth.getenv.inc
<?PHP

   // getenv Auth, for use with .htaccess
   //
   // Version: $Revision: 1.2 $
   // Date: $Date: 2006/09/05 02:56:14 $
   //
   // Copyright (c) 2006 Benjamin Oshrin
   // License restrictions apply, see LICENSE for details.

// Does this auth handler support logout?

$auth_logout_provided = false;

function auth_handler()
{
  // Perform the local authentication.  Session information is set here.

  // Returns: true if auth is successful, false otherwise.

  // An auth handler needs to set three variables:

  if(getenv("REMOTE_USER") != "")
  {
    // Using unvalidated input ($_GET) here is unsafe
    
    // (1) The user logged in as
    $_SESSION['user'] = getenv("REMOTE_USER");
  
    // (2) An array of groups for the user
    $_SESSION['groups'] = array();

    // (3) The email address of the logged in user
    // There isn't a standard way to get the mail address, so we guess
    $_SESSION['mail'] = getenv("REMOTE_USER") . "@" . $_SERVER['SERVER_NAME'];
  }

  return(true);
}

function auth_logout()
{
  // Perform the local logout and clear session information.

  // Returns: true if auth is successful, false otherwise.

  // On logout, an auth handler needs to clear the session variables.

  return(clear_session_vars());
}

?>

Return current item: Meeting Request Scheduling and Booking System