Script protected with password

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
bkan
Posts: 51
Joined: November 6th, 2013, 8:33 am

Hello,
I'm trying to protect my script with a password. I want to launch a "prompt function " before starting my script to ask the user a password.
I have tried this :
doRun = true;
var champLicense = "trial";
var goodCode = "aftershine";
var check;
function affichePrompt(){
check = prompt("Rentrer votre code",champLicense,"Bienvenue");
return checkCode();
}

function checkCode(){
if(check==goodCode){
alert("good");
}
else{
alert("bad");
affichePrompt();
}
}
affichePrompt();

My only problem : when I hit "cancel", the "prompt window" does not disappear because I'm in the "else" answer : do you know how I can do??

And another question : i did not find anything on the web to protect my script with an encode password or something secured : have you got any idea where I can find some information?

Thanks in advance! (sorry for my bad english!)
bkan
Posts: 51
Joined: November 6th, 2013, 8:33 am

Ok sorry I found a solution! It is :
function checkCode(){
if(check==null){
}
else{
if(check==goodCode){
app.settings.saveSetting("AK_toolkit", "password","ok");
alert("Registration Successful\nThank you for purchasing AK toolkit!");
myScript(this);
}
else{
alert("Sorry, the registration code is not valid\n\nIf you require assistance please contact jsmartin@azarek.com");
affichePrompt();
}
}
}

Happy if it could help!
Post Reply