@@ -77,19 +77,19 @@ class="<?= $v_status ?>"
7777 <?php show_alert_message ($ _SESSION ); ?>
7878 <div class="u-mb10">
7979 <label for="v_user" class="form-label"><?= _ ("Username " ) ?> </label>
80- <input type="text" class="form-control" name="v_user" id="v_user" value="<?= htmlentities (trim ($ v_username , "' " )) ?> " disabled>
80+ <input type="text" class="form-control" name="v_user" id="v_user" value="<?= htmlentities (trim ($ v_username , "' " )) ?> " disabled required >
8181 <input type="hidden" name="v_username" value="<?= htmlentities (trim ($ v_username , "' " )) ?> ">
8282 </div>
8383 <div class="u-mb10">
8484 <label for="v_name" class="form-label"><?= _ ("Contact " ) ?> </label>
85- <input type="text" class="form-control" name="v_name" id="v_name" value="<?= htmlentities (trim ($ v_name , "' " ))?> " <?php if (($ _SESSION ['userContext ' ] !=='admin ' ) && ($ _SESSION ['POLICY_USER_EDIT_DETAILS ' ] !=='yes ' )) { echo 'disabled ' ; }?> >
85+ <input type="text" class="form-control" name="v_name" id="v_name" value="<?= htmlentities (trim ($ v_name , "' " ))?> " <?php if (($ _SESSION ['userContext ' ] !=='admin ' ) && ($ _SESSION ['POLICY_USER_EDIT_DETAILS ' ] !=='yes ' )) { echo 'disabled ' ; }?> required >
8686 <?php if (($ _SESSION ['userContext ' ] !== 'admin ' ) && ($ _SESSION ['POLICY_USER_EDIT_DETAILS ' ] !== 'yes ' )) {?>
8787 <input type="hidden" name="v_name" value="<?= htmlentities (trim ($ v_name , "' " ))?> ">
8888 <?php } ?>
8989 </div>
9090 <div class="u-mb10">
9191 <label for="v_email" class="form-label"><?= _ ("Email " ) ?> </label>
92- <input type="email" class="form-control" name="v_email" id="v_email" value="<?= htmlentities (trim ($ v_email , "' " ))?> " <?php if (($ _SESSION ['userContext ' ] !=='admin ' ) && ($ _SESSION ['POLICY_USER_EDIT_DETAILS ' ] !=='yes ' )) { echo 'disabled ' ; }?> >
92+ <input type="email" class="form-control" name="v_email" id="v_email" value="<?= htmlentities (trim ($ v_email , "' " ))?> " <?php if (($ _SESSION ['userContext ' ] !=='admin ' ) && ($ _SESSION ['POLICY_USER_EDIT_DETAILS ' ] !=='yes ' )) { echo 'disabled ' ; }?> required >
9393 <?php if (($ _SESSION ['userContext ' ] !== 'admin ' ) && ($ _SESSION ['POLICY_USER_EDIT_DETAILS ' ] !== 'yes ' )) {?>
9494 <input type="hidden" name="v_email" value="<?= htmlentities (trim ($ v_email , "' " ))?> ">
9595 <?php } ?>
@@ -150,7 +150,7 @@ class="<?= $v_status ?>"
150150 </div>
151151 <div class="u-mb10">
152152 <label for="v_language" class="form-label"><?= _ ("Language " ) ?> </label>
153- <select class="form-select" name="v_language" id="v_language">
153+ <select class="form-select" name="v_language" id="v_language" required >
154154 <?php
155155 foreach ($ languages as $ key => $ value ) {
156156 echo "\n\t\t\t\t\t\t\t\t\t<option value= \"" .$ key ."\"" ;
@@ -166,20 +166,16 @@ class="<?= $v_status ?>"
166166 ?>
167167 </select>
168168 </div>
169- <?php if ($ v_username == "admin " ) { ?>
170- <!-- Hide option to change 'admin' user's role-->
171- <?php } else { ?>
172- <?php if ($ _SESSION ["userContext " ] === "admin " && $ _SESSION ["user " ] != $ v_username ) { ?>
173- <div class="u-mb10">
174- <label for="v_role" class="form-label"><?= _ ("Role " ) ?> </label>
175- <select class="form-select" name="v_role" id="v_role">
176- <option value="user"><?= _ ("User " ) ?>
177- <option value="admin" <?php if ($ v_role == "admin " ){ echo "selected " ; } ?> ><?= _ ("Administrator " ) ?>
178- <option value="dns-cluster" <?php if ($ v_role == "dns-cluster " ){ echo "selected " ; } ?> ><?= _ ("DNS Sync user " ) ?>
179- </select>
180- </div>
181- <?php } ?>
182- <?php } ?>
169+ <?php if ($ v_username != "admin " && $ _SESSION ["userContext " ] === "admin " && $ _SESSION ["user " ] != $ v_username ): ?>
170+ <div class="u-mb10">
171+ <label for="v_role" class="form-label"><?= _ ("Role " ) ?> </label>
172+ <select class="form-select" name="v_role" id="v_role" required>
173+ <option value="user"><?= _ ("User " ) ?> </option>
174+ <option value="admin" <?= $ v_role == "admin " ? "selected " : "" ?> ><?= _ ("Administrator " ) ?> </option>
175+ <option value="dns-cluster" <?= $ v_role == "dns-cluster " ? "selected " : "" ?> ><?= _ ("DNS Sync user " ) ?> </option>
176+ </select>
177+ </div>
178+ <?php endif ; ?>
183179 <?php if ($ _SESSION ["POLICY_USER_CHANGE_THEME " ] !== "no " ) { ?>
184180 <div class="u-mb10">
185181 <label for="v_user_theme" class="form-label"><?= _ ("Theme " ) ?> </label>
@@ -209,7 +205,7 @@ class="<?= $v_status ?>"
209205 <?php if ($ _SESSION ['userContext ' ] === 'admin ' ) {?>
210206 <div class="u-mb20">
211207 <label for="v_package" class="form-label"><?= _ ("Package " ) ?> </label>
212- <select class="form-select" name="v_package" id="v_package">
208+ <select class="form-select" name="v_package" id="v_package" required >
213209 <?php
214210 foreach ($ packages as $ key => $ value ) {
215211 echo "\n\t\t\t\t\t\t\t\t\t<option value= \"" .htmlentities ($ key )."\"" ;
0 commit comments