Skip to content
Permalink
Browse files

Audit Plugin HTML Injection

This commit uses a signal to inject HTML for the plugin.
  • Loading branch information...
aydreeihn committed Sep 23, 2019
1 parent 59e5d71 commit 203c716b7d61833f2152708743e6b36d3cb9df6f
Showing with 7 additions and 57 deletions.
  1. +2 −16 include/staff/staff.inc.php
  2. +1 −13 include/staff/ticket-view.inc.php
  3. +4 −28 include/staff/user-view.inc.php
@@ -35,13 +35,6 @@
}
$extras = new ArrayObject();
Signal::send('agent.audit', $staff, $extras);
foreach ($extras as $extra) {
$tabTitle = str_replace('-', ' ', $extra['tab']);
}
$audit = true;
?>

<form action="staff.php?<?php echo Http::build_query($qs); ?>" method="post" class="save" autocomplete="off">
@@ -61,8 +54,7 @@
<li><a href="#access"><?php echo __('Access'); ?></a></li>
<li><a href="#permissions"><?php echo __('Permissions'); ?></a></li>
<li><a href="#teams"><?php echo __('Teams'); ?></a></li>
<?php if ($audit) { ?>
<li> <a href="#<?php echo $extra['tab']; ?>"><?php echo __(ucwords($tabTitle)); ?></a></li> <?php } ?>
<?php Signal::send('agenttab.audit', $staff, $extras); ?>
</ul>

<div class="tab_content" id="account">
@@ -454,13 +446,7 @@ class="error">*</span></div>
</div>

<!-- ============== Audits =================== -->
<?php if (PluginManager::auditPlugin()) { ?>
<div class="hidden tab_content" id=<?php echo $extra['tab']; ?>>
<?php
include $extra['url'];
?>
</div>
<?php } ?>
<?php Signal::send('agent.audit', $staff, $extras); ?>

<p style="text-align:center;">
<input type="submit" name="submit" value="<?php echo $submit_text; ?>">
@@ -263,19 +263,7 @@ class="icon-group"></i> <?php echo __('Team'); ?></a>
<?php
}
}
if (PluginManager::auditPlugin()) {
$extras = new ArrayObject();
Signal::send('ticket.view.more', $ticket, $extras);
foreach ($extras as $li) {
?><li><a href="#<?php echo $li['url']; ?>"
onclick="javascript:
$.dialog($(this).attr('href').substr(1), 201);
return false;"
><i class="<?php echo $li['icon'] ?: 'icon-cogs'; ?>"></i>
<?php echo $li['name'] ?: (string) $li; ?>
</a></li>
<?php }
}
Signal::send('ticket.view.more', $ticket, $extras);
if ($role->hasPerm(Ticket::PERM_DELETE)) {
?>
<li class="danger"><a class="ticket-action" href="#tickets/<?php
@@ -3,8 +3,7 @@
$account = $user->getAccount();
$org = $user->getOrganization();
$extras = new ArrayObject();
?>
<table width="940" cellpadding="2" cellspacing="0" border="0">
<tr>
@@ -70,24 +69,7 @@ class="icon-lock"></i>
return false"
><i class="icon-paste"></i>
<?php echo __('Manage Forms'); ?></a></li>
<?php }
if (PluginManager::auditPlugin()) {
$extras = new ArrayObject();
Signal::send('user.view.more', $user, $extras);
foreach ($extras as $extra) {
$tabTitle = str_replace('-', ' ', $extra['tab']);
}
foreach ($extras as $li) {
?><li><a href="#<?php echo $li['url']; ?>"
onclick="javascript:
$.dialog($(this).attr('href').substr(1), 201);
return false"
><i class="<?php echo $li['icon'] ?: 'icon-cogs'; ?>"></i>
<?php echo $li['name'] ?: (string) $li; ?>
</a></li>
<?php }
} ?>
<?php } ?>
</ul>
</div>
</td>
@@ -167,8 +149,7 @@ class="icon-edit"></i>
class="icon-list-alt"></i>&nbsp;<?php echo __('Tickets'); ?></a></li>
<li><a href="#notes"><i
class="icon-pushpin"></i>&nbsp;<?php echo __('Notes'); ?></a></li>
<?php if (PluginManager::auditPlugin()) { ?>
<li> <a href="#<?php echo $extra['tab']; ?>"><?php echo __(ucwords($tabTitle)); ?></a></li> <?php } ?>
<?php Signal::send('usertab.audit', $user, $extras); ?>
</ul>
<div id="user-view-tabs_container">
<div id="tickets" class="tab_content">
@@ -184,12 +165,7 @@ class="icon-pushpin"></i>&nbsp;<?php echo __('Notes'); ?></a></li>
include STAFFINC_DIR . 'templates/notes.tmpl.php';
?>
</div>

<div class="hidden tab_content" id=<?php echo $extra['tab']; ?>>
<?php
include $extra['url'];
?>
</div>
<?php Signal::send('user.audit', $user, $extras); ?>
</div>
<div class="hidden dialog" id="confirm-action">
<h3><?php echo __('Please Confirm'); ?></h3>

0 comments on commit 203c716

Please sign in to comment.
You can’t perform that action at this time.