<?php
require_once "../inc/common.php";
-require_once "../inc/connection.php";
require_once "../inc/header.php";
+require_once "../inc/connection.php";
+$can_rehash = current_user_can(PERMISSION_REHASH);
$rehash_errors = [];
$rehash_warnings = [];
$rehash_success = [];
if (!empty($_POST))
{
do_log($_POST);
- if (isset($_POST['rehash']))
+ if (isset($_POST['rehash']) && $can_rehash)
foreach ($_POST['serverch'] as $servID)
if ($response = $rpc->server()->rehash($servID))
{
<table class="container-xxl table table-sm table-responsive caption-top table-striped">
- <thead>
+ <thead class="table-primary">
<th scope="col"><h5>Filter:</h5></th>
<form action="" method="post">
<th scope="col" colspan="2">Name: <input name="sf_name" type="text" class="short-form-control">
<th scope="col"> <input class="btn btn-primary btn-sm" type="submit" value="Search"></th></form>
</thead></table>
<form action="index.php" method="post">
- <div class="btn btn-sm btn-warning" data-toggle="modal" data-target="#rehash_modal"><i class="fa-solid fa-arrows-rotate"></i> Rehash Selected</div>
+ <div class="btn btn-sm btn-warning <?php echo $can_rehash ? "" : "disabled" ?>" data-toggle="modal" data-target="#rehash_modal"><i class="fa-solid fa-arrows-rotate"></i> Rehash Selected</div>
<button name="checkforupdates" type="submit" class="btn btn-sm btn-info"><i class="fa-solid fa-cloud-arrow-down"></i> Check for upgrades</div><br>
<div class="modal fade" id="rehash_modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">