Преглед на файлове

The currently active ones have been removed from the general list of clients

root преди 8 месеца
родител
ревизия
941c9b8665
променени са 3 файла, в които са добавени 7 реда и са изтрити 5 реда
  1. 1 2
      functions.php
  2. 5 3
      get_server_data.php
  3. 1 0
      index.php

+ 1 - 2
functions.php

@@ -242,7 +242,6 @@ function getBannedClients($server, $active_clients) {
 
 function isClientActive($active_clients,$username) {
     $active_names = array_column($active_clients, 'name');
-    if (!empty($active_names[$username])) { return true; }
+    if (in_array($username,$active_names)) { return true; }
     return false;
 }
-

+ 5 - 3
get_server_data.php

@@ -95,7 +95,7 @@ ob_start();
 <div class="section">
     <div class="spoiler">
         <div class="spoiler-title collapsed" onclick="toggleSpoiler(this)">
-            Account List (<?= count($accounts) ?>)
+            Configured Account List (<?= count($accounts) ?>)
         </div>
         <div class="spoiler-content">
             <table>
@@ -108,13 +108,15 @@ ob_start();
                     </tr>
                 </thead>
                 <tbody>
-                    <?php foreach ($accounts as $account): ?>
+                    <?php foreach ($accounts as $account):
+		    if (isClientActive($clients,$account["username"])) { continue; }
+		    ?>
                     <tr>
                         <td><?= htmlspecialchars($account["username"]) ?></td>
                         <td><?= htmlspecialchars($account['ip'] ?? 'N/A') ?></td>
                         <td>
                             <span class="status-badge <?= $account['banned'] ? 'status-banned' : 'status-active' ?>">
-                                <?= $account['banned'] ? 'BANNED' : 'ACTIVE' ?>
+                                <?= $account['banned'] ? 'BANNED' : 'ENABLED' ?>
                             </span>
                         </td>
                         <td class="actions">

+ 1 - 0
index.php

@@ -165,5 +165,6 @@ if (!isset($_SESSION['last_request_time']) || !is_array($_SESSION['last_request_
             }
         }
     </script>
+
 </body>
 </html>