Passed
Pull Request — master (#5620)
by David
10:01
created
html/inc/user_util.inc 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@
 block discarded – undo
242 242
             $users = BoincUser::enum(
243 243
                 sprintf("name like '%s%%'", $new_name)
244 244
             );
245
-            foreach ($users as $u){
245
+            foreach ($users as $u) {
246 246
                 echo "<p>$u->name\n";
247 247
             }
248 248
             page_tail();
Please login to merge, or discard this patch.
html/user/edit_forum_preferences_action.php 1 patch
Braces   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 
72 72
 // Update the user avatar
73 73
 if ($avatar_type<0 or $avatar_type>3) $avatar_type=0;
74
-if ($avatar_type==0){
75
-    if (file_exists($newfile)){
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
         //
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     $avatar_url="";
82 82
 } elseif ($avatar_type == 1) {
83 83
     $avatar_url = "//www.gravatar.com/avatar/".md5($user->email_addr)."?s=100&amp;d=identicon";
84
-} elseif ($avatar_type==2){
84
+} elseif ($avatar_type==2) {
85 85
     if (($rpc && (post_str("avatar_url", true) != null)) || ($_FILES['picture']['tmp_name']!="")) {
86 86
         if ($_FILES['picture']['tmp_name']!="") {
87 87
             $file = $_FILES['picture']['tmp_name'];
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
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,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $image2 = intelligently_scale_image($file, 100, 100);
100 100
         ImageJPEG($image2, $newfile);
101 101
     }
102
-    if (file_exists($newfile)){
102
+    if (file_exists($newfile)) {
103 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
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
 } else {
143 143
     // todo: clean up the following
144 144
     $add_user_to_filter = (isset($_POST["add_user_to_filter"]) && $_POST["add_user_to_filter"]!="");
145
-    if ($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
 block discarded – undo
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];
Please login to merge, or discard this patch.
html/user/edit_forum_preferences_form.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,8 +53,9 @@  discard block
 block discarded – undo
53 53
 // ------------ Forum identity -----------
54 54
 
55 55
 $select_0 = $select_1 = $select_2 = "";
56
-if (strlen($user->prefs->avatar)){
57
-    if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { // Gravatar
56
+if (strlen($user->prefs->avatar)) {
57
+    if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") {
58
+// Gravatar
58 59
         $select_1 = "checked=\"true\"";
59 60
     } else {
60 61
         $select_2 = "checked=\"true\"";
@@ -73,7 +74,7 @@  discard block
 block discarded – undo
73 74
     <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2.">
74 75
         <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">"
75 76
 );
76
-if (strlen($user->prefs->avatar)){
77
+if (strlen($user->prefs->avatar)) {
77 78
     row2(tra("Avatar preview")."<br><p class=\"text-muted\">".tra("This is how your avatar will look")."</p>",
78 79
     "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">");
79 80
 }
@@ -92,7 +93,7 @@  discard block
 block discarded – undo
92 93
     textarea_with_counter("signature", 250, $signature)
93 94
     ."<br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> ".tra("Attach signature by default")
94 95
 );
95
-if ($user->prefs->signature!=""){
96
+if ($user->prefs->signature!="") {
96 97
     row2(tra("Signature preview").
97 98
         "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>",
98 99
         output_transform($user->prefs->signature)
@@ -140,7 +141,7 @@  discard block
 block discarded – undo
140 141
 //
141 142
 $filtered_userlist = get_ignored_list($user);
142 143
 $forum_filtered_userlist = "";
143
-for ($i=0; $i<sizeof($filtered_userlist); $i++){
144
+for ($i=0; $i<sizeof($filtered_userlist); $i++) {
144 145
     $id = (int)$filtered_userlist[$i];
145 146
     if ($id) {
146 147
         $filtered_user = BoincUser::lookup_id($id);
Please login to merge, or discard this patch.
html/inc/user.inc 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
         $user->id,
382 382
         $name
383 383
     );
384
-    if (function_exists("project_user_links")){
384
+    if (function_exists("project_user_links")) {
385 385
         $x .= project_user_links($user);
386 386
     }
387 387
     if ($badge_height) {
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 // Returns a cacheable community links data object
507 507
 // @param user The user to produce a community links object for
508 508
 
509
-function get_community_links_object($user){
509
+function get_community_links_object($user) {
510 510
     $cache_object = new StdClass;
511 511
     $cache_object->post_count = total_posts($user);
512 512
     $cache_object->user = $user;
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
     return $cache_object;
523 523
 }
524 524
 
525
-function community_links($clo, $logged_in_user){
525
+function community_links($clo, $logged_in_user) {
526 526
     $user = $clo->user;
527 527
     $team = $clo->team;
528 528
     $friends = $clo->friends;
Please login to merge, or discard this patch.