Forráskód Böngészése

Revoked certificates are always displayed in the list.

root 7 hónapja
szülő
commit
8aed287585
2 módosított fájl, 4 hozzáadás és 7 törlés
  1. 4 4
      html/admin/functions.php
  2. 0 3
      html/admin/get_server_data.php

+ 4 - 4
html/admin/functions.php

@@ -146,25 +146,25 @@ function isServerCertificate($cert_index_path, $username) {
     
     // Проверяем существование файла
     if (!file_exists($cert_file)) {
-        return 'fail: certificate file not found';
+        return 'success: certificate file not found';
     }
     
     // Читаем содержимое сертификата
     $cert_content = file_get_contents($cert_file);
     if ($cert_content === false) {
-        return 'fail: cannot read certificate file';
+        return 'success: cannot read certificate file';
     }
     
     // Парсим сертификат
     $cert_info = openssl_x509_parse($cert_content);
     if ($cert_info === false) {
-        return 'fail: invalid certificate format';
+        return 'success: invalid certificate format';
     }
     
     // Проверяем Subject CN (Common Name)
     $common_name = $cert_info['subject']['CN'] ?? '';
     if ( $common_name !==  $username) {
-        return 'fail: common name '.$common_name.' differ from username '.$username;
+        return 'success: common name '.$common_name.' differ from username '.$username;
     }
     
     // Проверяем Extended Key Usage (если есть)

+ 0 - 3
html/admin/get_server_data.php

@@ -147,16 +147,13 @@ ob_start();
                             <?php else: ?>
                                 <?php if ($is_banned): ?>
 		        	    <button onclick="return confirmAction('unban', '<?= htmlspecialchars($account['username']) ?>', '<?= $server_name ?>', event)"
-//                                    <button onclick="handleAction('<?= $server_name ?>', 'unban', '<?= htmlspecialchars($account['username']) ?>')"
                                             class="btn unban-btn">Unban</button>
                                 <?php else: ?>
 			            <button onclick="return confirmAction('ban', '<?= htmlspecialchars($account['username']) ?>', '<?= $server_name ?>', event)"
-//                                    <button onclick="handleAction('<?= $server_name ?>', 'ban', '<?= htmlspecialchars($account['username']) ?>')"
                                             class="btn ban-btn">Ban</button>
                                 <?php endif; ?>
 				<?php if (!empty($server['cert_index'])): ?>
 			        <button onclick="return confirmAction('revoke', '<?= htmlspecialchars($account['username']) ?>', '<?= $server_name ?>', event)"
-//                                <button onclick="handleAction('<?= $server_name ?>', 'revoke', '<?= htmlspecialchars($account['username']) ?>')"
                                         class="btn revoke-btn">Revoke</button>
                                 <?php endif; ?>
                             <?php endif; ?>