Explorar el Código

Add new config variable HIDE_WLAN0_CLIENT

DSR! hace 2 años
padre
commit
027659e268

+ 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;