Password protect opening of stacks
Scott Rossi
scott at tactilemedia.com
Mon May 26 17:05:00 EDT 2003
Recently, Sannyasin Sivakatirswami wrote:
> I have set the password of a stack, but my goal is to force someone to
> enter the password on start up or Rev quits....
>
> The stack has log in info for web sites in a substack, I need for these
> to be visible to the user and enterable, saveable fields. but then we
> want to
>
> Force a password in the open stack handler such that the string does
> not need to be used in the handler itself and if the correct passkey is
> not supplied, then revolution quits.
>
> i studied the docs very carefull and the password and passkey concepts
> are all about locking up the scripts and blocking modification, but i
> want to password protect the actually booting of the stack. what is the
> best way to handle this. I don't see anything in the doc on this.
As you discovered, password protection protects scripts and the ability to
copy portions of the stack. Setting a password for the stack will not
protect it from operating.
All you need to do is create your "key" somewhere in your stack: a property,
a hidden field, whatever object you want -- let's say a custom property of
the first card called "uPass". The simply pop an ask dialog to check, as
you already tried. Personally, I would separate the password confirmation
from the openStack handler:
on openStack
send "checkPermission" to me in 0.5 seconds
end openStack
on checkPermission
ask "Enter your password:"
if not (it=the uPass of this cd) then quit
end checkPermission
Regards,
Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
Email: scott at tactilemedia.com
Web: www.tactilemedia.com
More information about the use-livecode
mailing list