@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | BoincForumPrefs::lookup($user); |
31 | 31 | |
32 | -if (post_str("action", true)=="reset_confirm"){ |
|
32 | +if (post_str("action", true) == "reset_confirm") { |
|
33 | 33 | page_head(tra("Confirm reset")); |
34 | 34 | echo tra("This action will erase any changes you have made in your community preferences. To cancel, click your browser's Back button.")." |
35 | 35 | <p> |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | // If the user has requested a reset of preferences; |
46 | 46 | // preserve a few fields. |
47 | 47 | // |
48 | -if (post_str("action", true)=="reset"){ |
|
48 | +if (post_str("action", true) == "reset") { |
|
49 | 49 | $posts = $user->prefs->posts; |
50 | 50 | $last_post = $user->prefs->last_post; |
51 | 51 | $rated_posts = $user->prefs->rated_posts; |
@@ -67,30 +67,30 @@ discard block |
||
67 | 67 | if (!DISABLE_FORUMS) { |
68 | 68 | |
69 | 69 | $avatar_type = post_int("avatar_select"); |
70 | -$newfile=IMAGE_PATH.$user->id."_avatar.jpg"; |
|
70 | +$newfile = IMAGE_PATH.$user->id."_avatar.jpg"; |
|
71 | 71 | |
72 | 72 | // Update the user avatar |
73 | -if ($avatar_type<0 or $avatar_type>3) $avatar_type=0; |
|
74 | -if ($avatar_type==0){ |
|
75 | - if (file_exists($newfile)){ |
|
73 | +if ($avatar_type < 0 or $avatar_type > 3) $avatar_type = 0; |
|
74 | +if ($avatar_type == 0) { |
|
75 | + if (file_exists($newfile)) { |
|
76 | 76 | // Delete the file on the server if the user |
77 | 77 | // decides not to use an avatar |
78 | 78 | // |
79 | 79 | unlink($newfile); |
80 | 80 | } |
81 | - $avatar_url=""; |
|
81 | + $avatar_url = ""; |
|
82 | 82 | } elseif ($avatar_type == 1) { |
83 | 83 | $avatar_url = "//www.gravatar.com/avatar/".md5($user->email_addr)."?s=100&d=identicon"; |
84 | -} elseif ($avatar_type==2){ |
|
85 | - if (($rpc && (post_str("avatar_url", true) != null)) || ($_FILES['picture']['tmp_name']!="")) { |
|
86 | - if ($_FILES['picture']['tmp_name']!="") { |
|
84 | +} elseif ($avatar_type == 2) { |
|
85 | + if (($rpc && (post_str("avatar_url", true) != null)) || ($_FILES['picture']['tmp_name'] != "")) { |
|
86 | + if ($_FILES['picture']['tmp_name'] != "") { |
|
87 | 87 | $file = $_FILES['picture']['tmp_name']; |
88 | 88 | } else { |
89 | 89 | // Remote image. Download and store locally |
90 | 90 | $file = post_str("avatar_url"); |
91 | 91 | } |
92 | 92 | $size = getImageSize($file); |
93 | - if ($size[2]!=2 and $size[2]!=3){ |
|
93 | + if ($size[2] != 2 and $size[2] != 3) { |
|
94 | 94 | //Not the right kind of file |
95 | 95 | error_page(tra("Error: Not the right kind of file, only PNG and JPEG are supported.")); |
96 | 96 | } |
@@ -99,30 +99,30 @@ discard block |
||
99 | 99 | $image2 = intelligently_scale_image($file, 100, 100); |
100 | 100 | ImageJPEG($image2, $newfile); |
101 | 101 | } |
102 | - if (file_exists($newfile)){ |
|
103 | - $avatar_url=IMAGE_URL.$user->id."_avatar.jpg"; //$newfile; |
|
102 | + if (file_exists($newfile)) { |
|
103 | + $avatar_url = IMAGE_URL.$user->id."_avatar.jpg"; //$newfile; |
|
104 | 104 | } else { |
105 | 105 | //User didn't upload a compatible file or it went lost on the server |
106 | - $avatar_url=""; |
|
106 | + $avatar_url = ""; |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
110 | -$images_as_links = (isset($_POST["forum_images_as_links"]) && $_POST["forum_images_as_links"]!="")?1:0; |
|
111 | -$link_popup = (isset($_POST["forum_link_popup"]) && $_POST["forum_link_popup"]!="")?1:0; |
|
112 | -$hide_avatars = (isset($_POST["forum_hide_avatars"]) && $_POST["forum_hide_avatars"]!="")?1:0; |
|
113 | -$hide_signatures = (isset($_POST["forum_hide_signatures"]) && $_POST["forum_hide_signatures"]!="")?1:0; |
|
114 | -$highlight_special = (isset($_POST["forum_highlight_special"]) && $_POST["forum_highlight_special"]!="")?1:0; |
|
115 | -$jump_to_unread = (isset($_POST["forum_jump_to_unread"]) && $_POST["forum_jump_to_unread"]!="")?1:0; |
|
116 | -$ignore_sticky_posts = (isset($_POST["forum_ignore_sticky_posts"]) && $_POST["forum_ignore_sticky_posts"]!="")?1:0; |
|
117 | -$no_signature_by_default = (isset($_POST["signature_by_default"]) && $_POST["signature_by_default"]!="")?0:1; |
|
110 | +$images_as_links = (isset($_POST["forum_images_as_links"]) && $_POST["forum_images_as_links"] != "") ? 1 : 0; |
|
111 | +$link_popup = (isset($_POST["forum_link_popup"]) && $_POST["forum_link_popup"] != "") ? 1 : 0; |
|
112 | +$hide_avatars = (isset($_POST["forum_hide_avatars"]) && $_POST["forum_hide_avatars"] != "") ? 1 : 0; |
|
113 | +$hide_signatures = (isset($_POST["forum_hide_signatures"]) && $_POST["forum_hide_signatures"] != "") ? 1 : 0; |
|
114 | +$highlight_special = (isset($_POST["forum_highlight_special"]) && $_POST["forum_highlight_special"] != "") ? 1 : 0; |
|
115 | +$jump_to_unread = (isset($_POST["forum_jump_to_unread"]) && $_POST["forum_jump_to_unread"] != "") ? 1 : 0; |
|
116 | +$ignore_sticky_posts = (isset($_POST["forum_ignore_sticky_posts"]) && $_POST["forum_ignore_sticky_posts"] != "") ? 1 : 0; |
|
117 | +$no_signature_by_default = (isset($_POST["signature_by_default"]) && $_POST["signature_by_default"] != "") ? 0 : 1; |
|
118 | 118 | $signature = post_str("signature", true); |
119 | -if (strlen($signature)>250) { |
|
119 | +if (strlen($signature) > 250) { |
|
120 | 120 | error_page(tra("Your signature was too long, please keep it less than 250 characters.")); |
121 | 121 | } |
122 | 122 | $forum_sort = post_int("forum_sort"); |
123 | 123 | $thread_sort = post_int("thread_sort"); |
124 | 124 | $display_wrap_postcount = post_int("forum_display_wrap_postcount"); |
125 | -if ($display_wrap_postcount<1) $display_wrap_postcount=1; |
|
125 | +if ($display_wrap_postcount < 1) $display_wrap_postcount = 1; |
|
126 | 126 | |
127 | 127 | $signature = BoincDb::escape_string($signature); |
128 | 128 | |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | } |
142 | 142 | } else { |
143 | 143 | // todo: clean up the following |
144 | - $add_user_to_filter = (isset($_POST["add_user_to_filter"]) && $_POST["add_user_to_filter"]!=""); |
|
145 | - if ($add_user_to_filter){ |
|
144 | + $add_user_to_filter = (isset($_POST["add_user_to_filter"]) && $_POST["add_user_to_filter"] != ""); |
|
145 | + if ($add_user_to_filter) { |
|
146 | 146 | $user_to_add = trim($_POST["forum_filter_user"]); |
147 | - if ($user_to_add!="" and $user_to_add==strval(intval($user_to_add))){ |
|
147 | + if ($user_to_add != "" and $user_to_add == strval(intval($user_to_add))) { |
|
148 | 148 | $other_user = BoincUser::lookup_id($user_to_add); |
149 | 149 | if (!$other_user) { |
150 | 150 | echo tra("No such user:")." ".$user_to_add; |
@@ -159,9 +159,9 @@ discard block |
||
159 | 159 | // |
160 | 160 | $ignored_users = get_ignored_list($user); |
161 | 161 | // todo: use foreach |
162 | -for ($i=0;$i<sizeof($ignored_users);$i++){ |
|
162 | +for ($i = 0; $i < sizeof($ignored_users); $i++) { |
|
163 | 163 | $remove = "remove".trim($ignored_users[$i]); |
164 | - if (isset($_POST[$remove]) && $_POST[$remove]!=""){ |
|
164 | + if (isset($_POST[$remove]) && $_POST[$remove] != "") { |
|
165 | 165 | $other_user = BoincUser::lookup_id($ignored_users[$i]); |
166 | 166 | if (!$other_user) { |
167 | 167 | echo tra("No such user:")." ".$ignored_users[$j]; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if ($notify) { |
39 | 39 | page_head(tra("Request pending")); |
40 | 40 | $t = date_str($friend->create_time); |
41 | - echo tra("You requested friendship with %1 on %2.", $destuser->name,$t) . " |
|
41 | + echo tra("You requested friendship with %1 on %2.", $destuser->name, $t)." |
|
42 | 42 | <p>" . |
43 | 43 | tra("This request is still pending confirmation."); |
44 | 44 | page_tail(); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | function check_ignoring($srcuser, $destuser) { |
52 | 52 | BoincForumPrefs::lookup($destuser); |
53 | 53 | if (is_ignoring($destuser, $srcuser)) { |
54 | - error_page(tra("%1 is not accepting friendship requests from you",$destuser->name)); |
|
54 | + error_page(tra("%1 is not accepting friendship requests from you", $destuser->name)); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | echo " |
73 | 73 | <form method=post action=friend.php> |
74 | 74 | <input type=hidden name=userid value=$destid> |
75 | - <input type=hidden name=action value=add_confirm>" . |
|
75 | + <input type=hidden name=action value=add_confirm>". |
|
76 | 76 | tra("You have asked to add %1 as a friend. We will notify %1 and will ask him/her to confirm that you are friends.", |
77 | - "<b>".$destuser->name."</b>") ." |
|
77 | + "<b>".$destuser->name."</b>")." |
|
78 | 78 | <p>" . |
79 | - tra("Add an optional message here:") ." |
|
79 | + tra("Add an optional message here:")." |
|
80 | 80 | <br> |
81 | 81 | ".textarea_with_counter("message", 250, "")." |
82 | 82 | <p> |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | send_friend_request_email($user, $destuser, $msg); |
116 | 116 | } |
117 | 117 | page_head(tra("Friend request sent")); |
118 | - echo tra("We have notified %1 of your request.","<b>".$destuser->name."</b>"); |
|
118 | + echo tra("We have notified %1 of your request.", "<b>".$destuser->name."</b>"); |
|
119 | 119 | page_tail(); |
120 | 120 | } |
121 | 121 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | page_head(tra("Friendship confirmed")); |
199 | - echo tra("Your friendship with %1 has been confirmed.","<b>" . $srcuser->name ."</b>"); |
|
199 | + echo tra("Your friendship with %1 has been confirmed.", "<b>".$srcuser->name."</b>"); |
|
200 | 200 | page_tail(); |
201 | 201 | } |
202 | 202 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $notify->delete(); |
216 | 216 | } |
217 | 217 | page_head(tra("Friendship declined")); |
218 | - echo tra("You have declined friendship with %1","<b>".$srcuser->name."</b>"); |
|
218 | + echo tra("You have declined friendship with %1", "<b>".$srcuser->name."</b>"); |
|
219 | 219 | page_tail(); |
220 | 220 | } |
221 | 221 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | echo tra("Notification not found"); |
234 | 234 | } |
235 | 235 | page_head(tra("Friend confirmed")); |
236 | - echo tra("You are now friends with %1.",$destuser->name); |
|
236 | + echo tra("You are now friends with %1.", $destuser->name); |
|
237 | 237 | page_tail(); |
238 | 238 | } |
239 | 239 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | echo |
246 | 246 | tra("Are you sure you want to cancel your friendship with %1?", |
247 | 247 | $destuser->name |
248 | - ) ."<p>\n" |
|
248 | + )."<p>\n" |
|
249 | 249 | ; |
250 | 250 | show_button("friend.php?action=cancel&userid=$destid", tra("Yes"), tra("Cancel friendship")); |
251 | 251 | show_button(HOME_PAGE, tra("No"), tra("Stay friends")); |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | if (!$destuser) error_page("No such user"); |
260 | 260 | BoincFriend::delete($user->id, $destid); |
261 | 261 | page_head(tra("Friendship cancelled")); |
262 | - echo tra("Your friendship with %1 has been cancelled.",$destuser->name); |
|
262 | + echo tra("Your friendship with %1 has been cancelled.", $destuser->name); |
|
263 | 263 | page_tail(); |
264 | 264 | } |
265 | 265 |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | 'type' => MENU_CALLBACK |
190 | 190 | ); |
191 | 191 | $items['account_finish.php'] = array( |
192 | - 'title' => 'Welcome to ' . variable_get('site_name', 'Drupal-BOINC'), |
|
192 | + 'title' => 'Welcome to '.variable_get('site_name', 'Drupal-BOINC'), |
|
193 | 193 | 'description' => 'RPC for after a user has created an account.', |
194 | 194 | 'page callback' => 'boincuser_account_finish', |
195 | 195 | 'access callback' => TRUE, |
@@ -249,8 +249,8 @@ discard block |
||
249 | 249 | // termsofuse is enabled, by having text in the termsofuse variable. |
250 | 250 | $existinguser_tou = variable_get('boinc_weboptions_existinguser_tou', FALSE); |
251 | 251 | $termsofuse = variable_get('boinc_weboptions_termsofuse', ''); |
252 | - if ( (!empty($termsofuse)) and ($user->uid) ) { |
|
253 | - if ( !boincuser_check_termsofuse($user) and ($existinguser_tou) ) { |
|
252 | + if ((!empty($termsofuse)) and ($user->uid)) { |
|
253 | + if (!boincuser_check_termsofuse($user) and ($existinguser_tou)) { |
|
254 | 254 | |
255 | 255 | // Admins are exempt, otherwise the admin may not be able to |
256 | 256 | // access the site! |
@@ -264,14 +264,14 @@ discard block |
||
264 | 264 | 'user/termsofuse', |
265 | 265 | 'logout', |
266 | 266 | 'account/info/edit', |
267 | - 'user/' . $user->uid . '/edit', |
|
268 | - 'user/' . $user->uid . '/recoveremail/*', |
|
267 | + 'user/'.$user->uid.'/edit', |
|
268 | + 'user/'.$user->uid.'/recoveremail/*', |
|
269 | 269 | 'recover_email.php', |
270 | 270 | ); |
271 | 271 | if (module_exists('boincuser_delete')) { |
272 | - $paths0[] = 'user/' . $user->uid . '/delete'; |
|
273 | - $paths0[] = 'user/' . $user->uid . '/deleteconfirm/*'; |
|
274 | - $paths0[] = 'user/' . $user->uid . '/odeleteconfirm/*'; |
|
272 | + $paths0[] = 'user/'.$user->uid.'/delete'; |
|
273 | + $paths0[] = 'user/'.$user->uid.'/deleteconfirm/*'; |
|
274 | + $paths0[] = 'user/'.$user->uid.'/odeleteconfirm/*'; |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | // Paths added by the admin |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | } |
283 | 283 | |
284 | 284 | // paths to ignore |
285 | - $paths_to_ignore = array_unique( array_merge($paths0, $paths2) ); |
|
285 | + $paths_to_ignore = array_unique(array_merge($paths0, $paths2)); |
|
286 | 286 | |
287 | 287 | if (!_boincuser_ignore_paths($path, $paths_to_ignore)) { |
288 | 288 | drupal_goto('user/termsofuse'); |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | require_boinc('password_compat/password'); |
305 | 305 | // Handle BOINC integration for users with UID > 1 (skip anonymous and admin) |
306 | 306 | if (isset($account->uid) && ($account->uid > 1)) { |
307 | - switch($op) { |
|
307 | + switch ($op) { |
|
308 | 308 | case 'load': |
309 | 309 | // User loading; insert BOINC data into the user object |
310 | 310 | $drupal_user = db_fetch_object(db_query(" |
@@ -334,11 +334,11 @@ discard block |
||
334 | 334 | )); |
335 | 335 | $account->boincuser_name = $boinc_user->name; |
336 | 336 | $account->boincuser_account_key = $boinc_user->authenticator; |
337 | - $account->boincuser_weak_auth = md5($boinc_user->authenticator . $boinc_user->passwd_hash); |
|
337 | + $account->boincuser_weak_auth = md5($boinc_user->authenticator.$boinc_user->passwd_hash); |
|
338 | 338 | $account->boincuser_total_credit = round($boinc_user->total_credit); |
339 | 339 | $account->boincuser_expavg_credit = round($boinc_user->expavg_credit); |
340 | 340 | $account->boincuser_expavg_time = round($boinc_user->expavg_time); |
341 | - $account->boincuser_cpid = md5($boinc_user->cross_project_id . $account->mail); |
|
341 | + $account->boincuser_cpid = md5($boinc_user->cross_project_id.$account->mail); |
|
342 | 342 | $account->boincuser_default_pref_set = $boinc_user->venue; |
343 | 343 | $account->boincteam_id = $boinc_user->teamid; |
344 | 344 | $account->boincuser_previous_email_addr = $boinc_user->previous_email_addr; |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | |
508 | 508 | // Set password hash appropriately |
509 | 509 | $passwd = ($edit['pass']) ? $edit['pass'] : $edit['current_pass']; |
510 | - $passwd_hash = password_hash( md5($passwd.$lower_email_addr), PASSWORD_DEFAULT ); |
|
510 | + $passwd_hash = password_hash(md5($passwd.$lower_email_addr), PASSWORD_DEFAULT); |
|
511 | 511 | // Algorithm for changing email and/or password |
512 | 512 | if ($changing_email) { |
513 | 513 | // locally store current email to set as previous email |
@@ -595,8 +595,8 @@ discard block |
||
595 | 595 | } |
596 | 596 | |
597 | 597 | // Check if user has agreed to terms of use. |
598 | - if ( (!empty($termsofuse)) and ($account->uid) and |
|
599 | - (!boincuser_check_termsofuse($account)) and ($existinguser_tou) ) { |
|
598 | + if ((!empty($termsofuse)) and ($account->uid) and |
|
599 | + (!boincuser_check_termsofuse($account)) and ($existinguser_tou)) { |
|
600 | 600 | |
601 | 601 | // Admins are exempted. |
602 | 602 | $administrator_role = array_search('administrator', user_roles(true)); |
@@ -610,9 +610,9 @@ discard block |
||
610 | 610 | $query_for_destination = ''; |
611 | 611 | $prevdest = $_REQUEST['destination']; |
612 | 612 | if ($prevdest) { |
613 | - $query_for_destination = '?destination=' . $prevdest; |
|
613 | + $query_for_destination = '?destination='.$prevdest; |
|
614 | 614 | } |
615 | - $_REQUEST['destination'] = $path_for_destination . $query_for_destination; |
|
615 | + $_REQUEST['destination'] = $path_for_destination.$query_for_destination; |
|
616 | 616 | |
617 | 617 | } |
618 | 618 | } |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | // In Drupal 7, these operation cases will all exist as their own hooks, |
646 | 646 | // so let's approximate that here so that this function can simply be removed |
647 | 647 | // upon migration to 7 |
648 | - switch($op) { |
|
648 | + switch ($op) { |
|
649 | 649 | case 'update': |
650 | 650 | boincuser_node_update($node); |
651 | 651 | } |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | * is updated (forward compatible to Drupal 7) |
657 | 657 | */ |
658 | 658 | function boincuser_node_update($node) { |
659 | - switch($node->type) { |
|
659 | + switch ($node->type) { |
|
660 | 660 | case 'profile': |
661 | 661 | // Update the BOINC database directly |
662 | 662 | $account = user_load($node->uid); |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | } |
779 | 779 | |
780 | 780 | $form['cancel'] = array( |
781 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_dest) . '</li>', |
|
781 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_dest).'</li>', |
|
782 | 782 | '#weight' => 1004, |
783 | 783 | ); |
784 | 784 | $form['form control tabs suffix'] = array( |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
812 | 812 | $form['buttons']['preview_changes']['#weight'] = 1004; |
813 | 813 | $form['buttons']['cancel'] = array( |
814 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}") . '</li>', |
|
814 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}").'</li>', |
|
815 | 815 | '#weight' => 1005, |
816 | 816 | ); |
817 | 817 | $form['buttons']['delete']['#prefix'] = '<li class="tab">'; |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | $form['actions']['submit']['#suffix'] = '</li>'; |
844 | 844 | $form['actions']['submit']['#weight'] = 1002; |
845 | 845 | $form['actions']['cancel'] = array( |
846 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}") . '</li>', |
|
846 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}").'</li>', |
|
847 | 847 | '#weight' => 1005, |
848 | 848 | ); |
849 | 849 | $form['actions']['form control tabs suffix'] = array( |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | $form['privatemsg']['preview']['#suffix'] = '</li>'; |
871 | 871 | $form['privatemsg']['preview']['#weight'] = 1003; |
872 | 872 | $form['privatemsg']['cancel'] = array( |
873 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>', |
|
873 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>', |
|
874 | 874 | '#weight' => 1004, |
875 | 875 | ); |
876 | 876 | $form['privatemsg']['form control tabs suffix'] = array( |
@@ -958,11 +958,11 @@ discard block |
||
958 | 958 | // Set special message if user has not agreed to TOU |
959 | 959 | $existinguser_tou = variable_get('boinc_weboptions_existinguser_tou', FALSE); |
960 | 960 | $termsofuse = variable_get('boinc_weboptions_termsofuse', ''); |
961 | - if ( (!boincuser_check_termsofuse($account)) and ($existinguser_tou) and (!empty($termsofuse)) and (!user_access('administer users')) ) { |
|
961 | + if ((!boincuser_check_termsofuse($account)) and ($existinguser_tou) and (!empty($termsofuse)) and (!user_access('administer users'))) { |
|
962 | 962 | drupal_set_message( |
963 | 963 | bts('INFO: You have not agreed to the terms of use for @project. You may use this form to change your email address and/or password. Please note: you may not delete your account within seven (7) days of changing your email address.', |
964 | 964 | array( |
965 | - '@project' => variable_get('site_name','Drupal-BOINC'), |
|
965 | + '@project' => variable_get('site_name', 'Drupal-BOINC'), |
|
966 | 966 | ), NULL, 'boinc:account-credentials-change') |
967 | 967 | , 'info'); |
968 | 968 | } |
@@ -1027,36 +1027,36 @@ discard block |
||
1027 | 1027 | $form['account']['boincuser_id'] = array( |
1028 | 1028 | '#value' => ' |
1029 | 1029 | <div class="form-item"> |
1030 | - <label>' . bts('BOINC user ID', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1031 | - <span>' . $account->boincuser_id . '</span> |
|
1030 | + <label>' . bts('BOINC user ID', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1031 | + <span>' . $account->boincuser_id.'</span> |
|
1032 | 1032 | </div>', |
1033 | 1033 | ); |
1034 | 1034 | $form['account']['user_id'] = array( |
1035 | 1035 | '#value' => ' |
1036 | 1036 | <div class="form-item"> |
1037 | - <label>' . bts('Drupal user ID', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1038 | - <span>' . $account->uid . '</span> |
|
1037 | + <label>' . bts('Drupal user ID', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1038 | + <span>' . $account->uid.'</span> |
|
1039 | 1039 | </div>', |
1040 | 1040 | ); |
1041 | 1041 | $form['account']['account_key'] = array( |
1042 | 1042 | '#value' => ' |
1043 | 1043 | <div class="form-item"> |
1044 | - <label>' . bts('Account key', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1045 | - <span>' . $account->boincuser_account_key . '</span> |
|
1044 | + <label>' . bts('Account key', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1045 | + <span>' . $account->boincuser_account_key.'</span> |
|
1046 | 1046 | </div>', |
1047 | 1047 | ); |
1048 | 1048 | $form['account']['weak_account_key'] = array( |
1049 | 1049 | '#value' => ' |
1050 | 1050 | <div class="form-item"> |
1051 | - <label>' . bts('Weak account key', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1052 | - <span>' . "{$account->boincuser_id}_{$account->boincuser_weak_auth}" . '</span> |
|
1051 | + <label>' . bts('Weak account key', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1052 | + <span>' . "{$account->boincuser_id}_{$account->boincuser_weak_auth}".'</span> |
|
1053 | 1053 | </div>', |
1054 | 1054 | ); |
1055 | 1055 | $form['account']['cpid'] = array( |
1056 | 1056 | '#value' => ' |
1057 | 1057 | <div class="form-item"> |
1058 | - <label>' . bts('Cross-project ID', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1059 | - <span>' . $account->boincuser_cpid . '</span> |
|
1058 | + <label>' . bts('Cross-project ID', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1059 | + <span>' . $account->boincuser_cpid.'</span> |
|
1060 | 1060 | </div>', |
1061 | 1061 | ); |
1062 | 1062 | |
@@ -1074,7 +1074,7 @@ discard block |
||
1074 | 1074 | $form['submit']['#suffix'] = '</li>'; |
1075 | 1075 | $form['submit']['#weight'] = 1002; |
1076 | 1076 | $form['cancel'] = array( |
1077 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>', |
|
1077 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>', |
|
1078 | 1078 | '#weight' => 1003, |
1079 | 1079 | ); |
1080 | 1080 | if (isset($form['delete']) AND is_array($form['delete'])) { |
@@ -1170,7 +1170,7 @@ discard block |
||
1170 | 1170 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
1171 | 1171 | $form['buttons']['preview_changes']['#weight'] = 1004; |
1172 | 1172 | $form['buttons']['cancel'] = array( |
1173 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>', |
|
1173 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>', |
|
1174 | 1174 | '#weight' => 1005, |
1175 | 1175 | ); |
1176 | 1176 | $form['buttons']['delete']['#prefix'] = '<li class="tab">'; |
@@ -1219,11 +1219,11 @@ discard block |
||
1219 | 1219 | // Set name temporarily to dummy value to beat validation |
1220 | 1220 | $form['name'] = array( |
1221 | 1221 | '#type' => 'hidden', |
1222 | - '#value' => rand() . '.' . time() |
|
1222 | + '#value' => rand().'.'.time() |
|
1223 | 1223 | ); |
1224 | 1224 | |
1225 | 1225 | // Add JS for submit button disabling |
1226 | - drupal_add_js(drupal_get_path('module', 'boincuser') . '/boincuser.js'); |
|
1226 | + drupal_add_js(drupal_get_path('module', 'boincuser').'/boincuser.js'); |
|
1227 | 1227 | |
1228 | 1228 | // Terms of use section |
1229 | 1229 | $termsofuse = variable_get('boinc_weboptions_termsofuse', ''); |
@@ -1239,7 +1239,7 @@ discard block |
||
1239 | 1239 | |
1240 | 1240 | $form['termsofuse']['title1'] = array( |
1241 | 1241 | '#weight' => -12, |
1242 | - '#value' => '<h2>' . bts(variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), array(), NULL, 'project:user-register' ) . '</h2>', |
|
1242 | + '#value' => '<h2>'.bts(variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), array(), NULL, 'project:user-register').'</h2>', |
|
1243 | 1243 | '#prefix' => '<div id="register-title1">', |
1244 | 1244 | '#suffix' => '</div>', |
1245 | 1245 | ); |
@@ -1262,7 +1262,7 @@ discard block |
||
1262 | 1262 | |
1263 | 1263 | $form['title2'] = array( |
1264 | 1264 | '#weight' => -6, |
1265 | - '#value' => '<h2>' . bts(variable_get('boinc_weboptions_registrationtitle2', 'Fill in your name, email, and choose a secure passphrase.'), array(), NULL, 'project:user-register') . '</h2>', |
|
1265 | + '#value' => '<h2>'.bts(variable_get('boinc_weboptions_registrationtitle2', 'Fill in your name, email, and choose a secure passphrase.'), array(), NULL, 'project:user-register').'</h2>', |
|
1266 | 1266 | '#prefix' => '<div id="register-title2">', |
1267 | 1267 | '#suffix' => '</div>', |
1268 | 1268 | ); |
@@ -1326,7 +1326,7 @@ discard block |
||
1326 | 1326 | $form['buttons']['submit']['#suffix'] = '</li>'; |
1327 | 1327 | $form['buttons']['submit']['#weight'] = 1002; |
1328 | 1328 | $form['buttons']['cancel'] = array( |
1329 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/login') . '</li>', |
|
1329 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/login').'</li>', |
|
1330 | 1330 | '#weight' => 1005, |
1331 | 1331 | ); |
1332 | 1332 | $form['buttons']['form control tabs suffix'] = array( |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | */ |
1409 | 1409 | function boincuser_token_list($type = 'all') { |
1410 | 1410 | if ($type == 'user' || $type == 'all') { |
1411 | - $tokens['user']['display-name'] = t("The user's name that should be displayed"); |
|
1411 | + $tokens['user']['display-name'] = t("The user's name that should be displayed"); |
|
1412 | 1412 | return $tokens; |
1413 | 1413 | } |
1414 | 1414 | } |
@@ -1420,9 +1420,9 @@ discard block |
||
1420 | 1420 | if ($view->args) { |
1421 | 1421 | $account_id = $view->args[0]; |
1422 | 1422 | } |
1423 | - if ($view->name=="user_activity") { |
|
1423 | + if ($view->name == "user_activity") { |
|
1424 | 1424 | // Run the following custom query for the user_activity view |
1425 | - $view->build_info['query']= " |
|
1425 | + $view->build_info['query'] = " |
|
1426 | 1426 | SELECT node_revisions.vid AS vid, |
1427 | 1427 | node.nid AS node_nid, |
1428 | 1428 | node.uid AS users_node_uid, |
@@ -1462,13 +1462,13 @@ discard block |
||
1462 | 1462 | // Delete expired users in the BOINC database, user_delete table. |
1463 | 1463 | require_boinc('boinc_db'); |
1464 | 1464 | $num_deleted = BoincUserDeleted::delete_expired(); |
1465 | - if ($num_deleted>0) { |
|
1465 | + if ($num_deleted > 0) { |
|
1466 | 1466 | watchdog('boincuser', "Deleted ${num_deleted} users from user_deleted table", WATCHDOG_NOTICE); |
1467 | 1467 | } |
1468 | 1468 | |
1469 | 1469 | // Delete expired tokens from token table |
1470 | 1470 | $tokens_deleted = BoincToken::delete_expired(); |
1471 | - if ($tokens_deleted>0) { |
|
1471 | + if ($tokens_deleted > 0) { |
|
1472 | 1472 | watchdog('boincuser', "Deleted ${tokens_deleted} tokens from token table", WATCHDOG_NOTICE); |
1473 | 1473 | } |
1474 | 1474 | } |
@@ -1553,38 +1553,38 @@ discard block |
||
1553 | 1553 | case 'boinc': |
1554 | 1554 | $output .= '<ol>'; |
1555 | 1555 | if ($registration_enabled) { |
1556 | - $output .= '<li>' . bts('First !create_an_account here at @sitename.', |
|
1556 | + $output .= '<li>'.bts('First !create_an_account here at @sitename.', |
|
1557 | 1557 | array( |
1558 | 1558 | '!create_an_account' => l(bts('create an account', array(), NULL, 'boinc:join-page'), 'user/registration'), |
1559 | 1559 | '@sitename' => $site_name, |
1560 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1560 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1561 | 1561 | } |
1562 | - $output .= ' <li>' . bts("Install BOINC on this device if not already present.", array(), NULL, 'boinc:join-page') . '</li>'; |
|
1563 | - $output .= ' <li>' . bts("Select <i>Tools / Add Project</i>. Choose @sitename from the list, or enter @siteurl.", |
|
1562 | + $output .= ' <li>'.bts("Install BOINC on this device if not already present.", array(), NULL, 'boinc:join-page').'</li>'; |
|
1563 | + $output .= ' <li>'.bts("Select <i>Tools / Add Project</i>. Choose @sitename from the list, or enter @siteurl.", |
|
1564 | 1564 | array( |
1565 | 1565 | '@sitename' => $site_name, |
1566 | 1566 | '@siteurl' => $base_url, |
1567 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1567 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1568 | 1568 | if ($registration_enabled) { |
1569 | - $output .= '<li>' . bts("If you're running a command-line or pre-5.0 version of BOINC, use <b>!boinccmd</b> to add the project.", |
|
1569 | + $output .= '<li>'.bts("If you're running a command-line or pre-5.0 version of BOINC, use <b>!boinccmd</b> to add the project.", |
|
1570 | 1570 | array( |
1571 | 1571 | '!boinccmd' => l('boinccmd --project_attach', 'http://boinc.berkeley.edu/wiki/Boinccmd_tool'), |
1572 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1572 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1573 | 1573 | } |
1574 | 1574 | else { |
1575 | - $output .= '<li>' . bts("If you're running a command-line version of BOINC, |
|
1575 | + $output .= '<li>'.bts("If you're running a command-line version of BOINC, |
|
1576 | 1576 | please follow the <b>!instructionslink</b> to first <i>create an account</i>, and then <i>attach</i> to this project. Use the same project URL as above.", |
1577 | 1577 | array( |
1578 | 1578 | '!instructionslink' => l('instructions', 'http://boinc.berkeley.edu/wiki/Boinccmd_tool'), |
1579 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1579 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1580 | 1580 | } |
1581 | - $output .= '<li>' . bts("If you're running a pre-5.0 version of BOINC, please |
|
1581 | + $output .= '<li>'.bts("If you're running a pre-5.0 version of BOINC, please |
|
1582 | 1582 | upgrade to a more recent version of BOINC to create an account |
1583 | 1583 | at @this_project.", |
1584 | 1584 | array( |
1585 | 1585 | '@this_project' => $site_name, |
1586 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1587 | - $output .= '</ol>'; |
|
1586 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1587 | + $output .= '</ol>'; |
|
1588 | 1588 | break; |
1589 | 1589 | case 'new': |
1590 | 1590 | default: |
@@ -1596,37 +1596,37 @@ discard block |
||
1596 | 1596 | // $ruleslink = drupal_lookup_path('source', $ruleslinkB); |
1597 | 1597 | //} |
1598 | 1598 | |
1599 | - $ruleslink = drupal_lookup_path('source', variable_get('boinc_weboptions_rulespolicies', '') ); |
|
1599 | + $ruleslink = drupal_lookup_path('source', variable_get('boinc_weboptions_rulespolicies', '')); |
|
1600 | 1600 | |
1601 | 1601 | // Join page output |
1602 | 1602 | $output .= '<ol>'; |
1603 | 1603 | if ($registration_enabled) { |
1604 | - $output .= '<li>' . bts('First !create_an_account here at @sitename.', |
|
1604 | + $output .= '<li>'.bts('First !create_an_account here at @sitename.', |
|
1605 | 1605 | array( |
1606 | 1606 | '!create_an_account' => l(bts('create an account', array(), NULL, 'boinc:join-page'), 'user/registration'), |
1607 | 1607 | '@sitename' => $site_name, |
1608 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1608 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1609 | 1609 | } |
1610 | - else if ( menu_valid_path(array('link_path' => $ruleslink)) ) { |
|
1611 | - $output .= ' <li>' . bts("Read our !rules_and_policies.", array( |
|
1610 | + else if (menu_valid_path(array('link_path' => $ruleslink))) { |
|
1611 | + $output .= ' <li>'.bts("Read our !rules_and_policies.", array( |
|
1612 | 1612 | '!rules_and_policies' => l(bts('Rules and Policies', array(), NULL, 'boinc:join-page'), $ruleslink), |
1613 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1613 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1614 | 1614 | } |
1615 | - $output .= ' <li>' . bts('Download the BOINC desktop software.', array(), NULL, 'boinc:join-page'); |
|
1615 | + $output .= ' <li>'.bts('Download the BOINC desktop software.', array(), NULL, 'boinc:join-page'); |
|
1616 | 1616 | $output .= ' <p>'; |
1617 | 1617 | $output .= ' <a class="button" href="http://boinc.berkeley.edu/download.php">Download</a>'; |
1618 | 1618 | $output .= ' </p>'; |
1619 | - $output .= ' ' . bts("For Android devices, visit !fdroid_link or download !apk_link directly.", array( |
|
1619 | + $output .= ' '.bts("For Android devices, visit !fdroid_link or download !apk_link directly.", array( |
|
1620 | 1620 | '!fdroid_link' => '<a href="https://f-droid.org/en/packages/edu.berkeley.boinc">F-Droid</a>', |
1621 | 1621 | '!apk_link' => '<a href="https://boinc.berkeley.edu/download_all.php">BOINC for Android</a>', |
1622 | 1622 | ), NULL, 'boinc:join-page'); |
1623 | 1623 | $output .= ' </li>'; |
1624 | - $output .= ' <li>' . bts('Run the installer.', array(), NULL, 'boinc:join-page') . '</li>'; |
|
1625 | - $output .= ' <li>' . bts('Choose @sitename from the list, or enter @siteurl.', array( |
|
1624 | + $output .= ' <li>'.bts('Run the installer.', array(), NULL, 'boinc:join-page').'</li>'; |
|
1625 | + $output .= ' <li>'.bts('Choose @sitename from the list, or enter @siteurl.', array( |
|
1626 | 1626 | '@sitename' => $site_name, |
1627 | 1627 | '@siteurl' => $base_url, |
1628 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1629 | - $output .= '</ol>'; |
|
1628 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1629 | + $output .= '</ol>'; |
|
1630 | 1630 | } |
1631 | 1631 | $output .= '</div>'; |
1632 | 1632 | return $output; |
@@ -1639,7 +1639,7 @@ discard block |
||
1639 | 1639 | global $user; |
1640 | 1640 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
1641 | 1641 | // get the front page message from database; this is set in the admin interface under BOINC Other |
1642 | - $site_message = variable_get('boinc_other_frontpage',''); |
|
1642 | + $site_message = variable_get('boinc_other_frontpage', ''); |
|
1643 | 1643 | |
1644 | 1644 | // Determine the user of the day |
1645 | 1645 | $current_uotd = db_fetch_object(db_query(" |
@@ -1661,30 +1661,30 @@ discard block |
||
1661 | 1661 | $output .= ($user->uid) ? bts('Welcome back!', array(), NULL, 'boinc:front-page') : ($site_name ? bts('What is @this_project?', array('@this_project' => $site_name)) : bts('Welcome!', array(), NULL, 'boinc:front-page')); |
1662 | 1662 | $output .= '</h2>'; |
1663 | 1663 | $output .= '<div class="boinc-overview balance-height-front">'; |
1664 | - $output .= ' <div>' . bts($site_message, array(), NULL, "project:front page") . ' ' . l(bts('Learn more', array(), NULL, 'boinc:front-page'), 'about') . '</div>'; |
|
1664 | + $output .= ' <div>'.bts($site_message, array(), NULL, "project:front page").' '.l(bts('Learn more', array(), NULL, 'boinc:front-page'), 'about').'</div>'; |
|
1665 | 1665 | if ($user->uid) { |
1666 | - $output .= ' <div>' . l(bts('View account', array(), NULL, 'boinc:front-page'), 'dashboard', array('attributes' => array('class' => 'join button'))) . '</div>'; |
|
1666 | + $output .= ' <div>'.l(bts('View account', array(), NULL, 'boinc:front-page'), 'dashboard', array('attributes' => array('class' => 'join button'))).'</div>'; |
|
1667 | 1667 | } |
1668 | 1668 | else { |
1669 | - $output .= ' <div>' . l(bts('Join now', array(), NULL, 'boinc:front-page'), 'join', array('attributes' => array('class' => 'join button'))) . '</div>'; |
|
1669 | + $output .= ' <div>'.l(bts('Join now', array(), NULL, 'boinc:front-page'), 'join', array('attributes' => array('class' => 'join button'))).'</div>'; |
|
1670 | 1670 | } |
1671 | 1671 | $output .= '</div>'; |
1672 | 1672 | $output .= '<div class="boinc-overview-details">'; |
1673 | 1673 | $output .= ' <div class="detail-container">'; |
1674 | - $output .= ' <a class="user-of-the-day" href="account/' . $uotd->uid . '">'; |
|
1674 | + $output .= ' <a class="user-of-the-day" href="account/'.$uotd->uid.'">'; |
|
1675 | 1675 | $output .= ' <div class="picture">'; |
1676 | 1676 | $output .= theme('imagefield_image', $uotd_image['image'], $uotd_image['alt'], |
1677 | 1677 | $uotd_image['alt'], array(), FALSE); |
1678 | 1678 | $output .= ' </div>'; |
1679 | - $output .= ' <div class="text">' . bts('User of the day', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1680 | - $output .= ' <div class="detail">' . $uotd->boincuser_name . '</div>'; |
|
1679 | + $output .= ' <div class="text">'.bts('User of the day', array(), NULL, 'boinc:front-page').'</div>'; |
|
1680 | + $output .= ' <div class="detail">'.$uotd->boincuser_name.'</div>'; |
|
1681 | 1681 | $output .= ' </a>'; |
1682 | 1682 | $output .= ' <div class="volunteers">'; |
1683 | - $output .= ' <div class="text">' . bts('Over 500,000 volunteers and counting.', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1683 | + $output .= ' <div class="text">'.bts('Over 500,000 volunteers and counting.', array(), NULL, 'boinc:front-page').'</div>'; |
|
1684 | 1684 | $output .= ' <div class="platforms">'; |
1685 | - $output .= ' <div class="detail platform windows">' . bts('Windows', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1686 | - $output .= ' <div class="detail platform mac">' . bts('Mac', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1687 | - $output .= ' <div class="detail platform linux">' . bts('Linux', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1685 | + $output .= ' <div class="detail platform windows">'.bts('Windows', array(), NULL, 'boinc:front-page').'</div>'; |
|
1686 | + $output .= ' <div class="detail platform mac">'.bts('Mac', array(), NULL, 'boinc:front-page').'</div>'; |
|
1687 | + $output .= ' <div class="detail platform linux">'.bts('Linux', array(), NULL, 'boinc:front-page').'</div>'; |
|
1688 | 1688 | $output .= ' </div>'; |
1689 | 1689 | $output .= ' </div>'; |
1690 | 1690 | $output .= ' </div>'; |
@@ -1715,7 +1715,7 @@ discard block |
||
1715 | 1715 | $enablethisRPC = variable_get('boinc_weboptions_enableaccountcreateRPC', TRUE); |
1716 | 1716 | if (!$enablethisRPC) { |
1717 | 1717 | $mess = bts('Account creation is done through our Web site. Please register at @url', array( |
1718 | - '@url' => $base_url . '/user/registration', |
|
1718 | + '@url' => $base_url.'/user/registration', |
|
1719 | 1719 | ), |
1720 | 1720 | NULL, 'boinc:create_account'); |
1721 | 1721 | xml_error(-208, $mess); |
@@ -1747,8 +1747,8 @@ discard block |
||
1747 | 1747 | $boinc_user = BoincUser::lookup_email_addr($params['email_addr']); |
1748 | 1748 | if ($boinc_user) { |
1749 | 1749 | // Return authenticator for existing users |
1750 | - if ( ($params['passwd_hash'] == $boinc_user->passwd_hash) or |
|
1751 | - password_verify($params['passwd_hash'], $boinc_user->passwd_hash) ) { |
|
1750 | + if (($params['passwd_hash'] == $boinc_user->passwd_hash) or |
|
1751 | + password_verify($params['passwd_hash'], $boinc_user->passwd_hash)) { |
|
1752 | 1752 | $output = array('authenticator' => $boinc_user->authenticator); |
1753 | 1753 | } |
1754 | 1754 | else { |
@@ -1804,7 +1804,7 @@ discard block |
||
1804 | 1804 | // Ensure there is a authentication token before continuing |
1805 | 1805 | if (empty($authtoken)) { |
1806 | 1806 | drupal_not_found(); |
1807 | - return ; |
|
1807 | + return; |
|
1808 | 1808 | } |
1809 | 1809 | |
1810 | 1810 | if (strlen($authtoken) != 32) { |
@@ -1826,8 +1826,8 @@ discard block |
||
1826 | 1826 | } |
1827 | 1827 | |
1828 | 1828 | // Lookup path to custom account finish page |
1829 | - $customaccountfinishpath = drupal_lookup_path('source', variable_get('boinc_weboptions_accountfinish', '') ); |
|
1830 | - if ( menu_valid_path(array('link_path' => $customaccountfinishpath)) ) { |
|
1829 | + $customaccountfinishpath = drupal_lookup_path('source', variable_get('boinc_weboptions_accountfinish', '')); |
|
1830 | + if (menu_valid_path(array('link_path' => $customaccountfinishpath))) { |
|
1831 | 1831 | $node = menu_get_object('node', 1, $customaccountfinishpath); |
1832 | 1832 | if ($node) { |
1833 | 1833 | return node_page_view($node); |
@@ -1836,12 +1836,12 @@ discard block |
||
1836 | 1836 | |
1837 | 1837 | // open links in new window |
1838 | 1838 | $options = array( |
1839 | - 'attributes' => array( 'target' => '_blank' ), |
|
1839 | + 'attributes' => array('target' => '_blank'), |
|
1840 | 1840 | ); |
1841 | 1841 | |
1842 | 1842 | // Check moderation page exists |
1843 | - $moderationpath = drupal_lookup_path('source', variable_get('boinc_weboptions_moderationpage', '') ); |
|
1844 | - if ( menu_valid_path(array('link_path' => $moderationpath)) ) { |
|
1843 | + $moderationpath = drupal_lookup_path('source', variable_get('boinc_weboptions_moderationpage', '')); |
|
1844 | + if (menu_valid_path(array('link_path' => $moderationpath))) { |
|
1845 | 1845 | $modsentence = bts('Please note: user profiles are subject to !moderation.', array('!moderation' => l(bts('moderation', array(), NULL, 'boinc:account-finish'), $moderationpath, $options)), NULL, 'boinc:account-finish'); |
1846 | 1846 | } else { |
1847 | 1847 | $modsentence = bts('Please note: user profiles are subject to moderation.', array(), NULL, 'boinc:account-finish'); |
@@ -1849,11 +1849,11 @@ discard block |
||
1849 | 1849 | |
1850 | 1850 | $username = $user->boincuser_name; |
1851 | 1851 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
1852 | - $output = "<p>" . bts('Thank you @user_name for joining @site_name. Your account has been created. Your BOINC client should start working on assigned tasks soon, without any additional action or configuration. Please visit the links below for more information and additional options. (Links will open in a new window.)', |
|
1852 | + $output = "<p>".bts('Thank you @user_name for joining @site_name. Your account has been created. Your BOINC client should start working on assigned tasks soon, without any additional action or configuration. Please visit the links below for more information and additional options. (Links will open in a new window.)', |
|
1853 | 1853 | array( |
1854 | 1854 | '@user_name' => $username, |
1855 | 1855 | '@site_name' => $site_name, |
1856 | - ), NULL, 'boinc:account-finish') . "</p>"; |
|
1856 | + ), NULL, 'boinc:account-finish')."</p>"; |
|
1857 | 1857 | |
1858 | 1858 | $links = array( |
1859 | 1859 | array( |
@@ -1919,7 +1919,7 @@ discard block |
||
1919 | 1919 | ); |
1920 | 1920 | |
1921 | 1921 | //List of links |
1922 | - $output .= theme_item_list($links, $title = NULL, $type='ul'); |
|
1922 | + $output .= theme_item_list($links, $title = NULL, $type = 'ul'); |
|
1923 | 1923 | |
1924 | 1924 | return $output; |
1925 | 1925 | } |
@@ -2036,7 +2036,7 @@ discard block |
||
2036 | 2036 | global $base_url; |
2037 | 2037 | global $base_path; |
2038 | 2038 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
2039 | - $site_url = $base_url . $base_path; |
|
2039 | + $site_url = $base_url.$base_path; |
|
2040 | 2040 | $moderator = user_load($user->uid); |
2041 | 2041 | $profile->moderate = 0; |
2042 | 2042 | $profile->status = 0; |
@@ -2097,7 +2097,7 @@ discard block |
||
2097 | 2097 | global $base_url; |
2098 | 2098 | global $base_path; |
2099 | 2099 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
2100 | - $site_url = $base_url . $base_path; |
|
2100 | + $site_url = $base_url.$base_path; |
|
2101 | 2101 | $moderator = user_load($user->uid); |
2102 | 2102 | $settings = array( |
2103 | 2103 | 'from' => '', |
@@ -2201,25 +2201,25 @@ discard block |
||
2201 | 2201 | if (!$projects) return bts('no projects...', array(), NULL, 'boinc:account-dashboard'); |
2202 | 2202 | |
2203 | 2203 | $output = ''; |
2204 | - $output .= '<table class="user-projects">' . "\n"; |
|
2205 | - $output .= '<thead>' . "\n"; |
|
2206 | - $output .= ' <tr>' . "\n"; |
|
2207 | - $output .= ' <th>' . bts('Name', array(), NULL, 'boinc:project-name:-1:ignoreoverwrite') . '</th>' . "\n"; |
|
2208 | - $output .= ' <th class="numeric">' . bts('Avg credit', array(), NULL, 'boinc:account-dashboard') . '</th>' . "\n"; |
|
2209 | - $output .= ' <th class="numeric">' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . '</th>' . "\n"; |
|
2210 | - $output .= ' </tr>' . "\n"; |
|
2211 | - $output .= '</thead>' . "\n"; |
|
2212 | - $output .= '<tbody>' . "\n"; |
|
2204 | + $output .= '<table class="user-projects">'."\n"; |
|
2205 | + $output .= '<thead>'."\n"; |
|
2206 | + $output .= ' <tr>'."\n"; |
|
2207 | + $output .= ' <th>'.bts('Name', array(), NULL, 'boinc:project-name:-1:ignoreoverwrite').'</th>'."\n"; |
|
2208 | + $output .= ' <th class="numeric">'.bts('Avg credit', array(), NULL, 'boinc:account-dashboard').'</th>'."\n"; |
|
2209 | + $output .= ' <th class="numeric">'.bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits').'</th>'."\n"; |
|
2210 | + $output .= ' </tr>'."\n"; |
|
2211 | + $output .= '</thead>'."\n"; |
|
2212 | + $output .= '<tbody>'."\n"; |
|
2213 | 2213 | foreach ($projects AS $project) { |
2214 | - $url = rtrim($project->url, '/') . '/show_user.php?userid=' . $project->id; |
|
2215 | - $output .= ' <tr>' . "\n"; |
|
2216 | - $output .= ' <td>' . l($project->name, $url) . '</td>' . "\n"; |
|
2217 | - $output .= ' <td class="numeric">' . boincwork_format_stats((float) $project->expavg_credit) . '</td>' . "\n"; |
|
2218 | - $output .= ' <td class="numeric">' . boincwork_format_stats((float) $project->total_credit) . '</td>' . "\n"; |
|
2219 | - $output .= ' </tr>' . "\n"; |
|
2214 | + $url = rtrim($project->url, '/').'/show_user.php?userid='.$project->id; |
|
2215 | + $output .= ' <tr>'."\n"; |
|
2216 | + $output .= ' <td>'.l($project->name, $url).'</td>'."\n"; |
|
2217 | + $output .= ' <td class="numeric">'.boincwork_format_stats((float)$project->expavg_credit).'</td>'."\n"; |
|
2218 | + $output .= ' <td class="numeric">'.boincwork_format_stats((float)$project->total_credit).'</td>'."\n"; |
|
2219 | + $output .= ' </tr>'."\n"; |
|
2220 | 2220 | } |
2221 | - $output .= '</tbody>' . "\n"; |
|
2222 | - $output .= '</table>' . "\n"; |
|
2221 | + $output .= '</tbody>'."\n"; |
|
2222 | + $output .= '</table>'."\n"; |
|
2223 | 2223 | $more_link = ($account) ? "user/{$account->uid}/stats" : 'account/stats'; |
2224 | 2224 | //$output .= "<div class=\"more-link\"><a href=\"{$more_link}\">More stats</a></div>" . "\n"; |
2225 | 2225 | return $output; |
@@ -2239,8 +2239,8 @@ discard block |
||
2239 | 2239 | 'cpid' => $cpid |
2240 | 2240 | ); |
2241 | 2241 | $args = array(); |
2242 | - foreach ($get as $arg => $value) $args[] = "{$arg}=" . rawurlencode($value); |
|
2243 | - $query = '?' . implode('&', $args); |
|
2242 | + foreach ($get as $arg => $value) $args[] = "{$arg}=".rawurlencode($value); |
|
2243 | + $query = '?'.implode('&', $args); |
|
2244 | 2244 | |
2245 | 2245 | // Load XML from RPC |
2246 | 2246 | $target_url = "http://{$stats_server}/{$stats_rpc}{$query}"; |
@@ -2312,12 +2312,12 @@ discard block |
||
2312 | 2312 | $output .= '<ul class="tab-list">'; |
2313 | 2313 | $count = 0; |
2314 | 2314 | foreach ($links as $key => $link) { |
2315 | - $output .= '<li class="' . (($count == 0) ? 'first primary ' : '') . 'tab">'; |
|
2315 | + $output .= '<li class="'.(($count == 0) ? 'first primary ' : '').'tab">'; |
|
2316 | 2316 | $output .= l($link['title'], $link['href'], array('query' => drupal_get_destination())); |
2317 | 2317 | $output .= '</li>'; |
2318 | 2318 | $count++; |
2319 | 2319 | } |
2320 | - $output .= '<li class="' . (($count) ? '' : 'first ') . 'last tab">' . flag_create_link('abuse_user_meta', $account->uid) . '</li>'; |
|
2320 | + $output .= '<li class="'.(($count) ? '' : 'first ').'last tab">'.flag_create_link('abuse_user_meta', $account->uid).'</li>'; |
|
2321 | 2321 | $output .= '</ul>'; |
2322 | 2322 | } |
2323 | 2323 | return $output; |
@@ -2358,7 +2358,7 @@ discard block |
||
2358 | 2358 | function boincuser_apachesolr_index_documents_alter(array &$documents, $entity, $entity_type, $env_id) { |
2359 | 2359 | |
2360 | 2360 | foreach ($documents as $document) { |
2361 | - if ( $document->entity_type=='node' AND $document->bundle=='profile' ) { |
|
2361 | + if ($document->entity_type == 'node' AND $document->bundle == 'profile') { |
|
2362 | 2362 | // Node information. |
2363 | 2363 | $nid = $document->entity_id; |
2364 | 2364 | $node = node_load($nid); |
@@ -2408,11 +2408,11 @@ discard block |
||
2408 | 2408 | // privatemsg module. We need to convert them back to spaces for the |
2409 | 2409 | // check below. |
2410 | 2410 | $boincname = preg_replace("/\\xc2\\xa0/", " ", $boincname); |
2411 | - if ($drupalid>0) { |
|
2411 | + if ($drupalid > 0) { |
|
2412 | 2412 | if ($recipient = user_load(array('uid' => $drupalid))) { |
2413 | 2413 | // Double-check that the loaded user matches both boincuser_id |
2414 | 2414 | // and boincuser_name. |
2415 | - if ( ($boincid == $recipient->boincuser_id) AND ($boincname == $recipient->boincuser_name) ) { |
|
2415 | + if (($boincid == $recipient->boincuser_id) AND ($boincname == $recipient->boincuser_name)) { |
|
2416 | 2416 | return $recipient; |
2417 | 2417 | } |
2418 | 2418 | } |
@@ -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 | ?> |
@@ -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) { |
@@ -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 | ); |
@@ -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 |