I originally posted this to the users group, and the suggestion is to
post it here...

I have a question, situation similar to that of..."Password prompt for
uploadplugin macro? ".(23 Jan).

I have a webpage (online TW), that hopefully many people will access
and read!! And a few people have authority to edit, very few! On
opening the page, it is set to NOT display backstage, View Mode only,
and not to try to upload tiddlers. So far so good!

Now, a simple LOGIN tiddler asks people to input their name and
password...simple....and now I need to check the validiity of that
information..before I pass to another tiddler that turns backstage on,
allows editing, allows Tiddler uploading etc. The script code to do
that is straight-forward (thats to you guys).

Th question is.....I need a script that checks with "store.php" and
maybe "storeTiddler.php" (although I would be careful to make sure
they both had the same users list!) to see if the information is
correct, or not...and then make the decision to generate a polite
message saying "not here mate!!!! " (or better still just "you are not
an editor on this site"), or jump to the script tiddler that changes
the editing permissions.

Accessing the "store.php" file in this form is way beyond this little
mouse....any of you guys have ideas!!!

Skye

____

Response from FND

Please note that strictly development-related issues should be
discussed
on the developers group:
      http://groups.google.com/group/TiddlyWikiDev/

> I need a script that checks with "store.php" [...] to see if the
> [user] information is correct

I'm not very familiar with the UploadPlugin's store.php script, but I
think you need to perform a POST to get back a relevant response -
that
is, you need to attempt a write operation in order to check whether
you're actually authorized to do so.
If you do so without submitting any data (i.e. your TiddlyWiki
document), you might overwrite the document on the server with a blank
file.

Nevertheless, here's the basic concept:
---------------
var url = "http://example.org/store.php";;
var callback = function(status, params, responseText, url, xhr) {
     if(status) { // authorized
         /* ... */
     } else { // unauthorized
         /* ... */
     }
};

var req = httpReq("POST", url, callback);
---------------

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWikiDev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to