@@ -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); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | require_once("../inc/user_util.inc"); |
25 | 25 | |
26 | 26 | $config = get_config(); |
27 | -if ( !parse_bool($config, "enable_delete_account") ) { |
|
27 | +if (!parse_bool($config, "enable_delete_account")) { |
|
28 | 28 | error_page( |
29 | 29 | tra("This feature is disabled. Please contact the project administrator.") |
30 | 30 | ); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $userid = get_int("id"); |
36 | 36 | $token = get_str("token"); |
37 | 37 | $retval = check_delete_account_token($userid, $token); |
38 | - if ( !$retval ) { |
|
38 | + if (!$retval) { |
|
39 | 39 | error_page( |
40 | 40 | tra("The token you used has expired or is otherwise not valid. Please request a new one <a href=\"delete_account_request.php\">here</a>") |
41 | 41 | ); |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | ."<br/>"; |
50 | 50 | |
51 | 51 | form_start(secure_url_base()."delete_account_confirm.php", "post"); |
52 | - form_input_hidden("token",$token); |
|
53 | - form_input_hidden("id",$userid); |
|
54 | - form_input_text(tra("Password"), "passwd", "", "password",'id="passwd"',passwd_visible_checkbox("passwd")); |
|
52 | + form_input_hidden("token", $token); |
|
53 | + form_input_hidden("id", $userid); |
|
54 | + form_input_text(tra("Password"), "passwd", "", "password", 'id="passwd"', passwd_visible_checkbox("passwd")); |
|
55 | 55 | form_submit(tra("Delete Account")); |
56 | 56 | form_end(); |
57 | 57 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $userid = post_int("id"); |
64 | 64 | $token = post_str("token"); |
65 | 65 | $retval = check_delete_account_token($userid, $token); |
66 | - if ( !$retval ) { |
|
66 | + if (!$retval) { |
|
67 | 67 | error_page( |
68 | 68 | tra("The token you used has expired or is otherwise not valid. Please request a new one <a href=\"delete_account_request.php\">here</a>") |
69 | 69 | ); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $passwd = post_str("passwd"); |
75 | 75 | check_passwd_ui($user, $passwd); |
76 | 76 | |
77 | - if ( !delete_account($user) ) { |
|
77 | + if (!delete_account($user)) { |
|
78 | 78 | error_page( |
79 | 79 | tra("Failed to delete your account. Please contact the project administrator.") |
80 | 80 | ); |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | // they've participated in |
34 | 34 | // |
35 | 35 | function get_other_projects($user) { |
36 | - $cpid = md5($user->cross_project_id . $user->email_addr); |
|
36 | + $cpid = md5($user->cross_project_id.$user->email_addr); |
|
37 | 37 | $url = "http://boinc.netsoft-online.com/get_user.php?cpid=".$cpid; |
38 | 38 | |
39 | 39 | // Check the cache for that URL |
40 | 40 | // |
41 | 41 | $cacheddata = get_cached_data(REMOTE_PROJECTS_TTL, $url); |
42 | - if ($cacheddata){ |
|
42 | + if ($cacheddata) { |
|
43 | 43 | $remote = unserialize($cacheddata); |
44 | 44 | } else { |
45 | 45 | // Fetch the XML, use curl if fopen() is disallowed |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | function cmp($a, $b) { |
112 | 112 | if ($a->expavg_credit == $b->expavg_credit) return 0; |
113 | - return ($a->expavg_credit < $b->expavg_credit)? 1 : -1; |
|
113 | + return ($a->expavg_credit < $b->expavg_credit) ? 1 : -1; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | function show_other_projects($user, $personal) { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | ), |
134 | 134 | array("", ALIGN_RIGHT, ALIGN_RIGHT, ALIGN_RIGHT) |
135 | 135 | ); |
136 | - foreach($user->projects as $project) { |
|
136 | + foreach ($user->projects as $project) { |
|
137 | 137 | show_project($project); |
138 | 138 | } |
139 | 139 | end_table(); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | |
176 | 176 | if (!NO_STATS) { |
177 | - $cpid = md5($user->cross_project_id . $user->email_addr); |
|
177 | + $cpid = md5($user->cross_project_id.$user->email_addr); |
|
178 | 178 | $x = ""; |
179 | 179 | shuffle($cpid_stats_sites); |
180 | 180 | foreach ($cpid_stats_sites as $site) { |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | } else { |
263 | 263 | $delete_account_str = ""; |
264 | 264 | $config = get_config(); |
265 | - if ( parse_bool($config, "enable_delete_account") ) { |
|
265 | + if (parse_bool($config, "enable_delete_account")) { |
|
266 | 266 | $delete_account_str = " · <a href=\"delete_account_request.php\">".tra("delete account")."</a>"; |
267 | 267 | } |
268 | 268 | |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | // show user name, with links to profile if present. |
328 | 328 | // if $badge_height is > 0, show badges |
329 | 329 | // |
330 | -function user_links($user, $badge_height=0) { |
|
330 | +function user_links($user, $badge_height = 0) { |
|
331 | 331 | BoincForumPrefs::lookup($user); |
332 | 332 | if (is_banished($user)) { |
333 | 333 | return "(banished: ID $user->id)"; |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | $x .= ' <a href="'.url_base().'view_profile.php?userid='.$user->id.'"><img title="View the profile of '.$user->name.'" src="'.$img_url.'" alt="Profile"></a>'; |
339 | 339 | } |
340 | 340 | $x .= " <a href=\"".url_base()."show_user.php?userid=".$user->id."\">".$user->name."</a>"; |
341 | - if (function_exists("project_user_links")){ |
|
341 | + if (function_exists("project_user_links")) { |
|
342 | 342 | $x .= project_user_links($user); |
343 | 343 | } |
344 | 344 | if ($badge_height) { |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | |
392 | 392 | // if there's a foundership request, notify the founder |
393 | 393 | // |
394 | - if ($user->id==$team->userid && $team->ping_user >0) { |
|
394 | + if ($user->id == $team->userid && $team->ping_user > 0) { |
|
395 | 395 | $x .= "<p class=\"text-danger\">".tra("(foundership change request pending)")."</p>"; |
396 | 396 | } |
397 | 397 | row2(tra("Member of team"), $x); |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | $x = "<a href=\"user_search.php\">".tra("Find friends")."</a><br/>\n"; |
417 | 417 | $n = count($friends); |
418 | 418 | if ($n) { |
419 | - foreach($friends as $friend) { |
|
419 | + foreach ($friends as $friend) { |
|
420 | 420 | $fuser = BoincUser::lookup_id($friend->user_dest); |
421 | 421 | if (!$fuser) continue; |
422 | 422 | $x .= friend_links($fuser); |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | // Returns a cacheable community links data object |
460 | 460 | // @param user The user to produce a community links object for |
461 | 461 | |
462 | -function get_community_links_object($user){ |
|
462 | +function get_community_links_object($user) { |
|
463 | 463 | $cache_object = new StdClass; |
464 | 464 | $cache_object->post_count = total_posts($user); |
465 | 465 | $cache_object->user = $user; |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | $cache_object->friends = array(); |
468 | 468 | |
469 | 469 | $friends = BoincFriend::enum("user_src=$user->id and reciprocated=1"); |
470 | - foreach($friends as $friend) { |
|
470 | + foreach ($friends as $friend) { |
|
471 | 471 | $fuser = BoincUser::lookup_id($friend->user_dest); |
472 | 472 | if (!$fuser) continue; |
473 | 473 | $cache_object->friends[] = $fuser; |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | return $cache_object; |
476 | 476 | } |
477 | 477 | |
478 | -function community_links($clo, $logged_in_user){ |
|
478 | +function community_links($clo, $logged_in_user) { |
|
479 | 479 | $user = $clo->user; |
480 | 480 | $team = $clo->team; |
481 | 481 | $friends = $clo->friends; |
@@ -501,15 +501,15 @@ discard block |
||
501 | 501 | "<a href=\"friend.php?action=cancel_confirm&userid=$user->id\">".tra("Cancel friendship")."</a>" |
502 | 502 | ); |
503 | 503 | } else if ($friend) { |
504 | - row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>"); |
|
504 | + row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>"); |
|
505 | 505 | } else { |
506 | - row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>"); |
|
506 | + row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>"); |
|
507 | 507 | } |
508 | 508 | } |
509 | 509 | |
510 | 510 | if ($friends) { |
511 | 511 | $x = ""; |
512 | - foreach($friends as $friend) { |
|
512 | + foreach ($friends as $friend) { |
|
513 | 513 | $x .= friend_links($friend); |
514 | 514 | } |
515 | 515 | row2(tra("Friends")." (".sizeof($friends).")", $x); |
@@ -554,6 +554,6 @@ discard block |
||
554 | 554 | } |
555 | 555 | |
556 | 556 | |
557 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
557 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
558 | 558 | |
559 | 559 | ?> |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | row2('<b>'.tra('Search criteria (use one or more)').'</b>', ''); |
41 | 41 | row2( |
42 | 42 | tra('Key words').'<br><small>'.tra('Find teams with these words in their names or descriptions').'</small>', |
43 | - '<input class="form-control" type="text" name="keywords" value="' . htmlspecialchars($params->keywords) . '">'); |
|
43 | + '<input class="form-control" type="text" name="keywords" value="'.htmlspecialchars($params->keywords).'">'); |
|
44 | 44 | row2_init(tra('Country'), ''); |
45 | 45 | echo '<select class="form-control" name="country"><option value="" selected>---</option>'; |
46 | 46 | $country = $params->country; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | echo country_select_options($country); |
49 | 49 | echo "</select></td></tr>\n"; |
50 | 50 | row2(tra('Type of team'), team_type_select($params->type, true)); |
51 | - $checked = $params->active?"checked":""; |
|
51 | + $checked = $params->active ? "checked" : ""; |
|
52 | 52 | row2(tra('Show only active teams'), "<input type=checkbox name=active $checked>"); |
53 | 53 | row2("", "<input class=\"btn btn-primary\" type=submit name=submit value=\"".tra('Search')."\">"); |
54 | 54 | end_table(); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | row2("Created", date_str($team->create_time)); |
97 | 97 | if (defined("SHOW_NONVALIDATED_TEAMS")) { |
98 | 98 | $founder = $team->founder; |
99 | - row2("Founder email validated", $founder->email_validated?"Yes":"No (team will not be exported)"); |
|
99 | + row2("Founder email validated", $founder->email_validated ? "Yes" : "No (team will not be exported)"); |
|
100 | 100 | } |
101 | 101 | if (strlen($team->url)) {; |
102 | 102 | if (strstr($team->url, "http://")) { |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | row1(tra('Members')); |
171 | 171 | row2(tra('Founder'), |
172 | - $team->founder?user_links($team->founder, BADGE_HEIGHT_MEDIUM):"---" |
|
172 | + $team->founder ?user_links($team->founder, BADGE_HEIGHT_MEDIUM) : "---" |
|
173 | 173 | ); |
174 | 174 | if (count($team->admins)) { |
175 | 175 | $first = true; |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | foreach ($deltas as $delta) { |
354 | 354 | $u = BoincUser::lookup_id($delta->userid); |
355 | 355 | if ($u->teamid == $teamid) { |
356 | - $new_members[] = $u; // they might have later quit |
|
356 | + $new_members[] = $u; // they might have later quit |
|
357 | 357 | } |
358 | 358 | } |
359 | 359 | } |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | if (!$user->teamid) return; |
437 | 437 | $user->update("teamid=0"); |
438 | 438 | $team = BoincTeam::lookup_id($user->teamid); |
439 | - if ($team && $team->ping_user==$user->id) { |
|
439 | + if ($team && $team->ping_user == $user->id) { |
|
440 | 440 | $team->update("ping_user=-ping_user"); |
441 | 441 | } |
442 | 442 | BoincTeamAdmin::delete("teamid=$user->teamid and userid=$user->id"); |
@@ -475,34 +475,34 @@ discard block |
||
475 | 475 | start_table(); |
476 | 476 | row2(tra('Team name, text version').' |
477 | 477 | <br><p class=\"text-muted\">'.tra('Don\'t use HTML tags.').'</p>', |
478 | - '<input class="form-control" name="name" type="text" size="50" value="'.($team?$team->name:"").'">' |
|
478 | + '<input class="form-control" name="name" type="text" size="50" value="'.($team ? $team->name : "").'">' |
|
479 | 479 | ); |
480 | 480 | row2(tra('Team name, HTML version').' |
481 | 481 | <br><p class=\"text-muted\"> |
482 | 482 | '.tra('You may use %1 limited HTML tags %2.', '<a href="html.php" target="_new">', '</a>').' |
483 | 483 | '.tra('If you don\'t know HTML, leave this box blank.').'</p>', |
484 | - '<input class="form-control" name="name_html" type="text" size="50" value="'.str_replace('"',"'",($team?$team->name_html:"")).'">' |
|
484 | + '<input class="form-control" name="name_html" type="text" size="50" value="'.str_replace('"', "'", ($team ? $team->name_html : "")).'">' |
|
485 | 485 | ); |
486 | 486 | row2(tra('URL of team web page, if any').':<br><font size=-2>('.tra('without "http://"').') |
487 | 487 | '.tra('This URL will be linked to from the team\'s page on this site.'), |
488 | - '<input class="form-control" type="text" name="url" size="60" value="'.($team?$team->url:"").'">' |
|
488 | + '<input class="form-control" type="text" name="url" size="60" value="'.($team ? $team->url : "").'">' |
|
489 | 489 | ); |
490 | 490 | row2(tra('Description of team').': |
491 | 491 | <br><p class=\"text-muted\"> |
492 | 492 | '.tra('You may use %1 limited HTML tags %2.', '<a href="html.php" target="_new">', '</a>').' |
493 | 493 | </p>', |
494 | - '<textarea class="form-control" name="description" rows=10>'.($team?$team->description:"").'</textarea>' |
|
494 | + '<textarea class="form-control" name="description" rows=10>'.($team ? $team->description : "").'</textarea>' |
|
495 | 495 | ); |
496 | 496 | |
497 | - row2(tra('Type of team').':', team_type_select($team?$team->type:null)); |
|
497 | + row2(tra('Type of team').':', team_type_select($team ? $team->type : null)); |
|
498 | 498 | |
499 | 499 | row2_init(tra('Country'), |
500 | 500 | '<select class="form-control" name="country">' |
501 | 501 | ); |
502 | - echo country_select_options($team?$team->country:null); |
|
502 | + echo country_select_options($team ? $team->country : null); |
|
503 | 503 | |
504 | 504 | echo "</select></td></tr>\n"; |
505 | - $x = (!$team || $team->joinable)?"checked":""; |
|
505 | + $x = (!$team || $team->joinable) ? "checked" : ""; |
|
506 | 506 | row2(tra("Accept new members?"), "<input type=checkbox name=joinable $x>"); |
507 | 507 | // Check if we're using reCaptcha to prevent spam accounts |
508 | 508 | // |
@@ -566,12 +566,12 @@ discard block |
||
566 | 566 | // |
567 | 567 | function new_transfer_request_ok($team, $now) { |
568 | 568 | if ($team->ping_user <= 0) { |
569 | - if ($team->ping_time < $now - 60 * 86400) { |
|
569 | + if ($team->ping_time < $now - 60*86400) { |
|
570 | 570 | return true; |
571 | 571 | } |
572 | 572 | return false; |
573 | 573 | } |
574 | - if ($team->ping_time < $now - 90 * 86400) { |
|
574 | + if ($team->ping_time < $now - 90*86400) { |
|
575 | 575 | return true; |
576 | 576 | } |
577 | 577 | return false; |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | if (!is_valid_country($country)) { |
607 | 607 | $country = tra('None'); |
608 | 608 | } |
609 | - $country = BoincDb::escape_string($country); // for Cote d'Ivoire |
|
609 | + $country = BoincDb::escape_string($country); // for Cote d'Ivoire |
|
610 | 610 | |
611 | 611 | $clause = sprintf( |
612 | 612 | "(userid, create_time, name, name_lc, url, type, name_html, description, country, nusers, expavg_time) values(%d, %d, '%s', '%s', '%s', %d, '%s', '%s', '%s', %d, unix_timestamp())", |
@@ -629,6 +629,6 @@ discard block |
||
629 | 629 | } |
630 | 630 | } |
631 | 631 | |
632 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
632 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
633 | 633 | |
634 | 634 | ?> |
@@ -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"); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | function check_passwd_ui($user, $passwd) { |
58 | 58 | $passwd_hash = md5($passwd.$user->email_addr); |
59 | - if( !check_passwd_hash($user, $passwd_hash) ) { |
|
59 | + if (!check_passwd_hash($user, $passwd_hash)) { |
|
60 | 60 | sleep(LOGIN_FAIL_SLEEP_SEC); |
61 | 61 | page_head("Password incorrect"); |
62 | 62 | echo "The password you entered is incorrect. Please go back and try again.\n"; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | function is_banned_email_addr($email_addr) { |
69 | 69 | global $banned_email_domains; |
70 | 70 | if (isset($banned_email_domains)) { |
71 | - foreach($banned_email_domains as $d) { |
|
71 | + foreach ($banned_email_domains as $d) { |
|
72 | 72 | $x = strstr($email_addr, $d); |
73 | 73 | if ($x == $d) return true; |
74 | 74 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | // |
97 | 97 | function make_user( |
98 | 98 | $email_addr, $name, $passwd_hash, |
99 | - $country=null, $postal_code=null, $project_prefs=null, $teamid=0 |
|
99 | + $country = null, $postal_code = null, $project_prefs = null, $teamid = 0 |
|
100 | 100 | ) { |
101 | 101 | if (!is_valid_email_addr($email_addr)) return null; |
102 | 102 | if (is_banned_email_addr($email_addr)) return null; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | show_error(tra("Passwords may only include ASCII characters.")); |
225 | 225 | } |
226 | 226 | |
227 | - if (strlen($passwd)<$min_passwd_length) { |
|
227 | + if (strlen($passwd) < $min_passwd_length) { |
|
228 | 228 | show_error( |
229 | 229 | tra("New password is too short: minimum password length is %1 characters.", $min_passwd_length) |
230 | 230 | ); |
@@ -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 ) { |
@@ -27,17 +27,17 @@ |
||
27 | 27 | |
28 | 28 | die("Delete this line first\n"); |
29 | 29 | $config = get_config(); |
30 | -if ( !parse_bool($config, "enable_delete_account") ) { |
|
30 | +if (!parse_bool($config, "enable_delete_account")) { |
|
31 | 31 | die(tra("This feature is disabled. Please enable it in the config.xml.")); |
32 | 32 | } |
33 | 33 | |
34 | -$id = (int) $argv[1]; |
|
34 | +$id = (int)$argv[1]; |
|
35 | 35 | |
36 | 36 | $user = BoincUser::lookup_id($id); |
37 | 37 | if (!$user) die("no such user\n"); |
38 | 38 | |
39 | 39 | $retval = delete_account($user); |
40 | -if ( $retval ) { |
|
40 | +if ($retval) { |
|
41 | 41 | echo tra("User deleted"); |
42 | 42 | } else { |
43 | 43 | echo tra("Failed to delete user"); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | require_once("../inc/email.inc"); |
24 | 24 | |
25 | 25 | $config = get_config(); |
26 | -if ( !parse_bool($config, "enable_delete_account") ) { |
|
26 | +if (!parse_bool($config, "enable_delete_account")) { |
|
27 | 27 | error_page( |
28 | 28 | tra("This feature is disabled. Please contact the project administrator.") |
29 | 29 | ); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ."</ul><br/>"; |
49 | 49 | |
50 | 50 | form_start(secure_url_base()."delete_account_request.php", "post"); |
51 | - form_input_text(tra("Password"), "passwd", "", "password",'id="passwd"',passwd_visible_checkbox("passwd")); |
|
51 | + form_input_text(tra("Password"), "passwd", "", "password", 'id="passwd"', passwd_visible_checkbox("passwd")); |
|
52 | 52 | form_submit(tra("Send Confirmation Email")); |
53 | 53 | form_end(); |
54 | 54 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | // send an email, using PHPMailer or not. |
28 | 28 | // |
29 | -function send_email($user, $subject, $body, $body_html=null, $email_addr=null) { |
|
29 | +function send_email($user, $subject, $body, $body_html = null, $email_addr = null) { |
|
30 | 30 | if (function_exists("make_php_mailer")) { |
31 | 31 | if (file_exists("../inc/PHPMailer/src/PHPMailer.php") && file_exists("../inc/PHPMailer/src/SMTP.php")) { |
32 | 32 | require_once("../inc/PHPMailer/src/PHPMailer.php"); |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | return true; |
58 | 58 | } |
59 | 59 | } else { |
60 | - $headers =""; |
|
60 | + $headers = ""; |
|
61 | 61 | if (defined('EMAIL_FROM') && defined('EMAIL_FROM_NAME')) { |
62 | 62 | $headers = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM.">"; |
63 | 63 | } else if (defined('EMAIL_FROM')) { |
64 | - $headers = "From: ". EMAIL_FROM; |
|
64 | + $headers = "From: ".EMAIL_FROM; |
|
65 | 65 | } |
66 | 66 | if ($email_addr) { |
67 | 67 | return mail($email_addr, $subject, $body, $headers); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | if (defined("USE_STOPFORUMSPAM") && USE_STOPFORUMSPAM && array_key_exists('REMOTE_ADDR', $_SERVER)) { |
141 | 141 | $ip = $_SERVER['REMOTE_ADDR']; |
142 | 142 | // For obviously private IPs check just the email against SFS, otherwise check both IP and email |
143 | - if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
143 | + if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE|FILTER_FLAG_NO_RES_RANGE)) { |
|
144 | 144 | $x = @file_get_contents("https://www.stopforumspam.com/api?ip=".$ip."&email=".$addr); |
145 | 145 | } else { |
146 | 146 | $x = @file_get_contents("https://www.stopforumspam.com/api?email=".$addr); |
@@ -151,12 +151,12 @@ discard block |
||
151 | 151 | } |
152 | 152 | $pattern = '/^([^@]+)@([^@\.]+)\.([^@]{2,})$/'; |
153 | 153 | $match = preg_match($pattern, $addr); |
154 | - return (bool) $match; |
|
154 | + return (bool)$match; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | function send_confirm_delete_email($user) { |
158 | 158 | $token = create_token($user->id, TOKEN_TYPE_DELETE_ACCOUNT, TOKEN_DURATION_ONE_DAY); |
159 | - if ( $token === null ) { |
|
159 | + if ($token === null) { |
|
160 | 160 | error_page("Error creating token. Please try again later."); |
161 | 161 | } |
162 | 162 |