useradd.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * Elgg add user form.
  4. *
  5. * @package Elgg
  6. * @subpackage Core
  7. *
  8. */
  9. if (elgg_is_sticky_form('useradd')) {
  10. $values = elgg_get_sticky_values('useradd');
  11. elgg_clear_sticky_form('useradd');
  12. } else {
  13. $values = array();
  14. }
  15. $password = $password2 = '';
  16. $name = elgg_extract('name', $values);
  17. $username = elgg_extract('username', $values);
  18. $email = elgg_extract('email', $values);
  19. $admin = elgg_extract('admin', $values);
  20. if (is_array($admin)) {
  21. $admin = array_shift($admin);
  22. }
  23. ?>
  24. <div>
  25. <label><?php echo elgg_echo('name');?></label><br />
  26. <?php
  27. echo elgg_view('input/text', array(
  28. 'name' => 'name',
  29. 'value' => $name,
  30. ));
  31. ?>
  32. </div>
  33. <div>
  34. <label><?php echo elgg_echo('username'); ?></label><br />
  35. <?php
  36. echo elgg_view('input/text', array(
  37. 'name' => 'username',
  38. 'value' => $username,
  39. ));
  40. ?>
  41. </div>
  42. <div>
  43. <label><?php echo elgg_echo('email'); ?></label><br />
  44. <?php
  45. echo elgg_view('input/text', array(
  46. 'name' => 'email',
  47. 'value' => $email,
  48. ));
  49. ?>
  50. </div>
  51. <div>
  52. <label><?php echo elgg_echo('password'); ?></label><br />
  53. <?php
  54. echo elgg_view('input/password', array(
  55. 'name' => 'password',
  56. 'value' => $password,
  57. ));
  58. ?>
  59. </div>
  60. <div>
  61. <label><?php echo elgg_echo('passwordagain'); ?></label><br />
  62. <?php
  63. echo elgg_view('input/password', array(
  64. 'name' => 'password2',
  65. 'value' => $password2,
  66. ));
  67. ?>
  68. </div>
  69. <div>
  70. <?php
  71. echo elgg_view('input/checkboxes', array(
  72. 'name' => "admin",
  73. 'options' => array(elgg_echo('admin_option') => 1),
  74. 'value' => $admin,
  75. ));
  76. ?>
  77. </div>
  78. <div class="elgg-foot">
  79. <?php echo elgg_view('input/submit', array('value' => elgg_echo('register'))); ?>
  80. </div>