newUser.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php # $Id: newUser.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 do not yet exist in the Dokeos database,
  23. * can be added by this script which tries to retrieve ldap information about them.
  24. *
  25. * @author Roan Embrechts
  26. * @package dokeos.auth.ldap
  27. ==============================================================================
  28. */
  29. /*
  30. ==================================================
  31. when a user does not exist yet in claroline,
  32. but he or she does exist in the LDAP,
  33. we add him to the claroline database
  34. ==================================================
  35. */
  36. include_once('./main/auth/ldap/authldap.php');
  37. $loginLdapSucces = loginWithLdap($login, $password);
  38. if ($loginLdapSucces)
  39. {
  40. /*
  41. In here, we know that
  42. - the user does not exist in Claroline
  43. - the users login and password are correct
  44. */
  45. $infoArray = findUserInfoInLdap($login);
  46. putUserInfoInClaroline ($login, $infoArray);
  47. }
  48. else
  49. {
  50. $loginFailed = true;
  51. unset($_uid);
  52. $uidReset = false;
  53. }
  54. ?>