Skip to content

Commit

Permalink
Bugfix: User see site links even if they have no permission (Open-Web…
Browse files Browse the repository at this point in the history
…-Analytics#465)

* Bugfix: User see site links even if they have no permission

* Fixed: Wrong copied code

* Revert "Fixed: Wrong copied code"

This reverts commit b45cb07

* Revert "Bugfix: User see site links even if they have no permission"

This reverts commit c3885de

* Bugfix: User see site links even if they have no permission
  • Loading branch information
Maaiins authored Mar 7, 2020
1 parent 7771c86 commit 45f47df
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
8 changes: 6 additions & 2 deletions modules/base/templates/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
&nbsp
<span class="owa_navigation">
<UL>
<LI><a href="<?php echo $this->makeLink(array('do' => 'base.sites'));?>">Reporting</a></LI>
<LI><a href="<?php echo $this->makeLink(array('do' => 'base.optionsGeneral'));?>">Administration</a></LI>
<?php if ($this->getCurrentUser()->isCapable('view_site_list')): ?>
<LI><a href="<?php echo $this->makeLink(array('do' => 'base.sites'));?>">Reporting</a></LI>
<?php endif; ?>
<?php if ($this->getCurrentUser()->isCapable('edit_settings')): ?>
<LI><a href="<?php echo $this->makeLink(array('do' => 'base.optionsGeneral'));?>">Administration</a></LI>
<?php endif; ?>
<LI><a href="http://wiki.openwebanalytics.com">Help</a></LI>
<LI><a href="http://trac.openwebanalytics.com">Report a Bug</a></LI>

Expand Down
5 changes: 4 additions & 1 deletion modules/base/templates/report_goal_funnel.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@
}
</script>
<?php else: ?>
No Funnel has been configured for this goal. <a href="<?php echo $this->makeLink(array('do' => 'base.optionsGoalEntry', 'goal_number' => $goal_number, 'siteId' => $params['siteId']));?>">Add a funnel</a>
No Funnel has been configured for this goal.
<?php if ($this->getCurrentUser()->isCapable('edit_settings')): ?>
<a href="<?php echo $this->makeLink(array('do' => 'base.optionsGoalEntry', 'goal_number' => $goal_number, 'siteId' => $params['siteId']));?>">Add a funnel</a>
<?php endif; ?>
<?php endif;?>

<script>
Expand Down
28 changes: 19 additions & 9 deletions modules/base/templates/sites.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

<P>Below is the list of web sites that are being tracked.</P>


<p class="inline_h2"><a href="<?php echo $this->makeLink(array('do' => 'base.sitesProfile'));?>">Add New</a></p>
<?php if ($this->getCurrentUser()->isCapable('edit_sites')): ?>
<p class="inline_h2"><a href="<?php echo $this->makeLink(array('do' => 'base.sitesProfile'));?>">Add New</a></p>
<?php endif; ?>

<?php if ($tracked_sites): ?>
<?php foreach ($tracked_sites as $site):?>
Expand All @@ -25,12 +26,17 @@
<?php endif;?>
<span class="externalUrl"><?php $this->out( $site->get('domain') );?></span><BR><BR>
<div>
<a href="<?php echo $this->makeLink( array('do' => 'base.reportDashboard', 'siteId' => $site->get('site_id') ), true );?>">View Reports</a> |
<a href="<?php echo $this->makeLink( array('do' => 'base.sitesProfile', 'siteId' => $site->get('site_id'), 'edit' => true ) );?>">Edit Profile</a> |
<a href="<?php echo $this->makeLink( array('do' => 'base.sitesInvocation', 'siteId' => $site->get('site_id') ) );?>">Get Tracking Code</a> |
<a href="<?php echo $this->makeLink( array('do' => 'base.optionsGoals', 'siteId' => $site->get('site_id') ) );?>">Goals</a>
|
<a href="<?php echo $this->makeLink( array('do' => 'base.sitesDelete', 'siteId' => $site->get('site_id') ), false, false, false, true );?>">Delete</a>
<a href="<?php echo $this->makeLink( array('do' => 'base.reportDashboard', 'siteId' => $site->get('site_id') ), true );?>">View Reports</a>
<?php if ($this->getCurrentUser()->isCapable('edit_sites')): ?>
| <a href="<?php echo $this->makeLink( array('do' => 'base.sitesProfile', 'siteId' => $site->get('site_id'), 'edit' => true ) );?>">Edit Profile</a>
| <a href="<?php echo $this->makeLink( array('do' => 'base.sitesInvocation', 'siteId' => $site->get('site_id') ) );?>">Get Tracking Code</a>
<?php endif; ?>
<?php if ($this->getCurrentUser()->isCapable('edit_settings')): ?>
<a href="<?php echo $this->makeLink( array('do' => 'base.optionsGoals', 'siteId' => $site->get('site_id') ) );?>">Goals</a>
<?php endif; ?>
<?php if ($this->getCurrentUser()->isCapable('edit_sites')): ?>
| <a href="<?php echo $this->makeLink( array('do' => 'base.sitesDelete', 'siteId' => $site->get('site_id') ), false, false, false, true );?>">Delete</a>
<?php endif; ?>
</div>
</td>
<td>
Expand Down Expand Up @@ -65,6 +71,10 @@
<?php endforeach;?>
<?php else: ?>

There are no tracked sites. <a href="<?php echo $this->makeLink(array('do' => 'base.sitesProfile'));?>">Add a site</a>.</TD>
There are no tracked sites.
<?php if ($this->getCurrentUser()->isCapable('edit_sites')): ?>
<a href="<?php echo $this->makeLink(array('do' => 'base.sitesProfile'));?>">Add a site</a>.
<?php endif; ?>
</TD>

<?php endif;?>

0 comments on commit 45f47df

Please sign in to comment.