Fix syntax

pull/8207/head
Mel-kior 3 years ago committed by Frans de Jonge
parent 3001efb85f
commit 9e55e4da3d

@ -59,7 +59,7 @@ end
--- Authenticates network. --- Authenticates network.
function WpaSupplicant:authenticateNetwork(network) function WpaSupplicant:authenticateNetwork(network)
local err, wcli, nw_id local err, wcli, nw_id
wcli, err = WpaClient.new(self.wpa_supplicant.ctrl_interface) wcli, err = WpaClient.new(self.wpa_supplicant.ctrl_interface)
if not wcli then if not wcli then
return false, T(CLIENT_INIT_ERR_MSG, err) return false, T(CLIENT_INIT_ERR_MSG, err)
@ -74,7 +74,7 @@ function WpaSupplicant:authenticateNetwork(network)
return false, _("An error occurred while selecting network.") return false, _("An error occurred while selecting network.")
end end
-- if password is empty its an open AP -- if password is empty its 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") re = wcli:setNetwork(nw_id, "key_mgmt", "NONE")
if re == "FAIL" then if re == "FAIL" then
wcli:removeNetwork(nw_id) wcli:removeNetwork(nw_id)

@ -266,7 +266,7 @@ end
function NetworkItem:saveAndConnectToNetwork(password_input) function NetworkItem:saveAndConnectToNetwork(password_input)
local new_passwd = password_input:getInputText() local new_passwd = password_input:getInputText()
-- Dont set a empty password if WPA encryption, go through if its an open AP -- Dont set a empty password if WPA encryption, go through if its 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{ UIManager:show(InfoMessage:new{
text = _("Password cannot be empty."), text = _("Password cannot be empty."),
}) })

Loading…
Cancel
Save