From a6be05ca8c577eb1a2fca5436e54e558a815d63e Mon Sep 17 00:00:00 2001 From: Ale32bit Date: Mon, 12 Oct 2015 16:36:18 +0200 Subject: [PATCH] Update sertexID.lua --- src/apis/sertexID.lua | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/apis/sertexID.lua b/src/apis/sertexID.lua index 7f9b0e4..6589dcc 100644 --- a/src/apis/sertexID.lua +++ b/src/apis/sertexID.lua @@ -14,8 +14,8 @@ function status() end end -function login(username, password) - local login = http.post(SERVER.."login.php", "user="..username.."&password="..password).readAll() +function login(username, password, isHashed) + local login = http.post(SERVER.."login.php", "user="..username.."&password="..password if isHashed then .."hashed=true" end).readAll() if login == "true" then return true else @@ -23,8 +23,8 @@ function login(username, password) end end -function register(username, password) - local register = http.post(SERVER.."register.php", "user="..username.."&password="..password).readAll() +function register(username, password, isHashed) + local register = http.post(SERVER.."register.php", "user="..username.."&password="..password if isHashed then .."hashed=true" end).readAll() if register == "Success!" then return true else @@ -41,8 +41,8 @@ function checkUser(username) end end -function sendSMS(username, password, to, msg) - local send = http.post(SERVER.."send.php","user="..username.."&password="..password.."&to="..to.."&message="..message).readAll() +function sendSMS(username, password, to, msg, isHashed) + 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 return true else @@ -50,6 +50,11 @@ function sendSMS(username, password, to, msg) 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