@@ -28,13 +28,13 @@ |
||
28 | 28 | echo "---------------\n"; |
29 | 29 | $boincToken = BoincToken::lookup_valid_token(0, $token, 'T'); |
30 | 30 | if ( $boincToken != null ) { |
31 | - echo "Found valid token\n"; |
|
31 | + echo "Found valid token\n"; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | echo "---------------\n"; |
35 | 35 | $boincToken = BoincToken::lookup_valid_token(0, 'notrealtoken', 'T'); |
36 | 36 | if ( $boincToken == null ) { |
37 | - echo "Successfully didn't find invalid token\n"; |
|
37 | + echo "Successfully didn't find invalid token\n"; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | echo "---------------\n"; |
@@ -32,9 +32,9 @@ |
||
32 | 32 | page_head(tra("Delete Account")); |
33 | 33 | |
34 | 34 | echo "<p>".tra("Thank you for verifying ownership of your account.")."</p>" |
35 | - ."<p>".tra("You can now delete your account by entering in your password below and clicking the \"Delete Account\" button.")."</p>" |
|
36 | - ."<p>".tra("As a reminder, your account <b>cannot be recovered</b> once you delete it.")."</p>" |
|
37 | - ."<br/>"; |
|
35 | + ."<p>".tra("You can now delete your account by entering in your password below and clicking the \"Delete Account\" button.")."</p>" |
|
36 | + ."<p>".tra("As a reminder, your account <b>cannot be recovered</b> once you delete it.")."</p>" |
|
37 | + ."<br/>"; |
|
38 | 38 | |
39 | 39 | form_start(secure_url_base()."delete_account_confirm.php", "post"); |
40 | 40 | form_input_hidden("token",$token); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | function check_passwd_ui($user, $passwd) { |
58 | - $passwd_hash = md5($passwd.$user->email_addr); |
|
58 | + $passwd_hash = md5($passwd.$user->email_addr); |
|
59 | 59 | if( !check_passwd_hash($user, $passwd_hash) ) { |
60 | 60 | sleep(LOGIN_FAIL_SLEEP_SEC); |
61 | 61 | page_head("Password incorrect"); |
@@ -27,6 +27,10 @@ discard block |
||
27 | 27 | define("TOKEN_DURATION_ONE_DAY", 86400); |
28 | 28 | define("TOKEN_DURATION_ONE_WEEK", 604800); |
29 | 29 | |
30 | +/** |
|
31 | + * @param string $type |
|
32 | + * @param integer $duration |
|
33 | + */ |
|
30 | 34 | function create_token($userid, $type, $duration) { |
31 | 35 | $token = random_string(); |
32 | 36 | $now = time(); |
@@ -46,6 +50,9 @@ discard block |
||
46 | 50 | return $result; |
47 | 51 | } |
48 | 52 | |
53 | +/** |
|
54 | + * @param string $type |
|
55 | + */ |
|
49 | 56 | function is_valid_token($userid, $token, $type) { |
50 | 57 | $boincToken = BoincToken::lookup_valid_token($userid, $token, $type); |
51 | 58 | if ( $boincToken == null ) { |