login.php 2.0 KB

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