Skip to content

Commit

Permalink
Fixes #5045 - Removed inline editing for when only "Quick Add User" h…
Browse files Browse the repository at this point in the history
…as been granted, and removed adding of admin perms to avoid access escalation.
  • Loading branch information
CaMer0n committed Aug 22, 2023
1 parent 9949a29 commit abf94d0
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions e107_admin/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,12 @@ function init()
if(!getperms('4|U0')) // Quick Add User Access Only.
{
unset($this->fields['checkboxes']);
unset($this->fields['options']);
unset($this->fields['options']);
foreach($this->fields as $fld=>$val)
{
$this->fields[$fld]['inline'] = false;
}

}

$this->fields['user_image']['writeParms'] = $this->getAvatarList();
Expand Down Expand Up @@ -1679,22 +1684,24 @@ function AddPage()
}

// Make Admin.
$text .= "
<tr>
<td>".USRLAN_35."</td>
<td>
<a href='#set_perms' class='btn btn-default btn-secondary e-expandit'>".USRLAN_243."</a>
<div class='e-hideme' id='set_perms'>
";

$text .= $prm->renderPermTable('grouped');
if(getperms('4|U0')) // Quick Add User access should not be allowed to create new users with escalated perms.
{
$text .= "
<tr>
<td>".USRLAN_35."</td>
<td>
<a href='#set_perms' class='btn btn-default btn-secondary e-expandit'>".USRLAN_243."</a>
<div class='e-hideme' id='set_perms'>
";

$text .= "
</div>
</td>
</tr>
";
$text .= $prm->renderPermTable('grouped');

$text .= "
</div>
</td>
</tr>
";
}

$text .= "
Expand Down

0 comments on commit abf94d0

Please sign in to comment.