dokeos-auth-ldap
[ class tree: dokeos-auth-ldap ] [ index: dokeos-auth-ldap ] [ all elements ]

Source for file login.php

Documentation is available at login.php

  1. <?php // $Id: login.php 14965 2008-04-20 23:01:17Z yannoo $
  2. /*
  3. ==============================================================================
  4.     Dokeos - elearning and course management software
  5.     
  6.     Copyright (c) 2004 Dokeos SPRL
  7.     Copyright (c) 2003 Ghent University (UGent)
  8.     Copyright (c) 2001 Universite catholique de Louvain (UCL)
  9.     Copyright (c) Roan Embrechts
  10.     
  11.     For a full list of contributors, see "credits.txt".
  12.     The full license can be read in "license.txt".
  13.     
  14.     This program is free software; you can redistribute it and/or
  15.     modify it under the terms of the GNU General Public License
  16.     as published by the Free Software Foundation; either version 2
  17.     of the License, or (at your option) any later version.
  18.     
  19.     See the GNU General Public License for more details.
  20.     
  21.     Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
  22.     Mail: info@dokeos.com
  23. ==============================================================================
  24. */
  25. /**
  26. ==============================================================================
  27. *    Users trying to login, who already exist in the Dokeos database
  28. *    and have ldap as authentication type, get verified here.
  29. *
  30. *    @author Roan Embrechts
  31. *    @package dokeos.auth.ldap
  32. ==============================================================================
  33. */
  34.  
  35.     /*
  36.         An external authentification module
  37.         needs to set
  38.         - $loginFailed
  39.         - $uidReset
  40.         - $_user['user_id']
  41.         - register the $_user['user_id'] in the session
  42.         As the LDAP code shows, this is not as difficult as you might think.
  43.     */
  44.     /*
  45.     ===============================================
  46.         LDAP authentification module
  47.         this calls the loginWithLdap function
  48.         from the LDAP library, and sets a few 
  49.         variables based on the result.
  50.     ===============================================
  51.     */
  52. //require_once('../../inc/global.inc.php'); - this script should be loaded by the /index.php script anyway, so global is already loaded
  53. require_once('authldap.php');
  54.  
  55. $loginLdapSucces ldap_login($login$password);    
  56.  
  57. if ($loginLdapSucces)
  58. {
  59.     $loginFailed false;
  60.     $uidReset true;
  61.     $_user['user_id'$uData['user_id'];
  62.     api_session_register('_uid');
  63. }
  64. else
  65. {
  66.     $loginFailed true;
  67.     unset($_user['user_id']);
  68.     $uidReset false;
  69. }
  70. ?>

Documentation generated on Thu, 12 Jun 2008 14:01:02 -0500 by phpDocumentor 1.4.1