mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Remove legacy auth usage of $_SESSION (#10491)
* Remove auth use of $_SESSION Will break plugins that depend on $_SESSION, Weathermap was already fixed. Port them to use Auth::check()/Auth::user()/Auth:id() * revert accidental replacement
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
use LibreNMS\Alerting\QueryBuilderParser;
|
||||
use LibreNMS\Authentication\LegacyAuth;
|
||||
|
||||
$no_refresh = true;
|
||||
|
||||
@@ -75,7 +74,7 @@ echo '<div class="table-responsive">
|
||||
</tr>';
|
||||
|
||||
echo '<td colspan="7">';
|
||||
if (LegacyAuth::user()->hasGlobalAdmin()) {
|
||||
if (Auth::user()->hasGlobalAdmin()) {
|
||||
echo '<button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#create-alert" data-device_id="'.$device['device_id'].'"><i class="fa fa-plus"></i> Create new alert rule</button>';
|
||||
echo '<i> - OR - </i>';
|
||||
echo '<button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#search_rule_modal" data-device_id="'.$device['device_id'].'"><i class="fa fa-plus"></i> Create rule from collection</button>';
|
||||
@@ -193,13 +192,13 @@ foreach (dbFetchRows($full_query, $param) as $rule) {
|
||||
|
||||
echo '<td><small>Max: '.$rule_extra['count'].'<br />Delay: '.$rule_extra['delay'].'<br />Interval: '.$rule_extra['interval'].'</small></td>';
|
||||
echo '<td>';
|
||||
if (LegacyAuth::user()->hasGlobalAdmin()) {
|
||||
if (Auth::user()->hasGlobalAdmin()) {
|
||||
echo "<input id='".$rule['id']."' type='checkbox' name='alert-rule' data-orig_class='".$orig_class."' data-orig_colour='".$orig_col."' data-orig_state='".$orig_ico."' data-alert_id='".$rule['id']."' ".$alert_checked." data-size='small' data-content='".$popover_msg."' data-toggle='modal'>";
|
||||
}
|
||||
|
||||
echo '</td>';
|
||||
echo '<td>';
|
||||
if (LegacyAuth::user()->hasGlobalAdmin()) {
|
||||
if (Auth::user()->hasGlobalAdmin()) {
|
||||
echo "<div class='btn-group btn-group-sm' role='group'>";
|
||||
echo "<button type='button' class='btn btn-primary' data-toggle='modal' data-target='#create-alert' data-rule_id='".$rule['id']."' name='edit-alert-rule' data-content='".$popover_msg."' data-container='body'><i class='fa fa-lg fa-pencil' aria-hidden='true'></i></button> ";
|
||||
echo "<button type='button' class='btn btn-danger' aria-label='Delete' data-toggle='modal' data-target='#confirm-delete' data-alert_id='".$rule['id']."' name='delete-alert-rule' data-content='".$popover_msg."' data-container='body'><i class='fa fa-lg fa-trash' aria-hidden='true'></i></button>";
|
||||
@@ -222,7 +221,7 @@ echo '</table>
|
||||
</div>';
|
||||
|
||||
if ($count < 1) {
|
||||
if (LegacyAuth::user()->hasGlobalAdmin()) {
|
||||
if (Auth::user()->hasGlobalAdmin()) {
|
||||
echo '<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<form role="form" method="post">
|
||||
|
Reference in New Issue
Block a user