ldap_form_add_users_group.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Form to add users through LDAP (deprecated?)
  5. * @package chamilo.admin
  6. * Copyright (c) 2007 Mustapha Alouani (supervised by Michel Moreau-Belliard)
  7. */
  8. /**
  9. * This form is included by ldap_import_students.php and ldap_import_students_to_session.php
  10. */
  11. $nbre=0;
  12. echo '<form name="form" method="post" action="'.api_get_self().'?annee='.Security::remove_XSS($annee).'">';
  13. if ($statut == 1) {
  14. echo get_lang(
  15. 'EmailNotifySubscription'
  16. ).': <input type="checkbox" name="mailling" value="1" checked="checked"><i>'.get_lang(
  17. 'DontUnchek'
  18. ).'</i>';
  19. } else {
  20. echo '<input type="hidden" name="mailling" value="1">';
  21. }
  22. if (!empty($course)) {
  23. echo '<input type="hidden" name="course" value="'.Security::remove_XSS($course).'">';
  24. } elseif (!empty($id_session)) {
  25. echo '<input type="hidden" name="id_session" value="'.Security::remove_XSS($id_session).'">';
  26. }
  27. $is_western_name_order = api_is_western_name_order();
  28. echo '<input type="hidden" name="confirmed" value="yes">';
  29. echo '<table border="0" cellspacing="0" width="100%">';
  30. echo '<tr align="center" id="header3">' .
  31. '<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>' .
  32. '<td width="40%"><b>'.get_lang('Email').'</b></td>' .
  33. ($is_western_name_order
  34. ? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>' .
  35. '<td width="15%"><b>'.get_lang('Name').'</b></td>'
  36. : '<td width="15%"><b>'.get_lang('Name').'</b></td>' .
  37. '<td width="15%"><b>'.get_lang('FirstName').'</b></td>') .
  38. '<td width="15%"><b>'.get_lang('Login').'</b></td>' .
  39. '</tr>'."\n";
  40. while (list ($key, $val) = each($nom_form)) {
  41. $nbre=$nbre+1;
  42. if($nbre & 1) $ndiv=2; else $ndiv=3;
  43. echo '<tr align="center" id="header'.$ndiv.'">';
  44. echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>';
  45. echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>';
  46. if ($is_western_name_order) {
  47. echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
  48. echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
  49. } else {
  50. echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
  51. echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
  52. }
  53. echo '<td>'.$username_form[$key].'<input type="hidden" name="username_form['.$key.']" size="10" value="'.$username_form[$key].'">';
  54. echo '<input type="hidden" name="tutor_form['.$key.']" value="0">';
  55. echo '<input type="hidden" name="admin_form['.$key.']" value="1">';
  56. echo '<input type="hidden" name="password_form['.$key.']" value="'.$password_form[$key].'">';
  57. echo '<input type="hidden" name="statut['.$key.']" value="'.$statut.'">';
  58. echo '</td>';
  59. echo '</tr>';
  60. }
  61. echo '</table>';
  62. echo '<br />';
  63. echo '<br />';
  64. echo '<input type="submit" name="submit" value="'.get_lang('Submit').'">';
  65. echo '</form>';