View unanswered posts | View active topics
|
Page 1 of 1
|
[ 7 posts ] |
|
| Author |
Message |
|
Harley
|
Post subject: Return password & changemail www scripts... Posted: Wed Oct 03, 2007 3:33 am |
|
Joined: Sat Mar 18, 2006 1:41 am Posts: 92 Location: World Earth
|
Hello everybody! I can't build this 2 scripts because when I use return password, my script doesn't search(not check, control) email. Look please and help me, maybe u got thoose scripts and give me it? Please, help!
Code: use util; use polsys; use http; use uo;
program forgot_password()
var name := QueryParam( "account" ); var email := QueryParam( "email" ); var account := FindAccount( name ); var rightemail := account.getprop("CreatedEmail");
var ipaddr := QueryIP();
if ( !name || !email) writehtml("Account Name or Email was empty or invalid. Please Press Back and try again"); return 0; endif
if ( !account) WriteHtml("<br><b>Hm... are u realy wrote your account?!</b></br>"); return 0; endif if ( !rightemail) WriteHtml("<br><b>Hm... is that your e-mail?!</b></br>"); return 0; endif
account.SetPassword(part1()); WriteHtml("<html>"); WriteHtml(" <body>"); WriteHtml("<br><b>Your account : " + name + "</b></br>"); WriteHtml("<br><b>Your new password : " + part1() + "</b></br>"); WriteHtml("</body>"); WriteHtml("</html>"); endprogram
function part1() var a, b, c, d, e, f, g, h, i, j; var letters:={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}; var letters2:={"1","2","3","4","5","6","7","8","9"}; a := letters[randomint(20)]; b := letters2[randomint(10)]; c := letters[randomint(20)]; d := letters2[randomint(10)]; e := letters[randomint(20)]; f := letters2[randomint(10)]; g := letters[randomint(20)]; h := letters2[randomint(10)]; i := letters[randomint(20)]; j := letters2[randomint(10)]; return a + b + c + d + e + f + g + h + i + j; endfunction
|
|
| Top |
|
 |
|
runtest
|
Post subject: Posted: Wed Oct 03, 2007 9:40 am |
|
Joined: Sat Aug 05, 2006 11:43 am Posts: 167
|
I am not at my code computer right now but try putting this right under when you declare the first variables.
Code: function part1() var a, b, c, d, e, f, g, h, i, j; var letters:={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}; var letters2:={"1","2","3","4","5","6","7","8","9"}; a := letters[randomint(20)]; b := letters2[randomint(10)]; c := letters[randomint(20)]; d := letters2[randomint(10)]; e := letters[randomint(20)]; f := letters2[randomint(10)]; g := letters[randomint(20)]; h := letters2[randomint(10)]; i := letters[randomint(20)]; j := letters2[randomint(10)]; return a + b + c + d + e + f + g + h + i + j; endfunction
|
|
| Top |
|
 |
|
Harley
|
Post subject: Posted: Thu Oct 04, 2007 3:28 am |
|
Joined: Sat Mar 18, 2006 1:41 am Posts: 92 Location: World Earth
|
Check e-mail I have done!
Code: if ( email != rightemail) WriteHtml("<br><b>E-mail doesn't exists account!</b></br>"); return 0; endif But, when I get my password with this function: Code: account.SetPassword(part1()); WriteHtml("<html>"); WriteHtml(" <body>"); WriteHtml("<br><b>Your account : " + name + "</b></br>"); WriteHtml("<br><b>Your new password : " + part1() + "</b></br>"); WriteHtml("</body>"); WriteHtml("</html>"); endprogram
.........
function part1() var a, b, c, d, e, f, g, h, i, j; var letters:={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}; var letters2:={"1","2","3","4","5","6","7","8","9"}; a := letters[randomint(20)]; b := letters2[randomint(10)]; c := letters[randomint(20)]; d := letters2[randomint(10)]; e := letters[randomint(20)]; f := letters2[randomint(10)]; g := letters[randomint(20)]; h := letters2[randomint(10)]; i := letters[randomint(20)]; j := letters2[randomint(10)]; return a + b + c + d + e + f + g + h + i + j; endfunction
I have error!!
Quote: Your account : newacc
Your new password : lerror{ errortext = "Array index out of bounds" }p4oerror{ errortext = "Array index out of bounds" }nerror{ errortext = "Array index out of bounds" }serror{ errortext = "Array index out of bounds" }
I have error WITH password!  please, if anyone can help me, please help!!!
|
|
| Top |
|
 |
|
CWO
|
Post subject: Posted: Thu Oct 04, 2007 11:06 am |
|
Joined: Sat Feb 04, 2006 5:49 pm Posts: 745 Location: Chicago, IL USA
|
|
You need to put +1 after every RandomInt otherwise it can pick 0 which causes those errors.
Example: letters[RandomInt(26)+1];
I also changed the 20 to 26 becuase theres 26 letters
Also, there's no need for the letters2 array if its all numbers. Just do something like
var b := CStr(RandomInt(9)+1);
|
|
| Top |
|
 |
|
Harley
|
Post subject: Posted: Fri Oct 05, 2007 2:28 pm |
|
Joined: Sat Mar 18, 2006 1:41 am Posts: 92 Location: World Earth
|
CWO, thanks, I has got rided this error:
Quote: error{ errortext = "Array index out of bounds" } But! I have new error! When at browser I gate one password, at /data/accounts.txt - a have other password!!! Look please!: Quote: This is at HTM Your account : newacc
Your new password : p9h9s4t5k2
This is at accounts.txt Account { Name newacc Password m4m8o3o9v6 ........................................... }
please, help, thank u!
|
|
| Top |
|
 |
|
CWO
|
Post subject: Posted: Fri Oct 05, 2007 10:48 pm |
|
Joined: Sat Feb 04, 2006 5:49 pm Posts: 745 Location: Chicago, IL USA
|
Code: account.SetPassword(part1()); WriteHtml("<html>"); WriteHtml(" <body>"); WriteHtml("<br><b>Your account : " + name + "</b></br>"); WriteHtml("<br><b>Your new password : " + part1() + "</b></br>"); WriteHtml("</body>"); WriteHtml("</html>"); endprogram
In this block of code, you're running part1() twice. The first time it generates a password and sets it to the account, the second time it generates another password and displays it to you. Change that block of code to this... Code: var newpass := part1(); account.SetPassword(newpass); WriteHtml("<html>"); WriteHtml(" <body>"); WriteHtml("<br><b>Your account : " + name + "</b></br>"); WriteHtml("<br><b>Your new password : " + newpass + "</b></br>"); WriteHtml("</body>"); WriteHtml("</html>"); endprogram
|
|
| Top |
|
 |
|
Harley
|
Post subject: Posted: Sat Oct 06, 2007 2:46 am |
|
Joined: Sat Mar 18, 2006 1:41 am Posts: 92 Location: World Earth
|
|
Thankx CWO, you are realy professional scripter!!! Bigest thank for u!!!
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 7 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 1 guest |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|

|