2015-09-03 18:27:09 +02:00
|
|
|
--[[
|
|
|
|
Sertex ID API - Made by Ale2610
|
|
|
|
PHP by Luca_S
|
|
|
|
]]--
|
|
|
|
|
|
|
|
local SERVER = "http://sertex.esy.es/"
|
|
|
|
|
|
|
|
function status()
|
|
|
|
local isUp = http.get(SERVER.."status.php").readAll()
|
|
|
|
if isUp == "true" then
|
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-10-12 16:36:18 +02:00
|
|
|
function login(username, password, isHashed)
|
2015-10-12 16:52:11 +02:00
|
|
|
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
|
2015-09-03 18:27:09 +02:00
|
|
|
if login == "true" then
|
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
2015-09-03 18:33:21 +02:00
|
|
|
|
2015-10-12 16:36:18 +02:00
|
|
|
function register(username, password, isHashed)
|
2015-10-12 16:52:11 +02:00
|
|
|
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
|
2015-09-03 18:33:21 +02:00
|
|
|
if register == "Success!" then
|
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false, register
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function checkUser(username)
|
|
|
|
local check = http.post(SERVER.."check.php", "user="..username).readAll()
|
|
|
|
if check == "true" then
|
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-10-12 16:36:18 +02:00
|
|
|
function sendSMS(username, password, to, msg, isHashed)
|
2015-10-12 16:52:11 +02:00
|
|
|
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
|
2015-10-04 21:10:10 +02:00
|
|
|
if send == "true" then
|
2015-09-21 23:29:37 +02:00
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false,send
|
|
|
|
end
|
2015-09-03 18:33:21 +02:00
|
|
|
end
|
|
|
|
|
2015-10-12 16:36:18 +02:00
|
|
|
function updateSMS(username, password, all, from, isHashed)
|
2015-10-12 16:52:11 +02:00
|
|
|
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
|
2015-10-12 16:36:18 +02:00
|
|
|
if update then
|
|
|
|
return true, update
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
2015-09-03 18:33:21 +02:00
|
|
|
end
|