Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Services/Grapher/Graph/CoreBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function authorise(): bool
return false;
}

if( !Auth::check() && is_numeric( config( 'grapher.access.trunk' ) ) && config( 'grapher.access.trunk' ) === User::AUTH_PUBLIC ) {
if( !Auth::check() && is_numeric( config( 'grapher.access.trunk' ) ) && (int)config( 'grapher.access.trunk' ) === User::AUTH_PUBLIC ) {
return $this->allow();
}

Expand Down
4 changes: 2 additions & 2 deletions app/Services/Grapher/Graph/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public static function authorisedForAllCustomers(): bool
return true;
}

if( !Auth::check() && is_numeric( config( 'grapher.access.customer' ) ) && config( 'grapher.access.customer' ) === User::AUTH_PUBLIC ) {
if( !Auth::check() && is_numeric( config( 'grapher.access.customer' ) ) && (int)config( 'grapher.access.customer' ) === User::AUTH_PUBLIC ) {
return true;
}

Expand All @@ -153,7 +153,7 @@ public function authorise(): bool
$us = Auth::getUser();

// NB: see above authorisedForAllCustomers()
if( is_numeric( config( 'grapher.access.customer' ) ) && config( 'grapher.access.customer' ) === User::AUTH_PUBLIC ) {
if( is_numeric( config( 'grapher.access.customer' ) ) && (int)config( 'grapher.access.customer' ) === User::AUTH_PUBLIC ) {
return $this->allow();
}

Expand Down
4 changes: 2 additions & 2 deletions app/Services/Grapher/Graph/Latency.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public static function authorisedForAllCustomers(): bool
return true;
}

if( !Auth::check() && is_numeric( config( 'grapher.access.latency' ) ) && config( 'grapher.access.latency' ) === User::AUTH_PUBLIC ) {
if( !Auth::check() && is_numeric( config( 'grapher.access.latency' ) ) && (int)config( 'grapher.access.latency' ) === User::AUTH_PUBLIC ) {
return true;
}

Expand All @@ -264,7 +264,7 @@ public function authorise(): bool
$us = Auth::getUser();

// NB: see above authorisedForAllCustomers()
if( is_numeric( config( 'grapher.access.latency' ) ) && config( 'grapher.access.latency' ) === User::AUTH_PUBLIC ) {
if( is_numeric( config( 'grapher.access.latency' ) ) && (int)config( 'grapher.access.latency' ) === User::AUTH_PUBLIC ) {
return $this->allow();
}

Expand Down
2 changes: 1 addition & 1 deletion app/Services/Grapher/Graph/P2p.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function authorise(): bool
$us = Auth::getUser();

// NB: see above authorisedForAllCustomers()
if( is_numeric( config( 'grapher.access.p2p' ) ) && config( 'grapher.access.p2p' ) === User::AUTH_PUBLIC ) {
if( is_numeric( config( 'grapher.access.p2p' ) ) && (int)config( 'grapher.access.p2p' ) === User::AUTH_PUBLIC ) {
return $this->allow();
}

Expand Down
2 changes: 1 addition & 1 deletion app/Services/Grapher/Graph/PhysicalInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function authorise(): bool
/** @var User $us */
$us = Auth::getUser();

if( is_numeric( config( 'grapher.access.customer' ) ) && config( 'grapher.access.customer' ) === User::AUTH_PUBLIC ) {
if( is_numeric( config( 'grapher.access.customer' ) ) && (int)config( 'grapher.access.customer' ) === User::AUTH_PUBLIC ) {
return $this->allow();
}

Expand Down
2 changes: 1 addition & 1 deletion app/Services/Grapher/Graph/VirtualInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function authorise(): bool
/** @var User $us */
$us = Auth::getUser();

if( is_numeric( config( 'grapher.access.customer' ) ) && config( 'grapher.access.customer' ) === User::AUTH_PUBLIC ) {
if( is_numeric( config( 'grapher.access.customer' ) ) && (int)config( 'grapher.access.customer' ) === User::AUTH_PUBLIC ) {
return $this->allow();
}

Expand Down
4 changes: 2 additions & 2 deletions resources/views/layouts/menus/associate.foil.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@
</a>
<?php endif; ?>

<?php if( is_numeric( config( 'grapher.access.location' ) ) && config( 'grapher.access.location' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<?php if( is_numeric( config( 'grapher.access.location' ) ) && (int)config( 'grapher.access.location' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<a class="dropdown-item <?= !request()->is( 'statistics/location' ) ?: 'active' ?>" href="<?= route('statistics@location' ) ?>">
Facility Graphs
</a>
<?php endif; ?>

<?php if( is_numeric( config( 'grapher.access.trunk' ) ) && config( 'grapher.access.trunk' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<?php if( is_numeric( config( 'grapher.access.trunk' ) ) && (int)config( 'grapher.access.trunk' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<?php if( count( config( 'grapher.backends.mrtg.trunks' ) ?? [] ) ): ?>
<a class="dropdown-item <?= !request()->is( 'statistics/trunk*' ) ?: 'active' ?>" href="<?= route('statistics@trunk') ?>">
Inter-Switch / PoP Graphs
Expand Down
12 changes: 6 additions & 6 deletions resources/views/layouts/menus/public.foil.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,31 +55,31 @@
Statistics
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<?php if( is_numeric( config( 'grapher.access.ixp' ) ) && config( 'grapher.access.ixp' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<?php if( is_numeric( config( 'grapher.access.ixp' ) ) && (int)config( 'grapher.access.ixp' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<a class="dropdown-item <?= !request()->is( 'statistics/ixp*' ) ?: 'active' ?>" href="<?= route( 'statistics@ixp' ) ?>">
Overall Peering Graphs
</a>
<?php endif; ?>

<?php if( is_numeric( config( 'grapher.access.infrastructure' ) ) && config( 'grapher.access.infrastructure' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<?php if( is_numeric( config( 'grapher.access.infrastructure' ) ) && (int)config( 'grapher.access.infrastructure' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<a class="dropdown-item <?= !request()->is( 'statistics/infrastructure*' ) ?: 'active' ?>" href="<?= route( 'statistics@infrastructure' ) ?>">
Infrastructure Graphs
</a>
<?php endif; ?>

<?php if( is_numeric( config( 'grapher.access.vlan' ) ) && config( 'grapher.access.vlan' ) === \IXP\Models\User::AUTH_PUBLIC && config( 'grapher.backends.sflow.enabled' ) ): ?>
<?php if( is_numeric( config( 'grapher.access.vlan' ) ) && (int)config( 'grapher.access.vlan' ) === \IXP\Models\User::AUTH_PUBLIC && config( 'grapher.backends.sflow.enabled' ) ): ?>
<a class="dropdown-item <?= !request()->is( 'statistics/vlan*' ) ?: 'active' ?>" href="<?= route( 'statistics@vlan' ) ?>">
VLAN / Per-Protocol Graphs
</a>
<?php endif; ?>

<?php if( is_numeric( config( 'grapher.access.location' ) ) && config( 'grapher.access.location' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<?php if( is_numeric( config( 'grapher.access.location' ) ) && (int)config( 'grapher.access.location' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<a class="dropdown-item <?= !request()->is( 'statistics/location' ) ?: 'active' ?>" href="<?= route('statistics@location' ) ?>">
Facility Graphs
</a>
<?php endif; ?>

<?php if( is_numeric( config( 'grapher.access.trunk' ) ) && config( 'grapher.access.trunk' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<?php if( is_numeric( config( 'grapher.access.trunk' ) ) && (int)config( 'grapher.access.trunk' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<?php if( count( config( 'grapher.backends.mrtg.trunks' ) ?? [] ) ): ?>
<a class="dropdown-item <?= !request()->is( 'statistics/trunk*' ) ?: 'active' ?>" href="<?= route('statistics@trunk') ?>">
Inter-Switch / PoP Graphs
Expand All @@ -91,7 +91,7 @@
<?php endif; ?>
<?php endif; ?>

<?php if( is_numeric( config( 'grapher.access.switch' ) ) && config( 'grapher.access.switch' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<?php if( is_numeric( config( 'grapher.access.switch' ) ) && (int)config( 'grapher.access.switch' ) === \IXP\Models\User::AUTH_PUBLIC ): ?>
<a class="dropdown-item <?= !request()->is( 'statistics/switch' ) ?: 'active' ?>" href="<?= route('statistics@switch') ?>">
Switch Aggregate Graphs
</a>
Expand Down