@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $db = BoincDb::get(); |
28 | 28 | return $db->lookup('category', 'BoincCategory', $clause); |
29 | 29 | } |
30 | - static function enum($clause=null) { |
|
30 | + static function enum($clause = null) { |
|
31 | 31 | $db = BoincDb::get(); |
32 | 32 | return $db->enum('category', 'BoincCategory', $clause); |
33 | 33 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $db = BoincDb::get(); |
79 | 79 | return $db->update($this, 'thread', $clause); |
80 | 80 | } |
81 | - static function enum($clause="") { |
|
81 | + static function enum($clause = "") { |
|
82 | 82 | $db = BoincDb::get(); |
83 | 83 | return $db->enum('thread', 'BoincThread', $clause); |
84 | 84 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $db = BoincDb::get(); |
143 | 143 | $ret = $db->insert('forum_preferences', $clause); |
144 | 144 | } |
145 | - static function lookup(&$user, $nocache=false) { |
|
145 | + static function lookup(&$user, $nocache = false) { |
|
146 | 146 | if (!$user) return; |
147 | 147 | if (isset($user->prefs)) return; |
148 | 148 | if (!$nocache && isset(self::$cache[$user->id])) { |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $user->prefs = $prefs; |
165 | 165 | } |
166 | 166 | function privilege($specialbit) { |
167 | - return (substr($this->special_user, $specialbit,1)==1); |
|
167 | + return (substr($this->special_user, $specialbit, 1) == 1); |
|
168 | 168 | } |
169 | 169 | function update($clause) { |
170 | 170 | $db = BoincDb::get(); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $db = BoincDb::get(); |
176 | 176 | return $db->delete_aux('forum_preferences', "userid=$this->userid"); |
177 | 177 | } |
178 | - static function enum($clause=null) { |
|
178 | + static function enum($clause = null) { |
|
179 | 179 | $db = BoincDb::get(); |
180 | 180 | return $db->enum('forum_preferences', 'BoincForumPrefs', $clause); |
181 | 181 | } |
@@ -215,8 +215,8 @@ discard block |
||
215 | 215 | // |
216 | 216 | $fl = BoincForumLogging::lookup(0, 0); |
217 | 217 | if ($fl) { |
218 | - if ($fl->timestamp<time()-MAX_FORUM_LOGGING_TIME){ |
|
219 | - BoincForumLogging::delete_aux("timestamp<'".(time()-MAX_FORUM_LOGGING_TIME)."' and userid != 0"); |
|
218 | + if ($fl->timestamp < time() - MAX_FORUM_LOGGING_TIME) { |
|
219 | + BoincForumLogging::delete_aux("timestamp<'".(time() - MAX_FORUM_LOGGING_TIME)."' and userid != 0"); |
|
220 | 220 | BoincForumLogging::replace(0, 0, time()); |
221 | 221 | } |
222 | 222 | } else { |
@@ -326,10 +326,10 @@ discard block |
||
326 | 326 | } |
327 | 327 | } |
328 | 328 | |
329 | -define ('NOTIFY_FRIEND_REQ', 1); |
|
330 | -define ('NOTIFY_FRIEND_ACCEPT', 2); |
|
331 | -define ('NOTIFY_PM', 3); |
|
332 | -define ('NOTIFY_SUBSCRIBED_THREAD', 4); |
|
333 | -define ('NOTIFY_SUBSCRIBED_FORUM', 5); |
|
329 | +define('NOTIFY_FRIEND_REQ', 1); |
|
330 | +define('NOTIFY_FRIEND_ACCEPT', 2); |
|
331 | +define('NOTIFY_PM', 3); |
|
332 | +define('NOTIFY_SUBSCRIBED_THREAD', 4); |
|
333 | +define('NOTIFY_SUBSCRIBED_FORUM', 5); |
|
334 | 334 | |
335 | 335 | ?> |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | // - project forums: everyone in POST_REPORT_EMAILS |
25 | 25 | // - team message board: team founder and admins |
26 | 26 | // |
27 | -function mail_report_list($forum, $subject, $body, $must_send=false) { |
|
27 | +function mail_report_list($forum, $subject, $body, $must_send = false) { |
|
28 | 28 | $success = true; |
29 | 29 | switch ($forum->parent_type) { |
30 | 30 | case 0: |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | function send_moderation_email($forum, $post, $thread, $explanation, $action) { |
66 | 66 | global $master_url; |
67 | 67 | |
68 | - $moderator=get_logged_in_user(); |
|
68 | + $moderator = get_logged_in_user(); |
|
69 | 69 | $body = ""; |
70 | 70 | $user = BoincUser::lookup_id($post->user); |
71 | 71 | |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | // There's a new post in the thread, which the user is subscribed to. |
127 | 127 | // send them an email notifying them. |
128 | 128 | // |
129 | -function send_thread_notification_email($thread, $user){ |
|
130 | - $title = PROJECT . ": there is a new post in '". $thread->title ."'"; |
|
131 | - $link = secure_url_base() . "forum_thread.php?id=" . $thread->id; |
|
132 | - $body = "A " . PROJECT . " user has posted to the thread |
|
133 | -\"" . $thread->title . "\".\n" |
|
129 | +function send_thread_notification_email($thread, $user) { |
|
130 | + $title = PROJECT.": there is a new post in '".$thread->title."'"; |
|
131 | + $link = secure_url_base()."forum_thread.php?id=".$thread->id; |
|
132 | + $body = "A ".PROJECT." user has posted to the thread |
|
133 | +\"" . $thread->title."\".\n" |
|
134 | 134 | ."To view the updated thread, visit:\n$link |
135 | 135 | |
136 | 136 | -------------------------- |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | // There's a new thread in the forum, which the user is subscribed to. |
145 | 145 | // send them an email notifying them. |
146 | 146 | // |
147 | -function send_forum_notification_email($forum, $user){ |
|
148 | - $title = PROJECT . ": there is a new thread in '". $forum->title ."'"; |
|
149 | - $link = secure_url_base() . "forum_forum.php?id=" . $forum->id; |
|
150 | - $body = "A " . PROJECT . " user has added a thread to the forum |
|
151 | -\"" . $thread->title . "\".\n" |
|
147 | +function send_forum_notification_email($forum, $user) { |
|
148 | + $title = PROJECT.": there is a new thread in '".$forum->title."'"; |
|
149 | + $link = secure_url_base()."forum_forum.php?id=".$forum->id; |
|
150 | + $body = "A ".PROJECT." user has added a thread to the forum |
|
151 | +\"" . $thread->title."\".\n" |
|
152 | 152 | ."To view the updated forum, visit:\n$link |
153 | 153 | |
154 | 154 | -------------------------- |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | //////////////////// a user clicks the red "x" to report a post /////////// |
163 | 163 | // |
164 | -function send_report_post_email($user, $forum, $thread, $post, $message) { |
|
164 | +function send_report_post_email($user, $forum, $thread, $post, $message) { |
|
165 | 165 | global $master_url; |
166 | 166 | |
167 | 167 | $body = ""; |
@@ -219,16 +219,16 @@ discard block |
||
219 | 219 | // |
220 | 220 | function send_banish_vote_email($user, $duration, $reason, $end_time) { |
221 | 221 | global $master_url; |
222 | - $now=time(); |
|
222 | + $now = time(); |
|
223 | 223 | $subject = PROJECT." banishment vote underway"; |
224 | 224 | $vote_url = $master_url."forum_banishment_vote.php"; |
225 | 225 | $body = " |
226 | 226 | A vote has been started to banish you |
227 | 227 | from the ".PROJECT." message boards until ".date('M j, |
228 | -Y G:i', $duration+$now).", |
|
228 | +Y G:i', $duration + $now).", |
|
229 | 229 | because your postings have not followed our guidelines. |
230 | 230 | |
231 | -This vote will last until ".date('M j, Y G:i',$end_time)." or until a majority |
|
231 | +This vote will last until ".date('M j, Y G:i', $end_time)." or until a majority |
|
232 | 232 | decision has been reached. If the vote does not result in banishment, you will be |
233 | 233 | able to resume posting at that time. |
234 | 234 | "; |
@@ -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) { |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | // close() closes the connection. |
45 | 45 | |
46 | 46 | class BoincDb { |
47 | - static $instance; // a DbConn object, or null |
|
48 | - static $dbnum; // which replica we're connected to |
|
47 | + static $instance; // a DbConn object, or null |
|
48 | + static $dbnum; // which replica we're connected to |
|
49 | 49 | |
50 | 50 | // connect to DB $dbnum (0, 1, ...) |
51 | 51 | // If the requested DB doesn't exist or connection fails, connect to DB 0. |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | self::$instance = null; |
57 | 57 | $config = get_config(); |
58 | 58 | if ($dbnum) { |
59 | - $r = $dbnum==1?'':strval($dbnum); |
|
59 | + $r = $dbnum == 1 ? '' : strval($dbnum); |
|
60 | 60 | $host = parse_config($config, sprintf('<replica%s_db_host>', $r)); |
61 | 61 | $name = parse_config($config, sprintf('<replica%s_db_name>', $r)); |
62 | 62 | $user = parse_config($config, sprintf('<replica%s_db_user>', $r)); |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | $db = BoincDb::get(); |
202 | 202 | return $db->update($this, 'user', $clause); |
203 | 203 | } |
204 | - static function enum($where_clause, $order_clause=null) { |
|
204 | + static function enum($where_clause, $order_clause = null) { |
|
205 | 205 | $db = BoincDb::get(); |
206 | 206 | return $db->enum('user', 'BoincUser', $where_clause, $order_clause); |
207 | 207 | } |
208 | - static function enum_fields($fields, $where_clause, $order_clause=null) { |
|
208 | + static function enum_fields($fields, $where_clause, $order_clause = null) { |
|
209 | 209 | $db = BoincDb::get(); |
210 | 210 | return $db->enum_fields( |
211 | 211 | 'user', 'BoincUser', $fields, $where_clause, $order_clause |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | $db = BoincDb::get(); |
256 | 256 | return $db->update($this, 'team', $clause); |
257 | 257 | } |
258 | - static function enum($where_clause, $order_clause=null) { |
|
258 | + static function enum($where_clause, $order_clause = null) { |
|
259 | 259 | $db = BoincDb::get(); |
260 | 260 | return $db->enum('team', 'BoincTeam', $where_clause, $order_clause); |
261 | 261 | } |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $db = BoincDb::get(); |
281 | 281 | return $db->max('team', $field); |
282 | 282 | } |
283 | - static function enum_fields($fields, $where_clause, $order_clause=null) { |
|
283 | + static function enum_fields($fields, $where_clause, $order_clause = null) { |
|
284 | 284 | $db = BoincDb::get(); |
285 | 285 | return $db->enum_fields( |
286 | 286 | 'team', 'BoincTeam', $fields, $where_clause, $order_clause |
@@ -318,11 +318,11 @@ discard block |
||
318 | 318 | $db = BoincDb::get(); |
319 | 319 | return $db->delete($this, 'host'); |
320 | 320 | } |
321 | - static function enum($where_clause, $order_clause=null) { |
|
321 | + static function enum($where_clause, $order_clause = null) { |
|
322 | 322 | $db = BoincDb::get(); |
323 | 323 | return $db->enum('host', 'BoincHost', $where_clause, $order_clause); |
324 | 324 | } |
325 | - static function enum_fields($fields, $where_clause, $order_clause=null) { |
|
325 | + static function enum_fields($fields, $where_clause, $order_clause = null) { |
|
326 | 326 | $db = BoincDb::get(); |
327 | 327 | return $db->enum_fields( |
328 | 328 | 'host', 'BoincHost', $fields, $where_clause, $order_clause |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $db = BoincDb::get(); |
445 | 445 | return $db->update($this, 'app', $clause); |
446 | 446 | } |
447 | - static function sum($field, $clause=null) { |
|
447 | + static function sum($field, $clause = null) { |
|
448 | 448 | $db = BoincDb::get(); |
449 | 449 | return $db->sum('app', $field, $clause); |
450 | 450 | } |
@@ -502,11 +502,11 @@ discard block |
||
502 | 502 | $db = BoincDb::get(); |
503 | 503 | return $db->insert('profile', $clause); |
504 | 504 | } |
505 | - static function enum($where_clause=null, $order_clause=null) { |
|
505 | + static function enum($where_clause = null, $order_clause = null) { |
|
506 | 506 | $db = BoincDb::get(); |
507 | 507 | return $db->enum('profile', 'BoincProfile', $where_clause, $order_clause); |
508 | 508 | } |
509 | - static function enum_fields($fields, $where_clause=null, $order_clause=null) { |
|
509 | + static function enum_fields($fields, $where_clause = null, $order_clause = null) { |
|
510 | 510 | $db = BoincDb::get(); |
511 | 511 | return $db->enum_fields('profile', 'BoincProfile', $fields, $where_clause, $order_clause); |
512 | 512 | } |
@@ -901,12 +901,12 @@ discard block |
||
901 | 901 | return $db->enum('consent', 'BoincConsent', $where_clause); |
902 | 902 | } |
903 | 903 | |
904 | - static function insert ($clause) { |
|
904 | + static function insert($clause) { |
|
905 | 905 | $db = BoincDb::get(); |
906 | 906 | return $db->insert('consent', $clause); |
907 | 907 | } |
908 | 908 | |
909 | - static function update ($clause) { |
|
909 | + static function update($clause) { |
|
910 | 910 | $db = BoincDb::get(); |
911 | 911 | return $db->update_aux('consent', $clause); |
912 | 912 | } |
@@ -931,17 +931,17 @@ discard block |
||
931 | 931 | return $db->lookup('consent_type', 'BoincConsentType', $clause); |
932 | 932 | } |
933 | 933 | |
934 | - static function enum($where_clause, $order_clause=null) { |
|
934 | + static function enum($where_clause, $order_clause = null) { |
|
935 | 935 | $db = BoincDb::get(); |
936 | 936 | return $db->enum('consent_type', 'BoincConsentType', $where_clause, $order_clause); |
937 | 937 | } |
938 | 938 | |
939 | - static function insert ($clause) { |
|
939 | + static function insert($clause) { |
|
940 | 940 | $db = BoincDb::get(); |
941 | 941 | return $db->insert('consent_type', $clause); |
942 | 942 | } |
943 | 943 | |
944 | - static function update ($clause) { |
|
944 | + static function update($clause) { |
|
945 | 945 | $db = BoincDb::get(); |
946 | 946 | return $db->update_aux('consent_type', $clause); |
947 | 947 | } |
@@ -967,7 +967,7 @@ discard block |
||
967 | 967 | return $db->lookup('latest_consent', 'BoincLatestConsent', $clause); |
968 | 968 | } |
969 | 969 | |
970 | - static function enum($where_clause, $order_clause=null) { |
|
970 | + static function enum($where_clause, $order_clause = null) { |
|
971 | 971 | $db = BoincDb::get(); |
972 | 972 | return $db->enum('latest_consent', 'BoincLatestConsent', $where_clause, $order_clause); |
973 | 973 | } |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | // apply this to any user-supplied strings used in queries |
979 | 979 | // |
980 | 980 | function boinc_real_escape_string($x) { |
981 | - if (version_compare(phpversion(),"4.3.0")>=0) { |
|
981 | + if (version_compare(phpversion(), "4.3.0") >= 0) { |
|
982 | 982 | return BoincDb::escape_string($x); |
983 | 983 | } else { |
984 | 984 | $x = str_replace("'", "\'", $x); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $avg = round($app->info->avg, 2); |
181 | 181 | $min = round($app->info->min, 2); |
182 | 182 | $max = round($app->info->max, 2); |
183 | - $x = $max?"$avg ($min - $max)":"---"; |
|
183 | + $x = $max ? "$avg ($min - $max)" : "---"; |
|
184 | 184 | $u = $app->info->users; |
185 | 185 | } else { |
186 | 186 | $x = '---'; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $cmd = trim($cmd); |
276 | 276 | $x = explode(" ", $cmd); |
277 | 277 | $prog = $x[0]; |
278 | - $pidname = $prog . '.pid'; |
|
278 | + $pidname = $prog.'.pid'; |
|
279 | 279 | } |
280 | 280 | $path = "../../pid_$host/$pidname"; |
281 | 281 | if (is_file($path)) { |
@@ -316,12 +316,12 @@ discard block |
||
316 | 316 | } |
317 | 317 | $master_host = $u["host"]; |
318 | 318 | if ($config->www_host) { |
319 | - $web_host = trim((string) $config->www_host); |
|
319 | + $web_host = trim((string)$config->www_host); |
|
320 | 320 | } else { |
321 | 321 | $web_host = $main_host; |
322 | 322 | } |
323 | 323 | if ($config->sched_host) { |
324 | - $sched_host = trim((string) $config->sched_host); |
|
324 | + $sched_host = trim((string)$config->sched_host); |
|
325 | 325 | } else { |
326 | 326 | $sched_host = $main_host; |
327 | 327 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | |
332 | 332 | // the upload and download servers are sort of daemons too |
333 | 333 | // |
334 | - $url = trim((string) $config->download_url); |
|
334 | + $url = trim((string)$config->download_url); |
|
335 | 335 | $u = parse_url($url); |
336 | 336 | $h = $u["host"]; |
337 | 337 | if ($h == $master_host) { |
@@ -343,14 +343,14 @@ discard block |
||
343 | 343 | } else { |
344 | 344 | $have_remote = true; |
345 | 345 | } |
346 | - $url = trim((string) $config->upload_url); |
|
346 | + $url = trim((string)$config->upload_url); |
|
347 | 347 | $u = parse_url($url); |
348 | 348 | $h = $u["host"]; |
349 | 349 | if ($h == $master_host) { |
350 | 350 | $y = new StdClass; |
351 | 351 | $y->cmd = "Upload server"; |
352 | 352 | $y->host = $h; |
353 | - $y->status = !file_exists("../../stop_upload");; |
|
353 | + $y->status = !file_exists("../../stop_upload"); ; |
|
354 | 354 | $local_daemons[] = $y; |
355 | 355 | } else { |
356 | 356 | $have_remote = true; |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | $y = new StdClass; |
362 | 362 | $y->cmd = "Scheduler"; |
363 | 363 | $y->host = $sched_host; |
364 | - $y->status = !file_exists("../../stop_sched");; |
|
364 | + $y->status = !file_exists("../../stop_sched"); ; |
|
365 | 365 | $local_daemons[] = $y; |
366 | 366 | |
367 | 367 | foreach ($daemons->daemon as $d) { |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $disabled_daemons[] = $x; |
375 | 375 | continue; |
376 | 376 | } |
377 | - $host = $d->host?(string)$d->host:$main_host; |
|
377 | + $host = $d->host ? (string)$d->host : $main_host; |
|
378 | 378 | if ($host != $web_host) { |
379 | 379 | $have_remote = true; |
380 | 380 | continue; |
@@ -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, |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | function check_passwd_ui($user, $passwd) { |
59 | 59 | $passwd_hash = md5($passwd.$user->email_addr); |
60 | - if(!check_passwd_hash($user, $passwd_hash)) { |
|
60 | + if (!check_passwd_hash($user, $passwd_hash)) { |
|
61 | 61 | sleep(LOGIN_FAIL_SLEEP_SEC); |
62 | 62 | page_head("Password incorrect"); |
63 | 63 | echo "The password you entered is incorrect. Please go back and try again.\n"; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | function is_banned_email_addr($email_addr) { |
70 | 70 | global $banned_email_domains; |
71 | 71 | if (isset($banned_email_domains)) { |
72 | - foreach($banned_email_domains as $d) { |
|
72 | + foreach ($banned_email_domains as $d) { |
|
73 | 73 | $x = strstr($email_addr, $d); |
74 | 74 | if ($x == $d) return true; |
75 | 75 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | // |
109 | 109 | function make_user( |
110 | 110 | $email_addr, $name, $passwd_hash, |
111 | - $country=null, $postal_code=null, $project_prefs=null, $teamid=0 |
|
111 | + $country = null, $postal_code = null, $project_prefs = null, $teamid = 0 |
|
112 | 112 | ) { |
113 | 113 | if (!is_valid_email_syntax($email_addr)) return null; |
114 | 114 | // caller generally has already checked |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $users = BoincUser::enum( |
244 | 244 | sprintf("name like '%s%%'", $new_name) |
245 | 245 | ); |
246 | - foreach ($users as $u){ |
|
246 | + foreach ($users as $u) { |
|
247 | 247 | echo "<p>$u->name\n"; |
248 | 248 | } |
249 | 249 | page_tail(); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | show_error(tra("Passwords may only include ASCII characters.")); |
279 | 279 | } |
280 | 280 | |
281 | - if (strlen($passwd)<$min_passwd_length) { |
|
281 | + if (strlen($passwd) < $min_passwd_length) { |
|
282 | 282 | show_error( |
283 | 283 | tra("New password is too short: minimum password length is %1 characters.", $min_passwd_length) |
284 | 284 | ); |
@@ -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 |