Passed
Push — brevilo-fix-hosttasks ( 73cb92 )
by
unknown
11:57
created
drupal/sites/default/boinc/modules/boincimport/includes/import_users.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -12,26 +12,26 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 
15
-  require_once('./includes/bootstrap.inc');
16
-  drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
17
-  require_boinc('db');
15
+    require_once('./includes/bootstrap.inc');
16
+    drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
17
+    require_boinc('db');
18 18
   
19
-  // Parse arguments
20
-  $import_lurkers = isset($argv[1]) ? $argv[1] : false;
21
-  $record_offset = isset($argv[2]) ? $argv[2] : 0;
22
-  $chunk_size = isset($argv[3]) ? $argv[3] : 100;
19
+    // Parse arguments
20
+    $import_lurkers = isset($argv[1]) ? $argv[1] : false;
21
+    $record_offset = isset($argv[2]) ? $argv[2] : 0;
22
+    $chunk_size = isset($argv[3]) ? $argv[3] : 100;
23 23
   
24
-  // Construct sql conditions
25
-  $limit = sprintf('LIMIT %d,%d', $record_offset, $chunk_size);
24
+    // Construct sql conditions
25
+    $limit = sprintf('LIMIT %d,%d', $record_offset, $chunk_size);
26 26
   
27
-  $count = 0;
27
+    $count = 0;
28 28
   
29
-  db_set_active('boinc_rw');
30
-  if ($import_lurkers) {
29
+    db_set_active('boinc_rw');
30
+    if ($import_lurkers) {
31 31
     $boinc_accounts = db_query('SELECT id FROM user ORDER BY id %s', $limit);
32
-  }
33
-  //else $boinc_accounts = db_query('SELECT DISTINCT user AS boinc_id FROM post ORDER BY boinc_id %s', $limit);
34
-  else {
32
+    }
33
+    //else $boinc_accounts = db_query('SELECT DISTINCT user AS boinc_id FROM post ORDER BY boinc_id %s', $limit);
34
+    else {
35 35
     // Need to import any user who is currently ignored in order to keep them
36 36
     // ignored... not particularly clean (ignored users are stored in a string)
37 37
     $ignored_user_list = array();
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
       ORDER BY userid ASC"
43 43
     );
44 44
     while ($ignoring_user = db_fetch_object($ignoring_users)) {
45
-      $ignored_user_list = $ignored_user_list + array_fill_keys(explode('|', trim($ignoring_user->ignorelist, '|')), 1);
45
+        $ignored_user_list = $ignored_user_list + array_fill_keys(explode('|', trim($ignoring_user->ignorelist, '|')), 1);
46 46
     }
47 47
     $ignored_user_list = array_keys($ignored_user_list);
48 48
     $boinc_accounts = db_query("
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
         (SELECT DISTINCT senderid FROM {private_messages})
59 59
       ) AS usersToImport ORDER BY id ASC %s", implode(',', $ignored_user_list), $limit
60 60
     );
61
-  }
62
-  db_set_active('default');
61
+    }
62
+    db_set_active('default');
63 63
   
64
-  while ($boinc_account = db_fetch_object($boinc_accounts)) {
64
+    while ($boinc_account = db_fetch_object($boinc_accounts)) {
65 65
     // Grab the BOINC user object and create a Drupal user from it
66 66
     if (boincuser_register_make_drupal_user($boinc_account->id)) {
67
-      $count++;
67
+        $count++;
68
+    }
68 69
     }
69
-  }
70 70
   
71
-  echo $count;
71
+    echo $count;
Please login to merge, or discard this patch.
drupal/sites/default/settings.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -114,10 +114,10 @@  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
-  'default' => "{$dbtype}://{$dbuser}:".urlencode($dbpass)."@{$dbserver}/{$dbname}",
120
-  'boinc_rw' => "{$boinc_rw_dbtype}://{$boinc_rw_dbuser}:".urlencode($boinc_rw_dbpass)."@{$boinc_rw_dbserver}/{$boinc_rw_dbname}"
119
+    'default' => "{$dbtype}://{$dbuser}:".urlencode($dbpass)."@{$dbserver}/{$dbname}",
120
+    'boinc_rw' => "{$boinc_rw_dbtype}://{$boinc_rw_dbuser}:".urlencode($boinc_rw_dbpass)."@{$boinc_rw_dbserver}/{$boinc_rw_dbname}"
121 121
 );
122 122
 $db_prefix = '';
123 123
 
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
 // 'boinc_rw' entry as 'boinc_ro'.
126 126
 
127 127
 if (isset($boinc_ro_dbtype) && isset($boinc_ro_dbuser) && isset($boinc_ro_dbpass) && isset($boinc_ro_dbserver) && isset($boinc_ro_dbname)) {
128
-  $db_url['boinc_ro'] = "{$boinc_ro_dbtype}://{$boinc_ro_dbuser}:".urlencode($boinc_ro_dbpass)."@{$boinc_ro_dbserver}/{$boinc_ro_dbname}";
128
+    $db_url['boinc_ro'] = "{$boinc_ro_dbtype}://{$boinc_ro_dbuser}:".urlencode($boinc_ro_dbpass)."@{$boinc_ro_dbserver}/{$boinc_ro_dbname}";
129 129
 }
130 130
 else {
131
-  $db_url['boinc_ro'] = $db_url['boinc_rw'];
131
+    $db_url['boinc_ro'] = $db_url['boinc_rw'];
132 132
 }
133 133
 
134 134
 /**
@@ -216,5 +216,5 @@  discard block
 block discarded – undo
216 216
  */
217 217
 
218 218
 if (stream_resolve_include_path('settings.local.php')) {
219
-  include 'settings.local.php';
219
+    include 'settings.local.php';
220 220
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,8 +126,7 @@
 block discarded – undo
126 126
 
127 127
 if (isset($boinc_ro_dbtype) && isset($boinc_ro_dbuser) && isset($boinc_ro_dbpass) && isset($boinc_ro_dbserver) && isset($boinc_ro_dbname)) {
128 128
   $db_url['boinc_ro'] = "{$boinc_ro_dbtype}://{$boinc_ro_dbuser}:".urlencode($boinc_ro_dbpass)."@{$boinc_ro_dbserver}/{$boinc_ro_dbname}";
129
-}
130
-else {
129
+} else {
131 130
   $db_url['boinc_ro'] = $db_url['boinc_rw'];
132 131
 }
133 132
 
Please login to merge, or discard this 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.
drupal/sites/default/boinc/modules/boincteam/boincteam.admin.inc 4 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -105,8 +105,7 @@  discard block
 block discarded – undo
105 105
       $drupalnid = boincteam_lookup_nid($result->id);
106 106
       if ($drupalnid) {
107 107
         $tlink = l($result->name, '/community/teams/' . $drupalnid);
108
-      }
109
-      else {
108
+      } else {
110 109
         $tlink = '';
111 110
       }
112 111
       // only keys no values
@@ -181,8 +180,7 @@  discard block
 block discarded – undo
181 180
         drupal_render($form['link'][$key]),
182 181
       );
183 182
     }
184
-  }
185
-  else {
183
+  } else {
186 184
     $rows[] = array(array('data' => '<div class="error">No teams found</div>', 'colspan' => 5));
187 185
   }
188 186
   $output .= theme('table', $header, $rows);
@@ -230,8 +228,7 @@  discard block
 block discarded – undo
230 228
   if ($success) {
231 229
     $message = 'Info: Delete SPAM Teams utility- ' . count($results) . ' team(s) deleted.';
232 230
     drupal_set_message($message, 'info');
233
-  }
234
-  else {
231
+  } else {
235 232
     // An error occurred.
236 233
     // $operations contains the operations that remained unprocessed.
237 234
     $error_operation = reset($operations);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
   $form['help'] = array(
23 23
     '#type' => 'fieldset',
24 24
     '#title' => t('Help'),
25
-    '#collapsible' => TRUE,
25
+    '#collapsible' => true,
26 26
   );
27 27
 
28 28
   $form['help']['text'] = array(
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     }
128 128
 
129 129
     $form['checkboxes'] = array('#type' => 'checkboxes', '#options' => $checkboxes);
130
-    $form['pager'] = array('#value' => theme('pager', NULL, $limit, 0));
130
+    $form['pager'] = array('#value' => theme('pager', null, $limit, 0));
131 131
 
132 132
     return $form;
133 133
   }
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
     // An error occurred.
236 236
     // $operations contains the operations that remained unprocessed.
237 237
     $error_operation = reset($operations);
238
-    $message = 'Error: An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
238
+    $message = 'Error: An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], true);
239 239
     drupal_set_message($message, 'error');
240 240
   }
241 241
 }
242 242
\ No newline at end of file
Please login to merge, or discard this patch.
Indentation   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -17,15 +17,15 @@  discard block
 block discarded – undo
17 17
  * Utility Form to delete teams suspected of being spammers.
18 18
  */
19 19
 function boincteam_utility_delete(&$form_state) {
20
-  $form = array();
20
+    $form = array();
21 21
 
22
-  $form['help'] = array(
22
+    $form['help'] = array(
23 23
     '#type' => 'fieldset',
24 24
     '#title' => t('Help'),
25 25
     '#collapsible' => TRUE,
26
-  );
26
+    );
27 27
 
28
-  $form['help']['text'] = array(
28
+    $form['help']['text'] = array(
29 29
     '#type' => 'item',
30 30
     '#description' => t('This utility page will help in identifying BOINC teams created by SPAMMERs which can be deleted. The search will find BOINC teams that meet the following criteria.
31 31
 <ul>
@@ -38,19 +38,19 @@  discard block
 block discarded – undo
38 38
 <p> <i>How teams are deleted</i>: Select the teams to be deleted from the table below. Click "Delete Selected Teams" button to begin a batch operation to delete the teams. If you select teams, and then page through to another page of the table, your selections will be lost. I.e., only the teams select on the current page will be deleted.
39 39
 <p> The site must be offline/in maintenance mode before searching for and deleting teams. If not, the delete button below is disabled.
40 40
 '),
41
-  );
41
+    );
42 42
 
43
-  // This variable name has been changed for Drupal 7/8.
44
-  $maintenance_mode = variable_get('site_offline');
45
-  if (!$maintenance_mode) {
43
+    // This variable name has been changed for Drupal 7/8.
44
+    $maintenance_mode = variable_get('site_offline');
45
+    if (!$maintenance_mode) {
46 46
     drupal_set_message(t('WARNING: Site is online (not in maintenance mode)! Deleting teams is only allowed when site is offline. Change this setting in ') . l(t('Site maintenance'), '/admin/settings/site-maintenance'), 'warning');
47
-  }
47
+    }
48 48
 
49
-  $form['teamdelete'] = array(
49
+    $form['teamdelete'] = array(
50 50
     '#type' => 'fieldset',
51 51
     '#title' => t('Teams to delete'),
52
-  );
53
-  $form['teamdelete']['deleteall'] = array(
52
+    );
53
+    $form['teamdelete']['deleteall'] = array(
54 54
     '#type' => 'submit',
55 55
     '#disabled' => !($maintenance_mode),
56 56
     '#value' => t('Delete Selected Teams'),
@@ -58,101 +58,101 @@  discard block
 block discarded – undo
58 58
     '#attributes' => array(
59 59
         'onclick' => 'return confirm(\'' . t('You are about to delete the selected teams suspected of being SPAM. Do you want to continue?') . '\')',
60 60
     ),
61
-  );
62
-  $form['teamdelete']['results_table'] = array(
61
+    );
62
+    $form['teamdelete']['results_table'] = array(
63 63
     '#value' => drupal_get_form('boincteam_utility_team_table'),
64
-  );
64
+    );
65 65
 
66
-  return $form;
66
+    return $form;
67 67
 }
68 68
 
69 69
 function boincteam_utility_team_table() {
70 70
 
71
-  $limit=50;
72
-  $sql = "SELECT team.id AS id, team.name AS name, team.nusers AS nusers FROM {team} WHERE team.nusers<2 AND team.total_credit=0 AND team.seti_id=0 AND team.description REGEXP '<a href'";
71
+    $limit=50;
72
+    $sql = "SELECT team.id AS id, team.name AS name, team.nusers AS nusers FROM {team} WHERE team.nusers<2 AND team.total_credit=0 AND team.seti_id=0 AND team.description REGEXP '<a href'";
73 73
 
74
-  // @todo - add bts() or t()
75
-  $resultheader = array(
74
+    // @todo - add bts() or t()
75
+    $resultheader = array(
76 76
     array(
77
-      'data' => 'Team ID',
78
-      'field' => 'id',
79
-      'sort' => 'asc',
77
+        'data' => 'Team ID',
78
+        'field' => 'id',
79
+        'sort' => 'asc',
80 80
     ),
81 81
     array(
82
-      'data' => 'Team Name',
83
-      'field' => 'name',
82
+        'data' => 'Team Name',
83
+        'field' => 'name',
84 84
     ),
85 85
     array(
86
-      'data' => 'Num Users',
87
-      'field' => 'nusers',
86
+        'data' => 'Num Users',
87
+        'field' => 'nusers',
88 88
     ),
89 89
     array(
90
-      'data' => 'Link to Team',
91
-      'field' => 'link',
90
+        'data' => 'Link to Team',
91
+        'field' => 'link',
92 92
     ),
93
-  );
93
+    );
94 94
 
95
-  $tablesort = tablesort_sql($resultheader);
96
-  db_set_active('boinc_rw');
97
-  $db_res = pager_query($sql . $tablesort, $limit);
98
-  db_set_active('default');
95
+    $tablesort = tablesort_sql($resultheader);
96
+    db_set_active('boinc_rw');
97
+    $db_res = pager_query($sql . $tablesort, $limit);
98
+    db_set_active('default');
99 99
 
100
-  $form = array();
101
-  $form['options'] = array();
102
-  $checkboxes = array();
103
-  if ($db_res) {
100
+    $form = array();
101
+    $form['options'] = array();
102
+    $checkboxes = array();
103
+    if ($db_res) {
104 104
     while ($result = db_fetch_object($db_res)) {
105
-      $drupalnid = boincteam_lookup_nid($result->id);
106
-      if ($drupalnid) {
105
+        $drupalnid = boincteam_lookup_nid($result->id);
106
+        if ($drupalnid) {
107 107
         $tlink = l($result->name, '/community/teams/' . $drupalnid);
108
-      }
109
-      else {
108
+        }
109
+        else {
110 110
         $tlink = '';
111
-      }
112
-      // only keys no values
113
-      $checkboxes[$result->id] = '';
111
+        }
112
+        // only keys no values
113
+        $checkboxes[$result->id] = '';
114 114
 
115
-      $form['id'][$result->id] = array(
115
+        $form['id'][$result->id] = array(
116 116
         '#value' => $result->id,
117
-      );
118
-      $form['name'][$result->id] = array(
117
+        );
118
+        $form['name'][$result->id] = array(
119 119
         '#value' => $result->name,
120
-      );
121
-      $form['nusers'][$result->id] = array(
120
+        );
121
+        $form['nusers'][$result->id] = array(
122 122
         '#value' => $result->nusers,
123
-      );
124
-      $form['link'][$result->id] = array(
123
+        );
124
+        $form['link'][$result->id] = array(
125 125
         '#value' => $tlink,
126
-      );
126
+        );
127 127
     }
128 128
 
129 129
     $form['checkboxes'] = array('#type' => 'checkboxes', '#options' => $checkboxes);
130 130
     $form['pager'] = array('#value' => theme('pager', NULL, $limit, 0));
131 131
 
132 132
     return $form;
133
-  }
134
-  return "<p>No teams matched the criteria for a SPAM team.</p>";
133
+    }
134
+    return "<p>No teams matched the criteria for a SPAM team.</p>";
135 135
 }
136 136
 
137 137
 /**
138 138
  * Submit handler - also creates the batch job to delete the teams.
139 139
  */
140 140
 function boincteam_utility_delete_team($form, &$form_state) {
141
-  $checkedteamids = $form_state['clicked_button']['#post']['checkboxes'];
142
-  // Use batch to delete teams
143
-  $operations = array();
144
-  foreach ($checkedteamids as $id) {
141
+    $checkedteamids = $form_state['clicked_button']['#post']['checkboxes'];
142
+    // Use batch to delete teams
143
+    $operations = array();
144
+    foreach ($checkedteamids as $id) {
145 145
     $operations[] = array('boincteam_utility_batch_process', array($id));
146
-  }
147
-  $batch = array(
146
+    }
147
+    $batch = array(
148 148
     'title' => t('Processing BOINC Teams'),
149 149
     'operations' => $operations,
150 150
     'init_message' => t('Starting team deletion'),
151 151
     'finished' => 'boincteam_utility_batch_finished',
152 152
     'file' => drupal_get_path('module', 'boincteam') . '/boincteam.admin.inc',
153
-  );
154
-  batch_set($batch);
155
-  //batch_process('/admin/boinc/utility-team-delete');
153
+    );
154
+    batch_set($batch);
155
+    //batch_process('/admin/boinc/utility-team-delete');
156 156
 }
157 157
 
158 158
 /*
@@ -163,37 +163,37 @@  discard block
 block discarded – undo
163 163
  *     Input form (table)
164 164
  */
165 165
 function theme_boincteam_utility_team_table($form) {
166
-  //define table header
167
-  $header = array(
166
+    //define table header
167
+    $header = array(
168 168
     theme('table_select_header_cell'), //using that previously empty field
169 169
     array('data' => t('Team ID'), 'field' => 'id', 'sort' => 'asc'),
170 170
     array('data' => t('Name'), 'field' => 'name'),
171 171
     array('data' => t('Num Users'), 'field' => 'nusers'),
172 172
     array('data' => t('Link to Team'), 'field' => 'link'),
173
-  );
174
-  $rows = array();
175
-  $output = "";
176
-  if(!empty($form['checkboxes']['#options'])) {
173
+    );
174
+    $rows = array();
175
+    $output = "";
176
+    if(!empty($form['checkboxes']['#options'])) {
177 177
     foreach (element_children($form['id']) as $key) {
178
-      $rows[] = array(
178
+        $rows[] = array(
179 179
         drupal_render($form['checkboxes'][$key]),
180 180
         drupal_render($form['id'][$key]),
181 181
         drupal_render($form['name'][$key]),
182 182
         drupal_render($form['nusers'][$key]),
183 183
         drupal_render($form['link'][$key]),
184
-      );
184
+        );
185
+    }
185 186
     }
186
-  }
187
-  else {
187
+    else {
188 188
     $rows[] = array(array('data' => '<div class="error">No teams found</div>', 'colspan' => 5));
189
-  }
190
-  $output .= theme('table', $header, $rows);
191
-  if ($form['pager']['#value']) {
189
+    }
190
+    $output .= theme('table', $header, $rows);
191
+    if ($form['pager']['#value']) {
192 192
     $output .= drupal_render($form['pager']);
193
-  }
193
+    }
194 194
 
195
-  $output .= drupal_render($form);
196
-  return $output;
195
+    $output .= drupal_render($form);
196
+    return $output;
197 197
 }
198 198
 
199 199
 /**
@@ -202,26 +202,26 @@  discard block
 block discarded – undo
202 202
  * table. It also removes the team's drupal page (node) if found.
203 203
  */
204 204
 function boincteam_utility_batch_process($id, &$context) {
205
-  $boincteam = boincteam_load($id);
206
-  $drupalid = boincteam_lookup_nid($id);
205
+    $boincteam = boincteam_load($id);
206
+    $drupalid = boincteam_lookup_nid($id);
207 207
 
208
-  // Delete entry in team table
209
-  db_set_active('boinc_rw');
210
-  $sql1='DELETE FROM {team} WHERE id=%d';
211
-  $db_res = db_query($sql1, $id);
212
-  db_set_active('default');
208
+    // Delete entry in team table
209
+    db_set_active('boinc_rw');
210
+    $sql1='DELETE FROM {team} WHERE id=%d';
211
+    $db_res = db_query($sql1, $id);
212
+    db_set_active('default');
213 213
 
214
-  // Delete entry in boincteam table
215
-  $sql2='DELETE FROM {boincteam} WHERE id=%d';
216
-  $db_res = db_query($sql2, $id);
214
+    // Delete entry in boincteam table
215
+    $sql2='DELETE FROM {boincteam} WHERE id=%d';
216
+    $db_res = db_query($sql2, $id);
217 217
 
218
-  // Delete the drupal node (if present)
219
-  if ($drupalid) {
218
+    // Delete the drupal node (if present)
219
+    if ($drupalid) {
220 220
     node_delete($drupalid);
221
-  }
221
+    }
222 222
 
223
-  $context['results'][] = $id . ' : ' . check_plain($boincteam->name);
224
-  $context['message'] = t('Processing team @name', array('@name' => $boincteam->name));
223
+    $context['results'][] = $id . ' : ' . check_plain($boincteam->name);
224
+    $context['message'] = t('Processing team @name', array('@name' => $boincteam->name));
225 225
 }
226 226
 
227 227
 /**
@@ -229,15 +229,15 @@  discard block
 block discarded – undo
229 229
  * or failure.
230 230
  */
231 231
 function boincteam_utility_batch_finished($success, $results, $operations) {
232
-  if ($success) {
232
+    if ($success) {
233 233
     $message = 'Info: Delete SPAM Teams utility- ' . count($results) . ' team(s) deleted.';
234 234
     drupal_set_message($message, 'info');
235
-  }
236
-  else {
235
+    }
236
+    else {
237 237
     // An error occurred.
238 238
     // $operations contains the operations that remained unprocessed.
239 239
     $error_operation = reset($operations);
240 240
     $message = 'Error: An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
241 241
     drupal_set_message($message, 'error');
242
-  }
242
+    }
243 243
 }
244 244
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
   // This variable name has been changed for Drupal 7/8.
44 44
   $maintenance_mode = variable_get('site_offline');
45 45
   if (!$maintenance_mode) {
46
-    drupal_set_message(t('WARNING: Site is online (not in maintenance mode)! Deleting teams is only allowed when site is offline. Change this setting in ') . l(t('Site maintenance'), '/admin/settings/site-maintenance'), 'warning');
46
+    drupal_set_message(t('WARNING: Site is online (not in maintenance mode)! Deleting teams is only allowed when site is offline. Change this setting in ').l(t('Site maintenance'), '/admin/settings/site-maintenance'), 'warning');
47 47
   }
48 48
 
49 49
   $form['teamdelete'] = array(
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     '#value' => t('Delete Selected Teams'),
57 57
     '#submit' => array('boincteam_utility_delete_team'),
58 58
     '#attributes' => array(
59
-        'onclick' => 'return confirm(\'' . t('You are about to delete the selected teams suspected of being SPAM. Do you want to continue?') . '\')',
59
+        'onclick' => 'return confirm(\''.t('You are about to delete the selected teams suspected of being SPAM. Do you want to continue?').'\')',
60 60
     ),
61 61
   );
62 62
   $form['teamdelete']['results_table'] = array(
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 function boincteam_utility_team_table() {
70 70
 
71
-  $limit=50;
71
+  $limit = 50;
72 72
   $sql = "SELECT team.id AS id, team.name AS name, team.nusers AS nusers FROM {team} WHERE team.nusers<2 AND team.total_credit=0 AND team.seti_id=0 AND team.description REGEXP '<a href'";
73 73
 
74 74
   // @todo - add bts() or t()
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
   $tablesort = tablesort_sql($resultheader);
96 96
   db_set_active('boinc_rw');
97
-  $db_res = pager_query($sql . $tablesort, $limit);
97
+  $db_res = pager_query($sql.$tablesort, $limit);
98 98
   db_set_active('default');
99 99
 
100 100
   $form = array();
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     while ($result = db_fetch_object($db_res)) {
105 105
       $drupalnid = boincteam_lookup_nid($result->id);
106 106
       if ($drupalnid) {
107
-        $tlink = l($result->name, '/community/teams/' . $drupalnid);
107
+        $tlink = l($result->name, '/community/teams/'.$drupalnid);
108 108
       }
109 109
       else {
110 110
         $tlink = '';
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     'operations' => $operations,
150 150
     'init_message' => t('Starting team deletion'),
151 151
     'finished' => 'boincteam_utility_batch_finished',
152
-    'file' => drupal_get_path('module', 'boincteam') . '/boincteam.admin.inc',
152
+    'file' => drupal_get_path('module', 'boincteam').'/boincteam.admin.inc',
153 153
   );
154 154
   batch_set($batch);
155 155
   //batch_process('/admin/boinc/utility-team-delete');
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
   );
174 174
   $rows = array();
175 175
   $output = "";
176
-  if(!empty($form['checkboxes']['#options'])) {
176
+  if (!empty($form['checkboxes']['#options'])) {
177 177
     foreach (element_children($form['id']) as $key) {
178 178
       $rows[] = array(
179 179
         drupal_render($form['checkboxes'][$key]),
@@ -207,12 +207,12 @@  discard block
 block discarded – undo
207 207
 
208 208
   // Delete entry in team table
209 209
   db_set_active('boinc_rw');
210
-  $sql1='DELETE FROM {team} WHERE id=%d';
210
+  $sql1 = 'DELETE FROM {team} WHERE id=%d';
211 211
   $db_res = db_query($sql1, $id);
212 212
   db_set_active('default');
213 213
 
214 214
   // Delete entry in boincteam table
215
-  $sql2='DELETE FROM {boincteam} WHERE id=%d';
215
+  $sql2 = 'DELETE FROM {boincteam} WHERE id=%d';
216 216
   $db_res = db_query($sql2, $id);
217 217
 
218 218
   // Delete the drupal node (if present)
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     node_delete($drupalid);
221 221
   }
222 222
 
223
-  $context['results'][] = $id . ' : ' . check_plain($boincteam->name);
223
+  $context['results'][] = $id.' : '.check_plain($boincteam->name);
224 224
   $context['message'] = t('Processing team @name', array('@name' => $boincteam->name));
225 225
 }
226 226
 
@@ -230,14 +230,14 @@  discard block
 block discarded – undo
230 230
  */
231 231
 function boincteam_utility_batch_finished($success, $results, $operations) {
232 232
   if ($success) {
233
-    $message = 'Info: Delete SPAM Teams utility- ' . count($results) . ' team(s) deleted.';
233
+    $message = 'Info: Delete SPAM Teams utility- '.count($results).' team(s) deleted.';
234 234
     drupal_set_message($message, 'info');
235 235
   }
236 236
   else {
237 237
     // An error occurred.
238 238
     // $operations contains the operations that remained unprocessed.
239 239
     $error_operation = reset($operations);
240
-    $message = 'Error: An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
240
+    $message = 'Error: An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
241 241
     drupal_set_message($message, 'error');
242 242
   }
243 243
 }
244 244
\ No newline at end of file
Please login to merge, or discard this patch.
html/inc/password_compat/password.inc 3 patches
Switch Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -50,47 +50,47 @@  discard block
 block discarded – undo
50 50
             }
51 51
             $resultLength = 0;
52 52
             switch ($algo) {
53
-                case PASSWORD_BCRYPT:
54
-                    $cost = PASSWORD_BCRYPT_DEFAULT_COST;
55
-                    if (isset($options['cost'])) {
56
-                        $cost = (int) $options['cost'];
57
-                        if ($cost < 4 || $cost > 31) {
58
-                            trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING);
59
-                            return null;
60
-                        }
53
+            case PASSWORD_BCRYPT:
54
+                $cost = PASSWORD_BCRYPT_DEFAULT_COST;
55
+                if (isset($options['cost'])) {
56
+                    $cost = (int) $options['cost'];
57
+                    if ($cost < 4 || $cost > 31) {
58
+                        trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING);
59
+                        return null;
61 60
                     }
62
-                    // The length of salt to generate
63
-                    $raw_salt_len = 16;
64
-                    // The length required in the final serialization
65
-                    $required_salt_len = 22;
66
-                    $hash_format = sprintf("$2y$%02d$", $cost);
67
-                    // The expected length of the final crypt() output
68
-                    $resultLength = 60;
69
-                    break;
70
-                default:
71
-                    trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING);
72
-                    return null;
61
+                }
62
+                // The length of salt to generate
63
+                $raw_salt_len = 16;
64
+                // The length required in the final serialization
65
+                $required_salt_len = 22;
66
+                $hash_format = sprintf("$2y$%02d$", $cost);
67
+                // The expected length of the final crypt() output
68
+                $resultLength = 60;
69
+                break;
70
+            default:
71
+                trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING);
72
+                return null;
73 73
             }
74 74
             $salt_req_encoding = false;
75 75
             if (isset($options['salt'])) {
76 76
                 switch (gettype($options['salt'])) {
77
-                    case 'NULL':
78
-                    case 'boolean':
79
-                    case 'integer':
80
-                    case 'double':
81
-                    case 'string':
77
+                case 'NULL':
78
+                case 'boolean':
79
+                case 'integer':
80
+                case 'double':
81
+                case 'string':
82
+                    $salt = (string) $options['salt'];
83
+                    break;
84
+                case 'object':
85
+                    if (method_exists($options['salt'], '__tostring')) {
82 86
                         $salt = (string) $options['salt'];
83 87
                         break;
84
-                    case 'object':
85
-                        if (method_exists($options['salt'], '__tostring')) {
86
-                            $salt = (string) $options['salt'];
87
-                            break;
88
-                        }
89
-                    case 'array':
90
-                    case 'resource':
91
-                    default:
92
-                        trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);
93
-                        return null;
88
+                    }
89
+                case 'array':
90
+                case 'resource':
91
+                default:
92
+                    trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);
93
+                    return null;
94 94
                 }
95 95
                 if (PasswordCompat\binary\_strlen($salt) < $required_salt_len) {
96 96
                     trigger_error(sprintf("password_hash(): Provided salt is too short: %d expecting %d", PasswordCompat\binary\_strlen($salt), $required_salt_len), E_USER_WARNING);
@@ -212,12 +212,12 @@  discard block
 block discarded – undo
212 212
                 return true;
213 213
             }
214 214
             switch ($algo) {
215
-                case PASSWORD_BCRYPT:
216
-                    $cost = isset($options['cost']) ? (int) $options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST;
217
-                    if ($cost !== $info['options']['cost']) {
218
-                        return true;
219
-                    }
220
-                    break;
215
+            case PASSWORD_BCRYPT:
216
+                $cost = isset($options['cost']) ? (int) $options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST;
217
+                if ($cost !== $info['options']['cost']) {
218
+                    return true;
219
+                }
220
+                break;
221 221
             }
222 222
             return false;
223 223
         }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
                 return null;
39 39
             }
40 40
             if (is_null($password) || is_int($password)) {
41
-                $password = (string) $password;
41
+                $password = (string)$password;
42 42
             }
43 43
             if (!is_string($password)) {
44 44
                 trigger_error("password_hash(): Password must be a string", E_USER_WARNING);
45 45
                 return null;
46 46
             }
47 47
             if (!is_int($algo)) {
48
-                trigger_error("password_hash() expects parameter 2 to be long, " . gettype($algo) . " given", E_USER_WARNING);
48
+                trigger_error("password_hash() expects parameter 2 to be long, ".gettype($algo)." given", E_USER_WARNING);
49 49
                 return null;
50 50
             }
51 51
             $resultLength = 0;
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
                 case PASSWORD_BCRYPT:
54 54
                     $cost = PASSWORD_BCRYPT_DEFAULT_COST;
55 55
                     if (isset($options['cost'])) {
56
-                        $cost = (int) $options['cost'];
56
+                        $cost = (int)$options['cost'];
57 57
                         if ($cost < 4 || $cost > 31) {
58 58
                             trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING);
59 59
                             return null;
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
                     case 'integer':
80 80
                     case 'double':
81 81
                     case 'string':
82
-                        $salt = (string) $options['salt'];
82
+                        $salt = (string)$options['salt'];
83 83
                         break;
84 84
                     case 'object':
85 85
                         if (method_exists($options['salt'], '__tostring')) {
86
-                            $salt = (string) $options['salt'];
86
+                            $salt = (string)$options['salt'];
87 87
                             break;
88 88
                         }
89 89
                     case 'array':
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
                     if ($read >= $raw_salt_len) {
127 127
                         $buffer_valid = true;
128 128
                     }
129
-                    $buffer = str_pad($buffer, $raw_salt_len, "\0") ^ str_pad($local_buffer, $raw_salt_len, "\0");
129
+                    $buffer = str_pad($buffer, $raw_salt_len, "\0")^str_pad($local_buffer, $raw_salt_len, "\0");
130 130
                 }
131 131
                 if (!$buffer_valid || PasswordCompat\binary\_strlen($buffer) < $raw_salt_len) {
132 132
                     $buffer_length = PasswordCompat\binary\_strlen($buffer);
133 133
                     for ($i = 0; $i < $raw_salt_len; $i++) {
134 134
                         if ($i < $buffer_length) {
135
-                            $buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));
135
+                            $buffer[$i] = $buffer[$i]^chr(mt_rand(0, 255));
136 136
                         } else {
137 137
                             $buffer .= chr(mt_rand(0, 255));
138 138
                         }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             }
154 154
             $salt = PasswordCompat\binary\_substr($salt, 0, $required_salt_len);
155 155
 
156
-            $hash = $hash_format . $salt;
156
+            $hash = $hash_format.$salt;
157 157
 
158 158
             $ret = crypt($password, $hash);
159 159
 
@@ -208,12 +208,12 @@  discard block
 block discarded – undo
208 208
          */
209 209
         function password_needs_rehash($hash, $algo, array $options = array()) {
210 210
             $info = password_get_info($hash);
211
-            if ($info['algo'] !== (int) $algo) {
211
+            if ($info['algo'] !== (int)$algo) {
212 212
                 return true;
213 213
             }
214 214
             switch ($algo) {
215 215
                 case PASSWORD_BCRYPT:
216
-                    $cost = isset($options['cost']) ? (int) $options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST;
216
+                    $cost = isset($options['cost']) ? (int)$options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST;
217 217
                     if ($cost !== $info['options']['cost']) {
218 218
                         return true;
219 219
                     }
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
             $status = 0;
244 244
             for ($i = 0; $i < PasswordCompat\binary\_strlen($ret); $i++) {
245
-                $status |= (ord($ret[$i]) ^ ord($hash[$i]));
245
+                $status |= (ord($ret[$i])^ord($hash[$i]));
246 246
             }
247 247
 
248 248
             return $status === 0;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -299,7 +299,7 @@
 block discarded – undo
299 299
          * @return boolean the check result
300 300
          */
301 301
         function check() {
302
-            static $pass = NULL;
302
+            static $pass = null;
303 303
 
304 304
             if (is_null($pass)) {
305 305
                 if (function_exists('crypt')) {
Please login to merge, or discard this patch.
html/inc/random_compat/random_bytes_com_dotnet.inc 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
      *
39 39
      * @return string
40 40
      */
41
-    function random_bytes($bytes)
42
-    {
41
+    function random_bytes($bytes) {
43 42
         try {
44 43
             $bytes = RandomCompat_intval($bytes);
45 44
         } catch (TypeError $ex) {
Please login to merge, or discard this patch.
html/inc/random_compat/random_bytes_libsodium_legacy.inc 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,10 +70,10 @@
 block discarded – undo
70 70
                 $n = ($bytes - $i) > 1073741824
71 71
                     ? 1073741824
72 72
                     : $bytes - $i;
73
-                $buf .= Sodium::randombytes_buf((int) $n);
73
+                $buf .= Sodium::randombytes_buf((int)$n);
74 74
             }
75 75
         } else {
76
-            $buf .= Sodium::randombytes_buf((int) $bytes);
76
+            $buf .= Sodium::randombytes_buf((int)$bytes);
77 77
         }
78 78
 
79 79
         if (is_string($buf)) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
      *
39 39
      * @return string
40 40
      */
41
-    function random_bytes($bytes)
42
-    {
41
+    function random_bytes($bytes) {
43 42
         try {
44 43
             $bytes = RandomCompat_intval($bytes);
45 44
         } catch (TypeError $ex) {
Please login to merge, or discard this patch.
html/inc/random_compat/random_bytes_dev_urandom.inc 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@
 block discarded – undo
44 44
      *
45 45
      * @return string
46 46
      */
47
-    function random_bytes($bytes)
48
-    {
47
+    function random_bytes($bytes) {
49 48
         static $fp = null;
50 49
         /**
51 50
          * This block should only be run once
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@
 block discarded – undo
141 141
                 /**
142 142
                  * @var string|bool
143 143
                  */
144
-                $buf = $buf . $read;
144
+                $buf = $buf.$read;
145 145
             } while ($remaining > 0);
146 146
 
147 147
             /**
Please login to merge, or discard this patch.
html/inc/random_compat/random_int.inc 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         }
79 79
 
80 80
         if ($max === $min) {
81
-            return (int) $min;
81
+            return (int)$min;
82 82
         }
83 83
 
84 84
         /**
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
              * type juggling
125 125
              */
126 126
             while ($range > 0) {
127
-                if ($bits % 8 === 0) {
127
+                if ($bits%8 === 0) {
128 128
                     ++$bytes;
129 129
                 }
130 130
                 ++$bits;
131 131
                 $range >>= 1;
132
-                $mask = $mask << 1 | 1;
132
+                $mask = $mask << 1|1;
133 133
             }
134 134
             $valueShift = $min;
135 135
         }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
              */
168 168
             $val &= 0;
169 169
             for ($i = 0; $i < $bytes; ++$i) {
170
-                $val |= ord($randomByteString[$i]) << ($i * 8);
170
+                $val |= ord($randomByteString[$i]) << ($i*8);
171 171
             }
172 172
 
173 173
             /**
@@ -185,6 +185,6 @@  discard block
 block discarded – undo
185 185
              */
186 186
         } while (!is_int($val) || $val > $max || $val < $min);
187 187
 
188
-        return (int) $val;
188
+        return (int)$val;
189 189
     }
190 190
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
      *
39 39
      * @return int
40 40
      */
41
-    function random_int($min, $max)
42
-    {
41
+    function random_int($min, $max) {
43 42
         /**
44 43
          * Type and input logic checks
45 44
          *
Please login to merge, or discard this patch.
html/inc/random_compat/error_polyfill.inc 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,21 +28,18 @@
 block discarded – undo
28 28
 
29 29
 if (!class_exists('Error', false)) {
30 30
     // We can't really avoid making this extend Exception in PHP 5.
31
-    class Error extends Exception
32
-    {
31
+    class Error extends Exception {
33 32
         
34 33
     }
35 34
 }
36 35
 
37 36
 if (!class_exists('TypeError', false)) {
38 37
     if (is_subclass_of('Error', 'Exception')) {
39
-        class TypeError extends Error
40
-        {
38
+        class TypeError extends Error {
41 39
             
42 40
         }
43 41
     } else {
44
-        class TypeError extends Exception
45
-        {
42
+        class TypeError extends Exception {
46 43
             
47 44
         }
48 45
     }
Please login to merge, or discard this patch.