ldap_form_add_users_group.php 3.3 KB

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