add_user.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <!-- Begin toolbar -->
  2. <div class="toolbar">
  3. <div class="toolbar-inner">
  4. <div class="toolbar-buttons">
  5. <a class="button button-secondary button-back js-button-back" href="/list/user/">
  6. <i class="fas fa-arrow-left icon-blue"></i><?= tohtml( _("Back")) ?>
  7. </a>
  8. </div>
  9. <div class="toolbar-buttons">
  10. <button type="submit" class="button" form="main-form">
  11. <i class="fas fa-floppy-disk icon-purple"></i><?= tohtml( _("Save")) ?>
  12. </button>
  13. </div>
  14. </div>
  15. </div>
  16. <!-- End toolbar -->
  17. <div class="container">
  18. <form
  19. x-data="{
  20. loginDisabled: <?= tohtml($v_login_disabled == "yes" ? "true" : "false") ?>
  21. }"
  22. id="main-form"
  23. name="v_add_user"
  24. method="post"
  25. >
  26. <input type="hidden" name="token" value="<?= tohtml($_SESSION["token"]) ?>">
  27. <input type="hidden" name="ok" value="Add">
  28. <div class="form-container">
  29. <h1 class="u-mb20"><?= tohtml( _("Add User")) ?></h1>
  30. <?php show_alert_message($_SESSION); ?>
  31. <div class="u-mb10">
  32. <label for="v_username" class="form-label"><?= tohtml( _("Username")) ?></label>
  33. <input type="text" class="form-control" name="v_username" id="v_username" value="<?= tohtml(trim($v_username, "'")) ?>" tabindex="1" required>
  34. </div>
  35. <div class="u-mb10">
  36. <label for="v_name" class="form-label"><?= tohtml( _("Contact Name")) ?></label>
  37. <input type="text" class="form-control" name="v_name" id="v_name" value="<?= tohtml(trim($v_name, "'")) ?>" tabindex="2" required>
  38. </div>
  39. <div class="u-mb10">
  40. <label for="v_email" class="form-label"><?= tohtml( _("Email")) ?></label>
  41. <input type="email" class="form-control js-sync-email-input" name="v_email" id="v_email" value="<?= tohtml(trim($v_email, "'")) ?>" tabindex="3" required>
  42. </div>
  43. <div class="u-mb10">
  44. <label for="v_password" class="form-label">
  45. <?= tohtml( _("Password")) ?>
  46. <button type="button" title="<?= tohtml( _("Generate")) ?>" class="u-unstyled-button u-ml5 js-generate-password">
  47. <i class="fas fa-arrows-rotate icon-green"></i>
  48. </button>
  49. </label>
  50. <div class="u-pos-relative u-mb10">
  51. <input type="text" class="form-control js-password-input" name="v_password" id="v_password" value="<?= tohtml(trim($v_password, "'")) ?>" tabindex="4" required>
  52. <div class="password-meter">
  53. <meter max="4" class="password-meter-input js-password-meter"></meter>
  54. </div>
  55. </div>
  56. </div>
  57. <?php require $_SERVER["HESTIA"] . "/web/templates/includes/password-requirements.php"; ?>
  58. <div class="form-check">
  59. <input x-model="loginDisabled" class="form-check-input" type="checkbox" name="v_login_disabled" id="v_login_disabled">
  60. <label for="v_login_disabled">
  61. <?= tohtml( _("Do not allow user to log in to Control Panel")) ?>
  62. </label>
  63. </div>
  64. <div x-cloak x-show="!loginDisabled" id="send-welcome">
  65. <div class="form-check u-mb10">
  66. <input class="form-check-input js-sync-email-checkbox" type="checkbox" name="v_email_notice" id="v_email_notify" tabindex="5">
  67. <label for="v_email_notify">
  68. <?= tohtml( _("Send welcome email")) ?>
  69. </label>
  70. </div>
  71. </div>
  72. <div class="u-mb10">
  73. <label for="v_language" class="form-label"><?= tohtml( _("Language")) ?></label>
  74. <select class="form-select" name="v_language" id="v_language" tabindex="6" required>
  75. <?php
  76. foreach ($languages as $key => $value) {
  77. echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($key)."\"";
  78. if (( $key == $_SESSION['LANGUAGE'] ) && (empty($v_language))){
  79. echo ' selected' ;
  80. }
  81. if (isset($v_language)){
  82. if ( htmlentities($key) == trim($v_language,"'") ){
  83. echo ' selected' ;
  84. }
  85. }
  86. echo ">".htmlentities($value)."</option>\n";
  87. }
  88. ?>
  89. </select>
  90. </div>
  91. <div class="u-mb10">
  92. <label for="v_role" class="form-label"><?= tohtml( _("Role")) ?></label>
  93. <select class="form-select" name="v_role" id="v_role" required>
  94. <option value="user"><?= tohtml( _("User")) ?></option>
  95. <option value="admin" <?= tohtml($v_role == "admin" ? "selected" : "") ?>><?= tohtml( _("Administrator")) ?></option>
  96. <option value="dns-cluster" <?= tohtml($v_role == "dns-cluster" ? "selected" : "") ?>><?= tohtml( _("DNS Sync User")) ?></option>
  97. </select>
  98. </div>
  99. <div class="u-mb10">
  100. <label for="v_package" class="form-label"><?= tohtml( _("Package")) ?></label>
  101. <select class="form-select" name="v_package" id="v_package" tabindex="8" required>
  102. <?php
  103. foreach ($data as $key => $value) {
  104. echo "\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($key)."\"";
  105. if ((!empty($v_package)) && ( $key == $_POST['v_package'])){
  106. echo 'selected' ;
  107. } else {
  108. if ( $key == 'default'){
  109. echo 'selected' ;
  110. }
  111. }
  112. echo ">".htmlentities($key)."</option>\n";
  113. }
  114. ?>
  115. </select>
  116. </div>
  117. <div class="u-mb10">
  118. <label for="v_notify" class="form-label">
  119. <?= tohtml( _("Email login credentials to:")) ?>
  120. </label>
  121. <input type="email" class="form-control js-sync-email-output" name="v_notify" id="v_notify" value="<?= tohtml(trim($v_notify, "'")) ?>" tabindex="8">
  122. </div>
  123. </div>
  124. </form>
  125. </div>