@@ -28,7 +28,7 @@ |
||
28 | 28 | die("Delete this line first\n"); |
29 | 29 | |
30 | 30 | if (is_numeric($argv[1])) { |
31 | - $user = BoincUser::lookup_id((int) $argv[1]); |
|
31 | + $user = BoincUser::lookup_id((int)$argv[1]); |
|
32 | 32 | if (!$user) die("no such user\n"); |
33 | 33 | $retval = delete_account($user); |
34 | 34 | if ($retval) { |
@@ -43,7 +43,7 @@ |
||
43 | 43 | if ($retval) { |
44 | 44 | echo "Failed to delete user: $retval\n"; |
45 | 45 | } else { |
46 | - echo "User $user->id deleted\n"; |
|
46 | + echo "user $user->id deleted\n"; |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | } |
@@ -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 (!$email_addr) { |
31 | 31 | $email_addr = $user->email_addr; |
32 | 32 | } |
@@ -69,17 +69,17 @@ discard block |
||
69 | 69 | return true; |
70 | 70 | } |
71 | 71 | } else { |
72 | - $headers =""; |
|
72 | + $headers = ""; |
|
73 | 73 | if (defined('EMAIL_FROM') && defined('EMAIL_FROM_NAME')) { |
74 | 74 | $headers = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM.">"; |
75 | 75 | } else if (defined('EMAIL_FROM')) { |
76 | - $headers = "From: ". EMAIL_FROM; |
|
76 | + $headers = "From: ".EMAIL_FROM; |
|
77 | 77 | } |
78 | 78 | if ($body_html) { |
79 | 79 | $body = "<html><body>\n"; |
80 | 80 | $body .= $body_html; |
81 | 81 | $body .= "\n</body></html>\n"; |
82 | - $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; |
|
82 | + $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n"; |
|
83 | 83 | } |
84 | 84 | return mail($email_addr, $subject, $body, $headers); |
85 | 85 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | // otherwise check both IP and email |
161 | 161 | if ($ip && filter_var( |
162 | 162 | $ip, FILTER_VALIDATE_IP, |
163 | - FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE |
|
163 | + FILTER_FLAG_NO_PRIV_RANGE|FILTER_FLAG_NO_RES_RANGE |
|
164 | 164 | )) { |
165 | 165 | $x = @file_get_contents("https://www.stopforumspam.com/api?ip=".$ip."&email=".$addr); |
166 | 166 | } else { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | return md5($key.'oogabooga'); |
206 | 206 | } |
207 | 207 | |
208 | -function opt_out_url($user, $page="opt_out.php") { |
|
208 | +function opt_out_url($user, $page = "opt_out.php") { |
|
209 | 209 | return sprintf("%s%s?code=%s&userid=%d", |
210 | 210 | secure_url_base(), |
211 | 211 | $page, |
@@ -79,7 +79,7 @@ |
||
79 | 79 | if ($first) { |
80 | 80 | $first = false; |
81 | 81 | echo "<p>"; |
82 | - echo forum_title($category, NULL, NULL); |
|
82 | + echo forum_title($category, null, null); |
|
83 | 83 | echo "<p>"; |
84 | 84 | show_mark_as_read_button($user); |
85 | 85 | start_table('table-striped'); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | project_forum_index_intro(); |
70 | 70 | } |
71 | 71 | |
72 | - if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE){ |
|
72 | + if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE) { |
|
73 | 73 | $categories = BoincCategory::enum("true order by orderID"); |
74 | 74 | } else { |
75 | 75 | echo "<p>" |
@@ -210,5 +210,5 @@ discard block |
||
210 | 210 | } else { |
211 | 211 | main($user); |
212 | 212 | } |
213 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
213 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
214 | 214 | ?> |
@@ -69,7 +69,7 @@ |
||
69 | 69 | project_forum_index_intro(); |
70 | 70 | } |
71 | 71 | |
72 | - if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE){ |
|
72 | + if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE) { |
|
73 | 73 | $categories = BoincCategory::enum("true order by orderID"); |
74 | 74 | } else { |
75 | 75 | echo "<p>" |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | start_table('table-striped'); |
28 | 28 | |
29 | 29 | $x = ['User']; |
30 | - for ($i=0; $i<S_NFLAGS; $i++) { |
|
30 | + for ($i = 0; $i < S_NFLAGS; $i++) { |
|
31 | 31 | $x[] = $special_user_bitfield[$i]; |
32 | 32 | } |
33 | 33 | $x[] = ''; |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $pref->userid |
43 | 43 | ); |
44 | 44 | $x = ["$user->name ($user->id)"]; |
45 | - for ($j=0; $j<S_NFLAGS; $j++) { |
|
45 | + for ($j = 0; $j < S_NFLAGS; $j++) { |
|
46 | 46 | $bit = substr($pref->special_user, $j, 1); |
47 | - $c = ($bit == 1)?"checked":""; |
|
47 | + $c = ($bit == 1) ? "checked" : ""; |
|
48 | 48 | $x[] = sprintf( |
49 | 49 | '<input type="checkbox" name="role%d" value="1" %s>', |
50 | 50 | $j, $c |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | echo '<form action="user_permissions.php" method="POST">'; |
59 | 59 | $x = ['Add User ID: <input type="text" name="userid" size="6">']; |
60 | - for ($j=0; $j<S_NFLAGS; $j++) { |
|
60 | + for ($j = 0; $j < S_NFLAGS; $j++) { |
|
61 | 61 | $x[] = sprintf( |
62 | 62 | '<input type="checkbox" name="role%d" value="1">', |
63 | 63 | $j |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (!$user) error_page('no user'); |
78 | 78 | BoincForumPrefs::lookup($user); |
79 | 79 | |
80 | - for ($i=0; $i<S_NFLAGS; $i++) { |
|
80 | + for ($i = 0; $i < S_NFLAGS; $i++) { |
|
81 | 81 | if (post_int("role$i", true) == 1) { |
82 | 82 | $bitset .= '1'; |
83 | 83 | echo "<br> setting $i"; |
@@ -103,5 +103,5 @@ discard block |
||
103 | 103 | user_permissions_form(); |
104 | 104 | } |
105 | 105 | |
106 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
106 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
107 | 107 | ?> |
@@ -7,7 +7,7 @@ |
||
7 | 7 | // add other criteria like # of countries (based on IP addr) |
8 | 8 | // consider only hosts with recent last RPC time |
9 | 9 | |
10 | -define ('MAX_HOSTS', 100); |
|
10 | +define('MAX_HOSTS', 100); |
|
11 | 11 | |
12 | 12 | require_once('../inc/boinc_db.inc'); |
13 | 13 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $parent_post_id = 0; |
57 | 57 | } |
58 | 58 | |
59 | -if ($filter != "false"){ |
|
59 | +if ($filter != "false") { |
|
60 | 60 | $filter = true; |
61 | 61 | } else { |
62 | 62 | $filter = false; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $warning = null; |
74 | -if ($content && (!$preview)){ |
|
74 | +if ($content && (!$preview)) { |
|
75 | 75 | check_tokens($logged_in_user->authenticator); |
76 | 76 | if (!akismet_check($logged_in_user, $content)) { |
77 | 77 | $warning = tra("Your post has been flagged as spam by the Akismet anti-spam system. Please modify your text and try again."); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | -page_head(tra("Post to thread")." '$thread->title'",'','','', $bbcode_js); |
|
96 | +page_head(tra("Post to thread")." '$thread->title'", '', '', '', $bbcode_js); |
|
97 | 97 | |
98 | 98 | if ($parent_post) { |
99 | 99 | echo sprintf( |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $x2 .= " method=\"post\" name=\"post\" onsubmit=\"return checkForm(this)\">\n"; |
162 | 162 | $x2 .= form_tokens($logged_in_user->authenticator); |
163 | 163 | $x2 .= $bbcode_html."<textarea class=\"form-control\" name=\"content\" rows=\"18\">"; |
164 | - $no_quote = get_int("no_quote", true)==1; |
|
164 | + $no_quote = get_int("no_quote", true) == 1; |
|
165 | 165 | if ($preview) { |
166 | 166 | $x2 .= htmlspecialchars($content); |
167 | 167 | } else if (!$no_quote) { |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | } |
171 | 171 | } |
172 | 172 | if (!$logged_in_user->prefs->no_signature_by_default) { |
173 | - $enable_signature='checked="true"'; |
|
173 | + $enable_signature = 'checked="true"'; |
|
174 | 174 | } else { |
175 | - $enable_signature=""; |
|
175 | + $enable_signature = ""; |
|
176 | 176 | } |
177 | 177 | $x2 .= sprintf('</textarea><p> </p> |
178 | 178 | <input class="btn btn-sm" %s type="submit" name="preview" value="%s"> |
@@ -200,11 +200,11 @@ discard block |
||
200 | 200 | return sprintf( |
201 | 201 | 'In reply to %s\'s message of %s: |
202 | 202 | [quote]%s[/quote]', |
203 | - $user?$user->name:'unknown user', |
|
203 | + $user ? $user->name : 'unknown user', |
|
204 | 204 | date_str($post->timestamp), |
205 | 205 | htmlspecialchars($post->content) |
206 | 206 | ); |
207 | 207 | } |
208 | 208 | |
209 | -$cvs_version_tracker[]="\$Id$"; |
|
209 | +$cvs_version_tracker[] = "\$Id$"; |
|
210 | 210 | ?> |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $parent_post_id = 0; |
57 | 57 | } |
58 | 58 | |
59 | -if ($filter != "false"){ |
|
59 | +if ($filter != "false") { |
|
60 | 60 | $filter = true; |
61 | 61 | } else { |
62 | 62 | $filter = false; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $warning = null; |
74 | -if ($content && (!$preview)){ |
|
74 | +if ($content && (!$preview)) { |
|
75 | 75 | check_tokens($logged_in_user->authenticator); |
76 | 76 | if (!akismet_check($logged_in_user, $content)) { |
77 | 77 | $warning = tra("Your post has been flagged as spam by the Akismet anti-spam system. Please modify your text and try again."); |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | $preview = post_str("preview", true); |
57 | 57 | $warning = null; |
58 | 58 | |
59 | -if ($content && $title && (!$preview)){ |
|
59 | +if ($content && $title && (!$preview)) { |
|
60 | 60 | if (post_str('add_signature', true)) { |
61 | - $add_signature = true; // set a flag and concatenate later |
|
62 | - } else { |
|
61 | + $add_signature = true; // set a flag and concatenate later |
|
62 | + } else { |
|
63 | 63 | $add_signature = false; |
64 | 64 | } |
65 | 65 | check_tokens($logged_in_user->authenticator); |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | if (post_str('subscribe', true)) { |
75 | 75 | BoincSubscription::replace($logged_in_user->id, $thread->id); |
76 | 76 | } |
77 | - header('Location: forum_thread.php?id=' . $thread->id); |
|
77 | + header('Location: forum_thread.php?id='.$thread->id); |
|
78 | 78 | } else { |
79 | 79 | error_page("Can't create thread. $forum_error"); |
80 | 80 | } |
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | -page_head(tra("Create new thread"),'','','', $bbcode_js); |
|
84 | +page_head(tra("Create new thread"), '', '', '', $bbcode_js); |
|
85 | 85 | show_forum_header($logged_in_user); |
86 | 86 | |
87 | 87 | if ($warning) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>"; |
123 | 123 | } |
124 | 124 | |
125 | -if ($force_title && $title){ |
|
125 | +if ($force_title && $title) { |
|
126 | 126 | row2( |
127 | 127 | tra("Title"), |
128 | 128 | sprintf( |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | row2( |
137 | 137 | tra("Title").$submit_help, |
138 | 138 | sprintf('<input type="text" class="form-control" name="title" value="%s">', |
139 | - $title?htmlspecialchars($title):'' |
|
139 | + $title ?htmlspecialchars($title) : '' |
|
140 | 140 | ), |
141 | 141 | null, FORUM_LH_PCT |
142 | 142 | ); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | sprintf( |
148 | 148 | '%s <textarea class="form-control" name="content" rows="12" cols="80">%s</textarea>', |
149 | 149 | $bbcode_html, |
150 | - $content?htmlspecialchars($content):'' |
|
150 | + $content ?htmlspecialchars($content) : '' |
|
151 | 151 | ), |
152 | 152 | null, FORUM_LH_PCT |
153 | 153 | ); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | if (!$logged_in_user->prefs->no_signature_by_default) { |
156 | 156 | $enable_signature = 'checked="true"'; |
157 | 157 | } else { |
158 | - $enable_signature=''; |
|
158 | + $enable_signature = ''; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | if (is_news_forum($forum)) { |
@@ -195,5 +195,5 @@ discard block |
||
195 | 195 | |
196 | 196 | page_tail(); |
197 | 197 | |
198 | -$cvs_version_tracker[]="\$Id$"; |
|
198 | +$cvs_version_tracker[] = "\$Id$"; |
|
199 | 199 | ?> |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | $preview = post_str("preview", true); |
57 | 57 | $warning = null; |
58 | 58 | |
59 | -if ($content && $title && (!$preview)){ |
|
59 | +if ($content && $title && (!$preview)) { |
|
60 | 60 | if (post_str('add_signature', true)) { |
61 | 61 | $add_signature = true; // set a flag and concatenate later |
62 | - } else { |
|
62 | + } else { |
|
63 | 63 | $add_signature = false; |
64 | 64 | } |
65 | 65 | check_tokens($logged_in_user->authenticator); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>"; |
123 | 123 | } |
124 | 124 | |
125 | -if ($force_title && $title){ |
|
125 | +if ($force_title && $title) { |
|
126 | 126 | row2( |
127 | 127 | tra("Title"), |
128 | 128 | sprintf( |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | return $x; |
52 | 52 | } |
53 | 53 | |
54 | -function pm_team_form($user, $teamid, $error=null) { |
|
54 | +function pm_team_form($user, $teamid, $error = null) { |
|
55 | 55 | global $bbcode_html, $bbcode_js; |
56 | 56 | $team = BoincTeam::lookup_id($teamid); |
57 | 57 | if (!$team) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | error_page("not admin"); |
62 | 62 | } |
63 | 63 | |
64 | - page_head(tra("Send message to team"),'','','', $bbcode_js); |
|
64 | + page_head(tra("Send message to team"), '', '', '', $bbcode_js); |
|
65 | 65 | |
66 | 66 | $subject = post_str("subject", true); |
67 | 67 | $content = post_str("content", true); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | function pm_form_page($replyto, $userid, $error = null) { |
114 | 114 | global $bbcode_html, $bbcode_js; |
115 | 115 | global $g_logged_in_user; |
116 | - page_head(tra("Send private message"),'','','', $bbcode_js); |
|
116 | + page_head(tra("Send private message"), '', '', '', $bbcode_js); |
|
117 | 117 | |
118 | 118 | if (post_str("preview", true) == tra("Preview")) { |
119 | 119 | $content = post_str("content", true); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | if (!$user) { |
138 | 138 | error_page("Sender no longer exists"); |
139 | 139 | } |
140 | - $writeto = UNIQUE_USER_NAME?$user->name:$userid." (".$user->name.")"; |
|
140 | + $writeto = UNIQUE_USER_NAME ? $user->name : $userid." (".$user->name.")"; |
|
141 | 141 | $subject = $message->subject; |
142 | 142 | if (substr($subject, 0, 3) != "re:") { |
143 | 143 | $subject = "re: ".$subject; |
@@ -147,15 +147,15 @@ discard block |
||
147 | 147 | if (!$user) { |
148 | 148 | error_page("Sender no longer exists"); |
149 | 149 | } |
150 | - $writeto = UNIQUE_USER_NAME?$user->name:$userid." (".$user->name.")"; |
|
150 | + $writeto = UNIQUE_USER_NAME ? $user->name : $userid." (".$user->name.")"; |
|
151 | 151 | } else { |
152 | 152 | $writeto = sanitize_tags(post_str("to", true)); |
153 | 153 | $subject = post_str("subject", true); |
154 | 154 | $content = post_str("content", true); |
155 | 155 | } |
156 | 156 | |
157 | - $content = $content?htmlspecialchars($content):''; |
|
158 | - $subject = $subject?htmlspecialchars($subject):''; |
|
157 | + $content = $content ?htmlspecialchars($content) : ''; |
|
158 | + $subject = $subject ?htmlspecialchars($subject) : ''; |
|
159 | 159 | |
160 | 160 | if ($error != null) { |
161 | 161 | echo "<p class=\"text-danger\">".$error."</p>\n"; |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | function send_pm_notification_email( |
212 | 212 | $logged_in_user, $to_user, $subject, $content |
213 | 213 | ) { |
214 | - $message = " |
|
214 | + $message = " |
|
215 | 215 | You have received a new private message at ".PROJECT.". |
216 | 216 | |
217 | 217 | From: $logged_in_user->name (ID $logged_in_user->id) |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $pm = BoincPrivateMessage::lookup_id($notify->opaque); |
242 | 242 | $from_user = BoincUser::lookup_id($pm->senderid); |
243 | 243 | if (!$pm || !$from_user) return null; |
244 | - return "<a href=pm.php>".tra("Private message%1 from %2, subject:" , "</a>", $from_user->name )." $pm->subject"; |
|
244 | + return "<a href=pm.php>".tra("Private message%1 from %2, subject:", "</a>", $from_user->name)." $pm->subject"; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | function pm_send_msg($from_user, $to_user, $subject, $content, $send_email) { |
@@ -305,11 +305,11 @@ discard block |
||
305 | 305 | |
306 | 306 | function pm_email_remind($user) { |
307 | 307 | if (!$user->prefs->pm_notification) { |
308 | - return "<br><small>" . |
|
308 | + return "<br><small>". |
|
309 | 309 | tra( |
310 | 310 | "For email notification, %1 edit community prefs %2", |
311 | 311 | '<a href="edit_forum_preferences_form.php">', '</a>' |
312 | - ) . |
|
312 | + ). |
|
313 | 313 | "</small>" |
314 | 314 | ; |
315 | 315 | } |
@@ -335,5 +335,5 @@ discard block |
||
335 | 335 | } |
336 | 336 | } |
337 | 337 | |
338 | -$cvs_version_tracker[]="\$Id: pm.inc 14019 2007-11-01 23:04:39Z davea $"; |
|
338 | +$cvs_version_tracker[] = "\$Id: pm.inc 14019 2007-11-01 23:04:39Z davea $"; |
|
339 | 339 | ?> |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | if ($n === false) return ''; |
34 | 34 | $m = strpos($p, ']', $n); |
35 | 35 | if ($m === false) return ''; |
36 | - $x = substr($p, $n+5, $m-$n-5); |
|
36 | + $x = substr($p, $n + 5, $m - $n - 5); |
|
37 | 37 | |
38 | 38 | $n = strpos($x, ' '); |
39 | 39 | if ($n !== false) return substr($x, 0, $n); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if ($n === false) return ''; |
48 | 48 | $m = strpos($p, ']', $n); |
49 | 49 | if ($m === false) return ''; |
50 | - $x = substr($p, $n+5, $m-$n-5); |
|
50 | + $x = substr($p, $n + 5, $m - $n - 5); |
|
51 | 51 | $n = strpos($x, '_'); |
52 | 52 | if ($n !== false) return substr($x, 0, $n); |
53 | 53 | $n = strpos($x, 'r'); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | function main() { |
59 | 59 | global $max_days; |
60 | - $t = time()-$max_days*86400; |
|
60 | + $t = time() - $max_days*86400; |
|
61 | 61 | $hosts = BoincHost::enum("rpc_time>$t"); |
62 | 62 | $descs = []; |
63 | 63 | foreach ($hosts as $host) { |