Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Website Data retrieval

Bobbyb30 Zohari
SL Mentor Coach
Join date: 11 Nov 2006
Posts: 466
02-25-2008 14:48
What is the are some examples of secure data retrieval off a website beside the basic authentication methd( user:passwrod@domain.com)


It also seems that the passwords are limited to 8 characters, is there a way to lengthen the password?

I am looking to host this myself, so I'm looking for some php/lsl code for a simple secure request.
_____________________
Bobbyb30 Zohari
SL Mentor Coach
Join date: 11 Nov 2006
Posts: 466
02-25-2008 15:40
I'm more or less looking on how to have a basic web storage site.
_____________________
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
02-25-2008 16:12
I've been using w-hat's httpdb, but haven't tried exceeding 8 characters in the password.

If no one else has any clear insight into the matter then try sending off a query to Masakazu Kojima, who will know for sure, one way or the other.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Bobbyb30 Zohari
SL Mentor Coach
Join date: 11 Nov 2006
Posts: 466
02-25-2008 16:28
From: Jesse Barnett
I've been using w-hat's httpdb, but haven't tried exceeding 8 characters in the password.

If no one else has any clear insight into the matter then try sending off a query to Masakazu Kojima, who will know for sure, one way or the other.


I'll try that, thnx.
_____________________
Wildefire Walcott
Heartbreaking
Join date: 8 Nov 2005
Posts: 2,156
02-25-2008 16:48
From: Jesse Barnett
I've been using w-hat's httpdb

Where does one get this?

EDIT: Found it- OMG that's cool.
_____________________
Desperation Isle Estates: Great prices, great neighbors, great service!
http://desperationisle.blogspot.com/

New Desperation Isle: The prettiest BDSM Playground and Fetish Mall in SL!
http://desperationisle.com/

Desperation Isle Productions: Skyboxes for lots (and budgets) of all sizes!
Alicia Sautereau
if (!social) hide;
Join date: 20 Feb 2007
Posts: 3,125
02-25-2008 17:20
CODE

integer LINK_TERM = 10101010;
integer LINK_PROC = 10101011;
integer LINK_COMM = 10101012;

string kl_send(string post_option)
{
if (main_server)
{
requestid = llHTTPRequest(main, [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"], (string)post_option);
} else {
requestid = llHTTPRequest(backup, [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"], (string)post_option);
}
kl_post = "";
if (DEBUG_post)
{
if (main_server)
{
llSay(0, "Main: "+ DEBUG_POST);
} else {
llSay(0, "Backup: "+ DEBUG_POST);
}
DEBUG_POST = "";
} else {
DEBUG_POST = "";
}
return requestid;
}

string kl_clean(string body)
{
integer clean = 0;
string cleanbody;

while(llGetSubString(body ,clean,clean))
{
cleanbody += llGetSubString(body,clean,clean++);
}

kl_body = cleanbody;

return kl_body;
}

string kl_add(string variable, string value)
{
string name = variable;
string message = value;
if (kl_post == "")
{
DEBUG_POST += llEscapeURL(variable) + "=" + llEscapeURL(value);
kl_post += llEscapeURL(name) + "=" + llEscapeURL(message);
} else {
DEBUG_POST += "&" + llEscapeURL(variable) + "=" + llEscapeURL(value);
kl_post += "&" + llEscapeURL(name) + "=" + llEscapeURL(message);
}
return kl_post;
}

string kl_list(integer i)
{
list split = llParseString2List(kl_body, ["|"],[]);
cmd = llList2String(split, i);
return cmd;
}
//////////////// END Functions \\\\\\\\\\\\\\\\

key requestid;
integer main_server = TRUE;
string main = "http://mainserver/file.php";
string backup = "http://backupserver/file.php";
string kl_body;
string kl_post;
string split;
string cmd;
integer retry = 0;
integer retry_attempt = 0;

integer DEBUG_mem = FALSE;
string DEBUG_POST;
integer DEBUG_post = FALSE;
integer DEBUG = FALSE;

string body_error;
string kl_state;

//////////////// END Variables \\\\\\\\\\\\\\\\

default
{
on_rez(integer q)
{
llResetScript();
}

state_entry()
{
}

link_message(integer sender_num, integer num, string str, key id)
{
if (num == LINK_COMM)
{
kl_body = str;

if (kl_list(0) == "command")
{
state com_state;
}
}
}
}

state retry_post
{
state_entry()
{
if (kl_state == "command") state user_check;
}
}

state http_error_general
{
state_entry()
{
llSay(0, body_error);
llSay(0, kl_body);
llResetScript();
}
}

state http_error
{
state_entry()
{
llSay(0, kl_list(1));
llResetScript();
}
}

state com_state
{
state_entry()
{
kl_state = "command";
kl_add("username", llKey2Name(llGetOwner()));
kl_add("userkey", llGetOwner());
kl_add("option", "some_command");
kl_send(kl_post);

state http;
}
}

state http
{
http_response(key request_id, integer status, list metadata, string body)
{
if (request_id == requestid)
{
if (body == "")
{
if (retry_attempt == 0)
{
retry_attempt = 1;
state retry_post;
} else if (retry_attempt == 1) {
if (main_server)
{
llOwnerSay("Main server offline, switching to backup server, contact for support.");
main_server = FALSE;
retry_attempt = 0;
state retry_post;
} else {
llWhisper(0, "Something went wrong, please contact for support or try again later.");
llResetScript();
}
}
// END EMPTY BODY CHECK \\
} else {
if (DEBUG) llWhisper(0, kl_clean(body));
if (DEBUG) llWhisper(0, body);
}
kl_clean(body);

if (kl_list(0) == "error") state http_error;
if (kl_list(0) == "command") state http_command;

state http_error_general;
} else {
body_error = body;
state http_error;
}
}
}

//////////////// HTTP Handlers \\\\\\\\\\\\\\\\

state http_command
{
state_entry()
{
if (kl_list(1) == "okish")
{
llSay (0, "Command returned "+ kl_list(1) +" and it said: "+ kl_list(2));
}

llResetScript();
}
}
_____________________
Alicia Sautereau
if (!social) hide;
Join date: 20 Feb 2007
Posts: 3,125
02-25-2008 17:22
can`t post the website part or the forum yells a 404 :mad:

this version has no encryption, ripped it out quickly when LL decided to break the escapeurl
using it with linked messages to execute pre defined queries, return all the variables using a list 0|1|2|3|etc and split it in another script and reset it when done

the backup server is untested but should change to the backup server if the return page is blank twice
splitting the http_handlers below the http state to just make life easier for myself, different main commands into their own states as memory is no problem with a reset when done and keep it readable :)

LINK_`s are pre defined "channels" so each script only listens when it should or else they`ll spam eachother and in my hands, break everything :p

the php files checks if it comes from SL, using a browser it will decline access
secure is how secure you could make it, you can`t listen to http calls unlike channels and using a directory and file name not many would guess helps, if they want to listen, they`ll have to have access to the server or sniff, but if they don`t know where to start looking... :)


figures, to long lol
_____________________
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-25-2008 22:04
probably because the post conatined a dot dot slash combo or some other relative url marking... hapened to me before, and it's been reported... bug in the forum sofware
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Bobbyb30 Zohari
SL Mentor Coach
Join date: 11 Nov 2006
Posts: 466
02-26-2008 11:34
I'm looking to create my own databse for myself and the 250kb limit on the w-hat one is well very limiting...:p
_____________________