From 514b019502787fb517308e26aa2fe55fda22c504 Mon Sep 17 00:00:00 2001 From: Ale32bit Date: Mon, 12 Oct 2015 16:52:11 +0200 Subject: [PATCH] Update sertexID.lua --- src/apis/sertexID.lua | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/apis/sertexID.lua b/src/apis/sertexID.lua index 6589dcc..89d8116 100644 --- a/src/apis/sertexID.lua +++ b/src/apis/sertexID.lua @@ -15,7 +15,11 @@ function status() end function login(username, password, isHashed) - local login = http.post(SERVER.."login.php", "user="..username.."&password="..password if isHashed then .."hashed=true" end).readAll() + if isHashed then + local login = http.post(SERVER.."login.php", "user="..username.."&password="..password.."&hashed=true").readAll() + else + local login = http.post(SERVER.."login.php", "user="..username.."&password="..password).readAll() + end if login == "true" then return true else @@ -24,7 +28,11 @@ function login(username, password, isHashed) end function register(username, password, isHashed) - local register = http.post(SERVER.."register.php", "user="..username.."&password="..password if isHashed then .."hashed=true" end).readAll() + if isHashed then + local register = http.post(SERVER.."register.php", "user="..username.."&password="..password.."&hashed=true").readAll() + else + local register = http.post(SERVER.."register.php", "user="..username.."&password="..password).readAll() + end if register == "Success!" then return true else @@ -42,7 +50,11 @@ function checkUser(username) end 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 isHashed then + local send = http.post(SERVER.."send.php","user="..username.."&password="..password.."&to="..to.."&message="..message.."&hashed=true").readAll() + else + local send = http.post(SERVER.."send.php","user="..username.."&password="..password.."&to="..to.."&message="..message).readAll() + end if send == "true" then return true else @@ -51,7 +63,11 @@ function sendSMS(username, password, to, msg, isHashed) end 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 isHashed then + local update = http.post(SERVER.."update.php","user="..username.."&password="..password.."&hashed=true").readAll() + else + local update = http.post(SERVER.."update.php","user="..username.."&password="..password).readAll() + end if update then return true, update else