瀏覽代碼

Add new config variable HIDE_WLAN0_CLIENT

DSR! 2 年之前
父節點
當前提交
027659e268
共有 3 個文件被更改,包括 5 次插入1 次删除
  1. 1 0
      src/pineapple/api/pineapple.php
  2. 3 0
      src/pineapple/config.php
  3. 1 1
      src/pineapple/modules/Networking/api/Interfaces.php

+ 1 - 0
src/pineapple/api/pineapple.php

@@ -138,6 +138,7 @@ function getDeviceConfig()
         'useUSBStorage' => \DeviceConfig::USE_USB_STORAGE,
         'showFirewallConfig' => \DeviceConfig::SHOW_FIREWALL_CONFIG,
         'showScanType' => \DeviceConfig::SHOW_SCAN_TYPE,
+        'hideWlan0Client' => \DeviceConfig::HIDE_WLAN0_CLIENT,
     ];
 }
 

+ 3 - 0
src/pineapple/config.php

@@ -14,4 +14,7 @@ class DeviceConfig
 
     // third party modules do not have this flag implemented
     const SHOW_SCAN_TYPE = true;
+
+    // hide wlan0 in getClientInterfaces() enumeration
+    const HIDE_WLAN0_CLIENT = true;
 }

+ 1 - 1
src/pineapple/modules/Networking/api/Interfaces.php

@@ -89,7 +89,7 @@ class Interfaces
         $clientInterfaces = [];
         exec("ifconfig -a | grep wlan | awk '{print \$1}'", $interfaceArray);
         foreach ($interfaceArray as $interface) {
-            if (substr($interface, 0, 5) === "wlan0") {
+            if (\DeviceConfig::HIDE_WLAN0_CLIENT && substr($interface, 0, 5) === "wlan0") {
                 continue;
             }
             $clientInterfaces[] = $interface;