Update sertexID.lua

This commit is contained in:
Ale32bit 2015-10-12 16:36:18 +02:00
parent c7c58586ba
commit a6be05ca8c

View file

@ -14,8 +14,8 @@ function status()
end end
end end
function login(username, password) function login(username, password, isHashed)
local login = http.post(SERVER.."login.php", "user="..username.."&password="..password).readAll() local login = http.post(SERVER.."login.php", "user="..username.."&password="..password if isHashed then .."hashed=true" end).readAll()
if login == "true" then if login == "true" then
return true return true
else else
@ -23,8 +23,8 @@ function login(username, password)
end end
end end
function register(username, password) function register(username, password, isHashed)
local register = http.post(SERVER.."register.php", "user="..username.."&password="..password).readAll() local register = http.post(SERVER.."register.php", "user="..username.."&password="..password if isHashed then .."hashed=true" end).readAll()
if register == "Success!" then if register == "Success!" then
return true return true
else else
@ -41,8 +41,8 @@ function checkUser(username)
end end
end end
function sendSMS(username, password, to, msg) function sendSMS(username, password, to, msg, isHashed)
local send = http.post(SERVER.."send.php","user="..username.."&password="..password.."&to="..to.."&message="..message).readAll() local send = http.post(SERVER.."send.php","user="..username.."&password="..password.."&to="..to.."&message="..message if isHashed then .."hashed=true" end).readAll()
if send == "true" then if send == "true" then
return true return true
else else
@ -50,6 +50,11 @@ function sendSMS(username, password, to, msg)
end end
end end
function updateSMS(username, password, all, from) function updateSMS(username, password, all, from, isHashed)
local update = http.post(SERVER.."update.php","user="..username.."&password="..password if isHashed then .."hashed=true" end).readAll()
if update then
return true, update
else
return false
end
end end