@@ -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"; |
@@ -25,6 +25,10 @@ discard block |
||
| 25 | 25 | // Constants for token durations |
| 26 | 26 | define("TOKEN_DURATION_ONE_DAY", 86400); |
| 27 | 27 | |
| 28 | +/** |
|
| 29 | + * @param string $type |
|
| 30 | + * @param integer $duration |
|
| 31 | + */ |
|
| 28 | 32 | function create_token($userid, $type, $duration) { |
| 29 | 33 | $token = random_string(); |
| 30 | 34 | $now = time(); |
@@ -37,6 +41,9 @@ discard block |
||
| 37 | 41 | return $token; |
| 38 | 42 | } |
| 39 | 43 | |
| 44 | +/** |
|
| 45 | + * @param string $type |
|
| 46 | + */ |
|
| 40 | 47 | function is_valid_token($userid, $token, $type) { |
| 41 | 48 | $boincToken = BoincToken::lookup_valid_token($userid, $token, $type); |
| 42 | 49 | if ( $boincToken == null ) { |
@@ -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"); |