Skip to content

Commit 1fdd8dc

Browse files
author
Kristan Kenney
committed
Prevent Administrator from changing their own role
1 parent 84144a4 commit 1fdd8dc

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

web/templates/admin/edit_user.html

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,21 @@
142142
</select>
143143
</td>
144144
</tr>
145-
146-
<tr>
147-
<td class="vst-text input-label">
148-
<?php print _('Role');?>
149-
</td>
150-
</tr>
151-
<tr>
152-
<td>
153-
<select class="vst-list" name="v_role">
154-
<option value="user"><?php print _('User');?>
155-
<option value="admin" <?php if($v_role == "admin" ){ echo "selected"; } ?> ><?php print _('Administrator');?>
156-
</select>
157-
</td>
158-
</tr>
145+
<? if ($v_username !== 'admin' ) {?>
146+
<tr>
147+
<td class="vst-text input-label">
148+
<?php print _('Role');?>
149+
</td>
150+
</tr>
151+
<tr>
152+
<td>
153+
<select class="vst-list" name="v_role">
154+
<option value="user"><?php print _('User');?>
155+
<option value="admin" <?php if($v_role == "admin" ){ echo "selected"; } ?> ><?php print _('Administrator');?>
156+
</select>
157+
</td>
158+
</tr>
159+
<?}?>
159160
<tr>
160161
<td class="vst-text input-label">
161162
<?php print _('Package');?>

0 commit comments

Comments
 (0)