Passed
Pull Request — master (#4799)
by David
08:46
created
html/inc/user.inc 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 // they've participated in
34 34
 //
35 35
 function get_other_projects($user) {
36
-    $cpid = md5($user->cross_project_id . $user->email_addr);
36
+    $cpid = md5($user->cross_project_id.$user->email_addr);
37 37
     $url = "http://boinc.netsoft-online.com/get_user.php?cpid=".$cpid;
38 38
 
39 39
     // Check the cache for that URL
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     }
175 175
 
176 176
     if (!NO_STATS) {
177
-        $cpid = md5($user->cross_project_id . $user->email_addr);
177
+        $cpid = md5($user->cross_project_id.$user->email_addr);
178 178
         $x = "";
179 179
         shuffle($cpid_stats_sites);
180 180
         foreach ($cpid_stats_sites as $site) {
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 // if $badge_height is > 0, show badges
329 329
 // if $name_limit, limit name to N chars
330 330
 //
331
-function user_links($user, $badge_height=0, $name_limit=0) {
331
+function user_links($user, $badge_height = 0, $name_limit = 0) {
332 332
     BoincForumPrefs::lookup($user);
333 333
     if (is_banished($user)) {
334 334
         return "(banished: ID $user->id)";
@@ -343,13 +343,13 @@  discard block
 block discarded – undo
343 343
         $name = substr($name, 0, $name_limit)."...";
344 344
     }
345 345
     $x .= " <a href=\"".url_base()."show_user.php?userid=".$user->id."\">".$name."</a>";
346
-    if (function_exists("project_user_links")){
346
+    if (function_exists("project_user_links")) {
347 347
         $x .= project_user_links($user);
348 348
     }
349 349
     if ($badge_height) {
350 350
         $x .= badges_string(true, $user, $badge_height);
351 351
     }
352
-    return $name_limit?"<nobr>$x</nobr>":$x;
352
+    return $name_limit ? "<nobr>$x</nobr>" : $x;
353 353
 }
354 354
 
355 355
 function show_community_private($user) {
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 
397 397
             // if there's a foundership request, notify the founder
398 398
             //
399
-            if ($user->id==$team->userid && $team->ping_user >0) {
399
+            if ($user->id == $team->userid && $team->ping_user > 0) {
400 400
                 $x .= "<p class=\"text-danger\">".tra("(foundership change request pending)")."</p>";
401 401
             }
402 402
             row2(tra("Member of team"), $x);
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
     $x = "<a href=\"user_search.php\">".tra("Find friends")."</a><br/>\n";
422 422
     $n = count($friends);
423 423
     if ($n) {
424
-        foreach($friends as $friend) {
424
+        foreach ($friends as $friend) {
425 425
             $fuser = BoincUser::lookup_id($friend->user_dest);
426 426
             if (!$fuser) continue;
427 427
             $x .= friend_links($fuser);
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 // Returns a cacheable community links data object
465 465
 // @param user The user to produce a community links object for
466 466
 
467
-function get_community_links_object($user){
467
+function get_community_links_object($user) {
468 468
     $cache_object = new StdClass;
469 469
     $cache_object->post_count = total_posts($user);
470 470
     $cache_object->user = $user;
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
     $cache_object->friends = array();
473 473
 
474 474
     $friends = BoincFriend::enum("user_src=$user->id and reciprocated=1");
475
-    foreach($friends as $friend) {
475
+    foreach ($friends as $friend) {
476 476
         $fuser = BoincUser::lookup_id($friend->user_dest);
477 477
         if (!$fuser) continue;
478 478
         $cache_object->friends[] = $fuser;
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
     return $cache_object;
481 481
 }
482 482
 
483
-function community_links($clo, $logged_in_user){
483
+function community_links($clo, $logged_in_user) {
484 484
     $user = $clo->user;
485 485
     $team = $clo->team;
486 486
     $friends = $clo->friends;
@@ -506,15 +506,15 @@  discard block
 block discarded – undo
506 506
                 "<a href=\"friend.php?action=cancel_confirm&userid=$user->id\">".tra("Cancel friendship")."</a>"
507 507
             );
508 508
         } else if ($friend) {
509
-            row2(tra("Friends"),  "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>");
509
+            row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>");
510 510
         } else {
511
-            row2(tra("Friends"),  "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>");
511
+            row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>");
512 512
         }
513 513
     }
514 514
     
515 515
     if ($friends) {
516 516
         $x = "";
517
-        foreach($friends as $friend) {
517
+        foreach ($friends as $friend) {
518 518
             $x .= friend_links($friend);
519 519
         }
520 520
         row2(tra("Friends")." (".sizeof($friends).")", $x);
@@ -558,6 +558,6 @@  discard block
 block discarded – undo
558 558
 }
559 559
 
560 560
 
561
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
561
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
562 562
 
563 563
 ?>
Please login to merge, or discard this patch.
default/boinc/modules/boincuser/boincuser_delete/boincuser_delete.module 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 function boincuser_delete_form_alter(&$form, $form_state, $form_id) {
94 94
   global $user;
95 95
 
96
-  switch($form_id) {
96
+  switch ($form_id) {
97 97
     case 'user_profile_form':
98
-      if ( user_access('delete own account') AND ($form['#uid'] == $user->uid) AND (arg(3)=='') ) {
98
+      if (user_access('delete own account') AND ($form['#uid'] == $user->uid) AND (arg(3) == '')) {
99 99
         $form['delete'] = array(
100 100
           '#type' => 'submit',
101 101
           '#value' => bts('Delete Account', array(), null, 'boinc:delete-user-account'),
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
           '#suffix' => '</li>',
106 106
         );
107 107
       }
108
-      else if ( user_access('administer users') ) {
108
+      else if (user_access('administer users')) {
109 109
         $form['delete'] = array(
110 110
           '#type' => 'submit',
111 111
           '#value' => bts('Delete Account', array(), null, 'boinc:delete-user-account'),
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
           break;
159 159
       }
160 160
 
161
-      $question = 'Are you sure you want to delete the account <em>' . htmlspecialchars($form['_account']['#value']->boincuser_name) . '</em>?';
161
+      $question = 'Are you sure you want to delete the account <em>'.htmlspecialchars($form['_account']['#value']->boincuser_name).'</em>?';
162 162
       drupal_set_title($question);
163 163
 
164 164
       unset($form['description']);
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
       );
178 178
       $form['main']['fs1']['help'] = array(
179 179
         '#value' => bts(
180
-          "<p>In order to delete your account, you must provide your password below. You will then be sent an email to the email address on record, with a one-time token that expires in 24-hours. Clicking on this link will bring you to a second form where you must enter your password again. After doing so your account will be deleted.</p>" .
180
+          "<p>In order to delete your account, you must provide your password below. You will then be sent an email to the email address on record, with a one-time token that expires in 24-hours. Clicking on this link will bring you to a second form where you must enter your password again. After doing so your account will be deleted.</p>".
181 181
           "<p>If necessary, you may !link first before deleting your account. But you must wait <b>seven (7) days</b> after an email address change before you may delete your account.</p>",
182 182
           array(
183 183
             '!link' => l(bts('change your email address', array(), NULL, 'boinc:delete-user-account'), '/account/info/edit'),
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
       if ($dtypes == 'user_decides') {
191 191
         $form['main']['common'] = array(
192
-          '#value'  => bts('All choices: ', array(), NULL, 'boinc:delete-user-account') . $common_acts . '<p>' . bts('Disabled means some of your personal data, such as your username and email address, are kept on our systems. Choose \'delete your account\' if you want all personal data to be removed.', array(), NULL, 'boinc:delete-user-account'),
192
+          '#value'  => bts('All choices: ', array(), NULL, 'boinc:delete-user-account').$common_acts.'<p>'.bts('Disabled means some of your personal data, such as your username and email address, are kept on our systems. Choose \'delete your account\' if you want all personal data to be removed.', array(), NULL, 'boinc:delete-user-account'),
193 193
           '#prefix' => "<div id='delete-instructions'>",
194 194
           '#suffix' => "</div>",
195 195
           '#weight' => 20,
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         '#weight' => 1010,
258 258
       );
259 259
 
260
-      $form['#redirect'] = 'account/' . $uid;
260
+      $form['#redirect'] = 'account/'.$uid;
261 261
       $form['#validate'] = array('boincuser_delete_validate');
262 262
       $form['#submit'] = array('boincuser_delete_submit');
263 263
       break;
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
   global $base_path;
318 318
   module_load_include('inc', 'rules', 'modules/system.rules');
319 319
   $site_name = variable_get('site_name', 'Drupal-BOINC');
320
-  $site_url = $base_url . $base_path . "user/login";
320
+  $site_url = $base_url.$base_path."user/login";
321 321
 
322 322
   // Perform the requested operation
323 323
   $op = $form_state['values']['user_delete_action'];
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
   );
365 365
   rules_action_mail_to_user($account, $settings);
366 366
 
367
-  drupal_set_message(bts("INFO: You have requested account deletion. Please check your email for further instructions.", array(), NULL, 'boinc:delete-user-account'),'info');
367
+  drupal_set_message(bts("INFO: You have requested account deletion. Please check your email for further instructions.", array(), NULL, 'boinc:delete-user-account'), 'info');
368 368
 
369 369
   $redirect = variable_get('boincuser_delete_redirect', '<front>');
370 370
   // Redirect
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
     '#weight' => 1002,
459 459
   );
460 460
   $form['form control tabs'] = array(
461
-    '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/") . '</li>',
461
+    '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/").'</li>',
462 462
     '#weight' => 1003,
463 463
   );
464 464
   $form['form control tabs suffix'] = array(
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
     '#weight' => 1002,
549 549
   );
550 550
   $form['form control tabs'] = array(
551
-    '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/") . '</li>',
551
+    '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/").'</li>',
552 552
     '#weight' => 1003,
553 553
   );
554 554
   $form['form control tabs suffix'] = array(
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincuser/includes/boincuser.helpers.inc 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
       WHERE n.type = 'profile'
166 166
       AND n.status = 1
167 167
       AND n.moderate = 0
168
-      " . ($never_been_picked ? " AND bu.uotd_time = 0 " : '') . "
169
-      " . ($active_users ? " AND bu.boinc_id IN ({$active_users}) " : '') . "
168
+      " . ($never_been_picked ? " AND bu.uotd_time = 0 " : '')."
169
+      " . ($active_users ? " AND bu.boinc_id IN ({$active_users}) " : '')."
170 170
       ORDER BY RAND()
171 171
       LIMIT 1"
172 172
     ));
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
  * this function is called, it may be called with optional parameters
213 213
  * new and prev email.
214 214
  */
215
-function _boincuser_send_emailchange($account, $new_email=NULL, $prev_email=NULL, $adminuser=FALSE) {
215
+function _boincuser_send_emailchange($account, $new_email = NULL, $prev_email = NULL, $adminuser = FALSE) {
216 216
   require_boinc('token');
217 217
   module_load_include('inc', 'rules', 'modules/system.rules');
218 218
 
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
     // Name is limited to 60 characters, but we want to leave space to add a
304 304
     // tally if needed (for users with duplicate names); Limit to 56 chars and
305 305
     // replace the middle of the string with "..." if too long
306
-    $cleaned_name = substr_replace($cleaned_name, '...', 28, ($name_length-56)+3);
306
+    $cleaned_name = substr_replace($cleaned_name, '...', 28, ($name_length - 56) + 3);
307 307
   }
308 308
 
309 309
   // Determine if there are duplicate names, if so append a number to end.
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
     // delimiters. Curly brace is not really allowed un URLs, but a
374 374
     // more robust function would first check for these curly braces
375 375
     // in the path_to_ignore patterms, just in case.
376
-    if (preg_match('{' . $pi . '}', $path)) {
376
+    if (preg_match('{'.$pi.'}', $path)) {
377 377
       return TRUE;
378 378
     }
379 379
   }
@@ -499,15 +499,15 @@  discard block
 block discarded – undo
499 499
   elseif (!in_array($_GET['q'], $page_blacklist)) {
500 500
     watchdog('boincuser', 'The BOINC scheduling server settings are not yet
501 501
         configured. Please !verify for the settings to become effective.',
502
-          array('!verify' => l(t('verify the default values') . ' <strong>' . 
503
-            t('and') . '</strong> ' . t('save the configuration'),
502
+          array('!verify' => l(t('verify the default values').' <strong>'. 
503
+            t('and').'</strong> '.t('save the configuration'),
504 504
             'admin/boinc/scheduler', array('html' => TRUE))
505 505
           ), WATCHDOG_WARNING);
506 506
     if (user_access('administer site configuration')) {
507 507
       drupal_set_message(t('The BOINC scheduling server settings are not yet
508 508
           configured. Please !verify for the settings to become effective',
509
-            array('!verify' => l(t('verify the default values') . ' <strong>' . 
510
-              t('and') . '</strong> ' . t('save the configuration'),
509
+            array('!verify' => l(t('verify the default values').' <strong>'. 
510
+              t('and').'</strong> '.t('save the configuration'),
511 511
               'admin/boinc/scheduler', array('html' => TRUE))
512 512
             )), 'warning', FALSE);
513 513
     }
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
  */
570 570
 function _boincuser_node_profile_delete_submit($form, &$form_state) {
571 571
   $node = $form['#node'];
572
-  $deleteurl = 'node/'. $node->nid .'/delete';
572
+  $deleteurl = 'node/'.$node->nid.'/delete';
573 573
   $afterq = 'destination=account';
574 574
   drupal_goto($deleteurl, $afterq);
575 575
 }
@@ -599,8 +599,8 @@  discard block
 block discarded – undo
599 599
   $view = views_get_current_view();
600 600
   $account_id = $view->args[0];
601 601
   $friend_count = flag_friend_get_friend_count($account_id);
602
-  return '<h2 class="pane-title">' . bts('Friends (@count)', 
603
-    array('@count' => $friend_count)) . '</h2>';
602
+  return '<h2 class="pane-title">'.bts('Friends (@count)', 
603
+    array('@count' => $friend_count)).'</h2>';
604 604
 }
605 605
 
606 606
 /**
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
   $result = db_query_range("SELECT id,name FROM {user} WHERE name LIKE '%s%'", $string, 0, 10);
614 614
   db_set_active('default');
615 615
   while ($user = db_fetch_object($result)) {
616
-      $matches[$user->name . '_' . $user->id] = htmlentities($user->name) . " (" . $user->id . ')';
616
+      $matches[$user->name.'_'.$user->id] = htmlentities($user->name)." (".$user->id.')';
617 617
   }
618 618
 
619 619
   drupal_json((object)$matches);
Please login to merge, or discard this patch.
html/inc/account.inc 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             tra("Must be at least %1 characters", $min_passwd_length),
101 101
             tra("Password")
102 102
         ),
103
-        "passwd", "", "password",'id="passwd"',passwd_visible_checkbox("passwd")
103
+        "passwd", "", "password", 'id="passwd"', passwd_visible_checkbox("passwd")
104 104
     );
105 105
     if (USER_COUNTRY) {
106 106
         form_select(
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
     } else {
146 146
         $x = tra("Email address:");
147 147
     }
148
-    form_input_text($x, "email_addr", '', 'text', $attrs='autofocus tabindex="1"');
148
+    form_input_text($x, "email_addr", '', 'text', $attrs = 'autofocus tabindex="1"');
149 149
     form_input_text(
150
-        tra("Password:").'<br><small><a href="get_passwd.php">' . tra("forgot password?") . "</a></small>",
150
+        tra("Password:").'<br><small><a href="get_passwd.php">'.tra("forgot password?")."</a></small>",
151 151
         "passwd",
152 152
         "",
153 153
         "password",
Please login to merge, or discard this patch.
html/user/get_project_config.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 //
31 31
 function show_platforms() {
32 32
     $xmlFragment = unserialize(get_cached_data(3600, "project_config_platform_xml"));
33
-    if ($xmlFragment==false){
33
+    if ($xmlFragment == false) {
34 34
         $platforms = BoincDB::get()->enum_fields("platform, DBNAME.app_version, DBNAME.app", "BoincPlatform", "platform.name, platform.user_friendly_name, plan_class", "app_version.platformid = platform.id and app_version.appid = app.id and app_version.deprecated=0 and app.deprecated=0 group by platform.name, plan_class", "");
35 35
         $xmlFragment = "    <platforms>";
36
-        foreach ($platforms as $platform){
36
+        foreach ($platforms as $platform) {
37 37
             $xmlFragment .= "
38 38
             <platform>
39 39
                 <platform_name>$platform->name</platform_name>
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 if (defined('TERMSOFUSE_FILE')) {
116 116
   $tou_file = TERMSOFUSE_FILE;
117 117
 } else {
118
-  $tou_file =  "../../terms_of_use.txt";
118
+  $tou_file = "../../terms_of_use.txt";
119 119
 }
120 120
 if (file_exists($tou_file)) {
121 121
     $terms_of_use = trim(file_get_contents($tou_file));
Please login to merge, or discard this patch.
html/ops/mass_email_script.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 $globals->batch = 1000;
56 56
 $globals->lapsed_interval = 60*86400;
57 57
 
58
-for ($i=1; $i<$argc; $i++) {
58
+for ($i = 1; $i < $argc; $i++) {
59 59
     if ($argv[$i] == "--batch") {
60 60
         $i++;
61 61
         $globals->batch = $argv[$i];
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         gmdate('d F Y', $user->create_time),
170 170
         number_format($user->total_credit, 0),
171 171
         opt_out_url($user),
172
-        floor((time() - $user->last_rpc_time) / 86400),
172
+        floor((time() - $user->last_rpc_time)/86400),
173 173
     );
174 174
     return preg_replace($pat, $rep, $template);
175 175
 }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
     while ($user = _mysql_fetch_object($result)) {
239 239
         handle_user($user);
240 240
         $startid = $user->id;
241
-        fputs($log, $user->id . "\n");
241
+        fputs($log, $user->id."\n");
242 242
         fflush($log);
243 243
     }
244 244
     _mysql_free_result($result);
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
     $user = _mysql_fetch_object($result);
253 253
     if ($user) {
254 254
         handle_user($user);
255
-        fputs($log, $user->id . "\n");
255
+        fputs($log, $user->id."\n");
256 256
         fflush($log);
257 257
     }
258 258
     _mysql_free_result($result);
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     } else {
290 290
         $fid = fopen($id_file, 'r');
291 291
         if (!$fid) {
292
-            echo  $id_file . ' not found - create ID list and run again\n';
292
+            echo  $id_file.' not found - create ID list and run again\n';
293 293
             exit();
294 294
         }
295 295
         $thisid = 0;
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
         }
301 301
         fclose($fid);
302 302
     }
303
-    echo 'All done!' . "\n";
303
+    echo 'All done!'."\n";
304 304
 }
305 305
 
306 306
 if (!function_exists('make_php_mailer')) {
Please login to merge, or discard this patch.
html/inc/translation.inc 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
     $dh = opendir($langdir.$transdir);
65 65
     if (!$dh) die("can't open translation dir");
66 66
     while (($file = readdir($dh)) !== false) {
67
-        if ($file==".." || $file==".") {
67
+        if ($file == ".." || $file == ".") {
68 68
             continue;
69 69
         }
70 70
         // only do files ending in .po
71
-        if (substr($file,-3) != ".po"){
71
+        if (substr($file, -3) != ".po") {
72 72
             //debug("File $file with unknown extension found in $info_dir");
73 73
             continue;
74 74
         }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             "-------------Compiling $transdir$file------------", 0
77 77
         );
78 78
         $language = parse_po_file($langdir.$transdir.$file);
79
-        if (!$language){
79
+        if (!$language) {
80 80
             language_log(
81 81
                 "WARNING: Could not parse language ".$file
82 82
             );
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
             );
96 96
             exit;
97 97
         }
98
-        foreach ($language as $key => $value){
98
+        foreach ($language as $key => $value) {
99 99
             if ($value !== "") {
100 100
                 // Skip if the msgstr is empty
101
-                fwrite($fh, "\$language_lookup_array[\"".str_replace("\"", "\\\"", substr($file,0,-3))."\"][\"".$key."\"] = \"".$value."\";\n");
101
+                fwrite($fh, "\$language_lookup_array[\"".str_replace("\"", "\\\"", substr($file, 0, -3))."\"][\"".$key."\"] = \"".$value."\";\n");
102 102
             }
103 103
         }
104 104
         // don't write \?\> - may append
@@ -115,27 +115,27 @@  discard block
 block discarded – undo
115 115
 function parse_po_file($file) {
116 116
     $translation_file = file($file);
117 117
     $first_entry = true;
118
-    $current_token_text="";
119
-    $current_token ="";
118
+    $current_token_text = "";
119
+    $current_token = "";
120 120
     $parsing_token = false;
121 121
     $parsing_text = false;
122 122
     $size = sizeof($translation_file);
123 123
     $output = array();
124
-    for ($i=0; $i<$size; $i++){
124
+    for ($i = 0; $i < $size; $i++) {
125 125
         $entry = trim($translation_file[$i]);
126 126
         //echo "line $i: $entry\n";
127
-        if (substr($entry, 0, 1)=="#") {
127
+        if (substr($entry, 0, 1) == "#") {
128 128
             continue;
129 129
         } elseif (strpos($entry, "msgid") !== false) {
130
-            if (!$first_entry){
130
+            if (!$first_entry) {
131 131
                 //If this is not the first, save the previous entry
132
-                $output[$current_token]=$current_token_text;
132
+                $output[$current_token] = $current_token_text;
133 133
             }
134 134
             $current_token = get_po_line($entry, $file);
135
-            $current_token_text="";
135
+            $current_token_text = "";
136 136
             $parsing_token = true;
137 137
             $parsing_text = false;
138
-            $first_entry=false;
138
+            $first_entry = false;
139 139
         } elseif (strpos($entry, "msgstr") !== false) {
140 140
             $current_token_text = get_po_line($entry, $file);
141 141
             $parsing_token = false;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     
150 150
     // Get the last token
151 151
     //
152
-    if ($current_token && $current_token_text){
152
+    if ($current_token && $current_token_text) {
153 153
         $output[$current_token] = $current_token_text;
154 154
     }
155 155
     return $output;
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
 // Returns the contents of a line (ie removes "" from start and end)
160 160
 //
161 161
 function get_po_line($line, $file) {
162
-    $start = strpos($line, '"')+1;
162
+    $start = strpos($line, '"') + 1;
163 163
     $stop = strrpos($line, '"');
164
-    $x = substr($line, $start, $stop-$start);
164
+    $x = substr($line, $start, $stop - $start);
165 165
     $n = preg_match("/[^\\\\]\"/", $x);
166 166
     if ($n) {
167 167
         echo "ERROR - MISMATCHED QUOTES IN $file: $line\n";
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
     
181 181
     // Find the string in the user's language
182 182
     //
183
-    foreach ($languages_in_use as $language){
183
+    foreach ($languages_in_use as $language) {
184 184
         if (isset($language_lookup_array[$language][$text])) {
185 185
             $text = $language_lookup_array[$language][$text];
186 186
             break;
187
-        } else if ($language=="en"){ 
187
+        } else if ($language == "en") { 
188 188
             // This language is defined in the code and is always available
189 189
             break;
190 190
         }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     // Replace relevant substrings with given arguments.
194 194
     // Use strtr to avoid problems if an argument contains %n.
195 195
     $replacements = array();
196
-    for ($i=1; $i<func_num_args(); $i++){
196
+    for ($i = 1; $i < func_num_args(); $i++) {
197 197
         $replacements["%".$i] = func_get_arg($i);
198 198
     }
199 199
 
@@ -210,14 +210,14 @@  discard block
 block discarded – undo
210 210
     return $text;
211 211
 }
212 212
 
213
-function language_log($message, $loglevel=0) {
213
+function language_log($message, $loglevel = 0) {
214 214
     global $lang_log_level;
215 215
     $msg = "";
216
-    if ($loglevel==0) $msg = "[ Debug    ]";
217
-    if ($loglevel==1) $msg = "[ Warning  ]";
218
-    if ($loglevel==2) $msg = "[ CRITICAL ]";
216
+    if ($loglevel == 0) $msg = "[ Debug    ]";
217
+    if ($loglevel == 1) $msg = "[ Warning  ]";
218
+    if ($loglevel == 2) $msg = "[ CRITICAL ]";
219 219
 
220
-    if ($loglevel >= $lang_log_level){
220
+    if ($loglevel >= $lang_log_level) {
221 221
         echo gmdate("Y-m-d H:i:s", time())." ".$msg." ".$message."\n";
222 222
     }
223 223
 }
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 // (by looking at cookies and browser settings)
227 227
 // cookies have highest priority.
228 228
 
229
-if (isset($_COOKIE['lang'])){
229
+if (isset($_COOKIE['lang'])) {
230 230
     $language_string = $_COOKIE['lang'].",";
231 231
 } else {
232 232
     $language_string = '';
@@ -257,10 +257,10 @@  discard block
 block discarded – undo
257 257
 // Loop over languages that the client requests
258 258
 //
259 259
 $size = sizeof($client_languages);
260
-for ($i=0; $i<$size; $i++) {
261
-    if ((strlen($client_languages[$i])>2)
260
+for ($i = 0; $i < $size; $i++) {
261
+    if ((strlen($client_languages[$i]) > 2)
262 262
         && (substr($client_languages[$i], 2, 1) == "_" || substr($client_languages[$i], 2, 1) == "-")
263
-    ){
263
+    ) {
264 264
         // If this is defined as primary-secondary, represent it as xx_YY
265 265
         //
266 266
         $language = substr(
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 
280 280
     // if main language is english, look no further
281 281
     //
282
-    if ((count($languages_in_use)==0) && ($language == 'en' || $language2 == 'en')) {
282
+    if ((count($languages_in_use) == 0) && ($language == 'en' || $language2 == 'en')) {
283 283
         break;
284 284
     }
285 285
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     //
288 288
     $file_name = $lang_language_dir.$lang_compiled_dir.$language.".po.inc";
289 289
     if (file_exists($file_name)) {
290
-        if (!in_array($language, $languages_in_use)){
290
+        if (!in_array($language, $languages_in_use)) {
291 291
             require_once($file_name);
292 292
             $languages_in_use[] = $language;
293 293
         }
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
     if ($language2) {
296 296
         $file_name = $lang_language_dir.$lang_compiled_dir.$language2.".po.inc";
297 297
         if (file_exists($file_name)) {
298
-            if (!in_array($language2, $languages_in_use)){
298
+            if (!in_array($language2, $languages_in_use)) {
299 299
                 require_once($file_name);
300 300
                 $languages_in_use[] = $language2;
301 301
             }
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
     }
304 304
 }
305 305
 
306
-$GLOBALS['languages_in_use'] = $languages_in_use;   // for Drupal
306
+$GLOBALS['languages_in_use'] = $languages_in_use; // for Drupal
307 307
 
308
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
308
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
309 309
 ?>
Please login to merge, or discard this patch.
html/user/cert_all.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 
30 30
 $border = get_str("border", true);
31 31
 
32
-if ($border=="no") {
32
+if ($border == "no") {
33 33
     $border = 0;
34 34
 } else {
35
-    $border=8;
35
+    $border = 8;
36 36
 }
37 37
 
38 38
 $font = "\"Optima,Lucida Bright,Times New Roman\"";
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     <tr><th align=left>Project</th><th align=left>Cobblestones</th><th align=left>Joined</th></tr>
76 76
 ";
77 77
 foreach ($user->projects as $p) {
78
-    if ($p->total_credit<100) continue;
78
+    if ($p->total_credit < 100) continue;
79 79
     show_proj($p);
80 80
 }
81 81
 echo "
Please login to merge, or discard this patch.
drupal/sites/default/settings.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
  */
115 115
 require_once('dbconfig.php');
116 116
 if (!isset($dbserver) || empty($dbserver))
117
-  $dbserver='localhost';
117
+  $dbserver = 'localhost';
118 118
 $db_url = array(
119 119
   'default' => "{$dbtype}://{$dbuser}:".urlencode($dbpass)."@{$dbserver}/{$dbname}",
120 120
   'boinc_rw' => "{$boinc_rw_dbtype}://{$boinc_rw_dbuser}:".urlencode($boinc_rw_dbpass)."@{$boinc_rw_dbserver}/{$boinc_rw_dbname}"
@@ -162,14 +162,14 @@  discard block
 block discarded – undo
162 162
  * settings are used there. Settings defined here should not be
163 163
  * duplicated there so as to avoid conflict issues.
164 164
  */
165
-ini_set('session.cache_expire',     200000);
166
-ini_set('session.cache_limiter',    'none');
167
-ini_set('session.cookie_lifetime',  2000000);
168
-ini_set('session.gc_maxlifetime',   200000);
169
-ini_set('session.save_handler',     'user');
165
+ini_set('session.cache_expire', 200000);
166
+ini_set('session.cache_limiter', 'none');
167
+ini_set('session.cookie_lifetime', 2000000);
168
+ini_set('session.gc_maxlifetime', 200000);
169
+ini_set('session.save_handler', 'user');
170 170
 ini_set('session.use_only_cookies', 1);
171
-ini_set('session.use_trans_sid',    0);
172
-ini_set('url_rewriter.tags',        '');
171
+ini_set('session.use_trans_sid', 0);
172
+ini_set('url_rewriter.tags', '');
173 173
 ini_set('memory_limit', '128M');
174 174
 ini_set('post_max_size', '8MB');
175 175
 ini_set('upload_max_filesize', '8MB');
Please login to merge, or discard this patch.