mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix syntax
This commit is contained in:
@@ -59,7 +59,7 @@ end
|
||||
--- Authenticates network.
|
||||
function WpaSupplicant:authenticateNetwork(network)
|
||||
local err, wcli, nw_id
|
||||
|
||||
|
||||
wcli, err = WpaClient.new(self.wpa_supplicant.ctrl_interface)
|
||||
if not wcli then
|
||||
return false, T(CLIENT_INIT_ERR_MSG, err)
|
||||
@@ -74,7 +74,7 @@ function WpaSupplicant:authenticateNetwork(network)
|
||||
return false, _("An error occurred while selecting network.")
|
||||
end
|
||||
-- if password is empty it’s an open AP
|
||||
if network.password and (network.password == nil or string.len(network.password) == 0) then -- Open AP
|
||||
if network.password and #network.password == 0 then -- Open AP
|
||||
re = wcli:setNetwork(nw_id, "key_mgmt", "NONE")
|
||||
if re == "FAIL" then
|
||||
wcli:removeNetwork(nw_id)
|
||||
|
||||
@@ -266,7 +266,7 @@ end
|
||||
function NetworkItem:saveAndConnectToNetwork(password_input)
|
||||
local new_passwd = password_input:getInputText()
|
||||
-- Dont set a empty password if WPA encryption, go through if it’s an open AP
|
||||
if (new_passwd == nil or string.len(new_passwd) == 0) and string.find(self.info.flags, "WPA") then
|
||||
if (new_passwd == nil or #new_passwd == 0) and string.find(self.info.flags, "WPA") then
|
||||
UIManager:show(InfoMessage:new{
|
||||
text = _("Password cannot be empty."),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user