@@ -53,7 +53,7 @@ |
||
53 | 53 | // Toggles the enable flag |
54 | 54 | function mct_toggle_field($field) { |
55 | 55 | $ctid = post_int("consent_type_id"); |
56 | - $toggle = post_str("toggle" . $field); |
|
56 | + $toggle = post_str("toggle".$field); |
|
57 | 57 | if ($toggle == "Click to Enable") { |
58 | 58 | $state = 1; |
59 | 59 | $action = "Enabled"; |
@@ -82,7 +82,7 @@ |
||
82 | 82 | |
83 | 83 | page_head(tra("Account Deleted")); |
84 | 84 | |
85 | - echo "<p>".tra("Your account has been deleted. If you want to contribute to %1 in the future you will need to create a new account.",PROJECT)."</p>"; |
|
85 | + echo "<p>".tra("Your account has been deleted. If you want to contribute to %1 in the future you will need to create a new account.", PROJECT)."</p>"; |
|
86 | 86 | |
87 | 87 | page_tail(); |
88 | 88 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | start_table(); |
28 | 28 | echo " |
29 | 29 | <tr><td>" |
30 | - . tra("Leader boards for %1",PROJECT).": |
|
30 | + . tra("Leader boards for %1", PROJECT).": |
|
31 | 31 | <ul> |
32 | 32 | <li><a href=\"top_users.php\">" . tra("Participants")."</a> |
33 | 33 | "; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | if (!DISABLE_TEAMS) { |
39 | 39 | echo " |
40 | - <li><a href=\"top_teams.php\">" . tra("Teams"). "</a> |
|
40 | + <li><a href=\"top_teams.php\">" . tra("Teams")."</a> |
|
41 | 41 | "; |
42 | 42 | if ($credit_by_app) { |
43 | 43 | echo "<ul><li><a href=per_app_list.php?is_team=1>Per application</a></ul>\n"; |
@@ -22,14 +22,14 @@ |
||
22 | 22 | require_once("../inc/util.inc"); |
23 | 23 | require_once("../inc/cache.inc"); |
24 | 24 | |
25 | -$min_credit = .1; // only count hosts with this much RAC |
|
25 | +$min_credit = .1; // only count hosts with this much RAC |
|
26 | 26 | $total_rac = 0; |
27 | 27 | |
28 | 28 | define("CACHE_PERIOD", 7*86400); |
29 | 29 | |
30 | 30 | function show_type($type, $stats) { |
31 | 31 | global $total_rac; |
32 | - $pct = $total_rac?number_format(100*$stats->rac/$total_rac, 4):0; |
|
32 | + $pct = $total_rac ?number_format(100*$stats->rac/$total_rac, 4) : 0; |
|
33 | 33 | row_array(array($type, $stats->nhosts, "$pct %")); |
34 | 34 | } |
35 | 35 |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * Helper functions |
10 | 10 | */ |
11 | 11 | function _boincuser_delete_goto_admindelete($form, &$form_state) { |
12 | - drupal_goto('/admin/boinc/user_delete/' . $form['#uid']); |
|
12 | + drupal_goto('/admin/boinc/user_delete/'.$form['#uid']); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | function _boincuser_delete_cancel($form, &$form_state) { |
16 | - drupal_goto('/user/' . $form['#uid'] . '/edit'); |
|
16 | + drupal_goto('/user/'.$form['#uid'].'/edit'); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | return form_set_error('current_pass', bts('Authentication is required when requesting account deletion.', array(), NULL, 'boinc:delete-user-account')); |
25 | 25 | } |
26 | 26 | |
27 | - $given_hash = md5($current_pass . $boinc_user->email_addr); |
|
27 | + $given_hash = md5($current_pass.$boinc_user->email_addr); |
|
28 | 28 | |
29 | - if ( (!password_verify($given_hash, $boinc_user->passwd_hash)) and ($given_hash != $boinc_user->passwd_hash) ) { |
|
29 | + if ((!password_verify($given_hash, $boinc_user->passwd_hash)) and ($given_hash != $boinc_user->passwd_hash)) { |
|
30 | 30 | return form_set_error('current_pass', bts('Password entered is not valid. Please verify that it is correct.', array(), NULL, 'boinc:delete-user-account')); |
31 | 31 | } |
32 | 32 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * Delete the user function. |
42 | 42 | */ |
43 | -function _boincuser_delete_deleteuser($account, $action=NULL) { |
|
43 | +function _boincuser_delete_deleteuser($account, $action = NULL) { |
|
44 | 44 | require_boinc('user_util'); |
45 | 45 | require_boinc('delete_account'); |
46 | 46 | |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | // * erase signature |
75 | 75 | $myarray = array( |
76 | 76 | 'status' => 0, |
77 | - 'name' => 'deleted_' . time() . '_' . random_string(), |
|
78 | - 'mail' => 'deleted_' . time() . '_' . random_string(), |
|
79 | - 'pass' => 'deleted_' . time() . '_' . random_string(), |
|
77 | + 'name' => 'deleted_'.time().'_'.random_string(), |
|
78 | + 'mail' => 'deleted_'.time().'_'.random_string(), |
|
79 | + 'pass' => 'deleted_'.time().'_'.random_string(), |
|
80 | 80 | 'signature' => '', |
81 | - 'init' => 'deleted_' . time() . '_' . random_string(), |
|
81 | + 'init' => 'deleted_'.time().'_'.random_string(), |
|
82 | 82 | ); |
83 | 83 | user_save($account, $myarray); |
84 | 84 | break; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | if (!empty($mids)) { |
132 | 132 | // Delete recipient entries in {pm_index} of the messages the user wrote. |
133 | - db_query('DELETE FROM {pm_index} WHERE mid IN (' . db_placeholders($mids) . ')', $mids); |
|
133 | + db_query('DELETE FROM {pm_index} WHERE mid IN ('.db_placeholders($mids).')', $mids); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | // Delete recipient entries of that user. |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $form['#uid'] = $uid; |
66 | 66 | |
67 | 67 | $form['account']['help'] = array( |
68 | - '#value' => "<p>" . t("This form will delete this user <strong>without any email notification</strong> sent to the user. Be very careful in deleting users using this form. Once you select the delete type, check the checkbox, enter your password, and click submit, the user's account will be deleted. This will occur <strong>immediately</strong>. There is no 'undo'!") . "</p><p>" . t("You are deleting the following user, link opens in new window:") . "</p>", |
|
68 | + '#value' => "<p>".t("This form will delete this user <strong>without any email notification</strong> sent to the user. Be very careful in deleting users using this form. Once you select the delete type, check the checkbox, enter your password, and click submit, the user's account will be deleted. This will occur <strong>immediately</strong>. There is no 'undo'!")."</p><p>".t("You are deleting the following user, link opens in new window:")."</p>", |
|
69 | 69 | '#weight' => -1, |
70 | 70 | '#prefix' => "<div id='delete-instructions'>", |
71 | 71 | '#suffix' => "</div>", |
@@ -76,16 +76,16 @@ discard block |
||
76 | 76 | drupal_set_title($account->boincuser_name); |
77 | 77 | |
78 | 78 | $form['account']['boincuser_name'] = array( |
79 | - '#value' => t('<li>BOINC username (public displayname): ') . l("{$account->boincuser_name}", "account/{$account->uid}", array('attributes' => array('target' => '_blank'))), |
|
79 | + '#value' => t('<li>BOINC username (public displayname): ').l("{$account->boincuser_name}", "account/{$account->uid}", array('attributes' => array('target' => '_blank'))), |
|
80 | 80 | ); |
81 | 81 | $form['account']['boincuser_id'] = array( |
82 | - '#value' => t('<li>BOINC user ID: ') . $account->boincuser_id, |
|
82 | + '#value' => t('<li>BOINC user ID: ').$account->boincuser_id, |
|
83 | 83 | ); |
84 | 84 | $form['account']['drupal_name'] = array( |
85 | - '#value' => t('<li>Drupal username (internal): ') . $account->name, |
|
85 | + '#value' => t('<li>Drupal username (internal): ').$account->name, |
|
86 | 86 | ); |
87 | 87 | $form['account']['user_id'] = array( |
88 | - '#value' => t('<li>Drupal user ID: ') . $account->uid, |
|
88 | + '#value' => t('<li>Drupal user ID: ').$account->uid, |
|
89 | 89 | ); |
90 | 90 | |
91 | 91 | $form['account']['user_delete_action'] = array( |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | form_set_error('user_delete_action', t('Please select an action to perform using the radio buttons.')); |
149 | 149 | } |
150 | 150 | |
151 | - if ( ($form_state['values']['user_delete_action'] != 'soft_obfuscate') and ($form_state['values']['user_delete_action'] != 'hard_wipe') ) { |
|
151 | + if (($form_state['values']['user_delete_action'] != 'soft_obfuscate') and ($form_state['values']['user_delete_action'] != 'hard_wipe')) { |
|
152 | 152 | form_set_error('user_delete_action', t('User Delete action not a predefined value, unknown error in radio buttons.')); |
153 | 153 | } |
154 | 154 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | // If $selection is provided, and if it matches one of the entries in the file, |
33 | 33 | // it will be selected by default. |
34 | 34 | // |
35 | -function show_combo_box($name, $filename, $selection=null) { |
|
35 | +function show_combo_box($name, $filename, $selection = null) { |
|
36 | 36 | echo "<select name=\"$name\" class=\"form-control\">\n"; |
37 | 37 | |
38 | 38 | $file = fopen($filename, "r"); |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | <tr><td colspan=2> |
64 | 64 | <table border=0 cellpadding=5 |
65 | 65 | <tr> |
66 | -<td valign=top><a href=\"" . IMAGE_URL . $profile->userid . '.jpg' . "\"><img src=\"" . IMAGE_URL . $profile->userid . '_sm.jpg' . "\"></a> |
|
66 | +<td valign=top><a href=\"" . IMAGE_URL.$profile->userid.'.jpg'."\"><img src=\"".IMAGE_URL.$profile->userid.'_sm.jpg'."\"></a> |
|
67 | 67 | </td> |
68 | -<td valign=top>" .tra("%1 Your profile picture is shown to the left.", $warning) ." |
|
68 | +<td valign=top>" .tra("%1 Your profile picture is shown to the left.", $warning)." |
|
69 | 69 | <p>". |
70 | -tra("To replace it, click the \"Browse\" button and select a JPEG or PNG file (%1 or less).", "50KB") ."<br /> |
|
70 | +tra("To replace it, click the \"Browse\" button and select a JPEG or PNG file (%1 or less).", "50KB")."<br /> |
|
71 | 71 | <input name=picture type=file><br> |
72 | 72 | <p>". |
73 | -tra("To remove it from your profile, check this box:") . " |
|
73 | +tra("To remove it from your profile, check this box:")." |
|
74 | 74 | <input type=checkbox name=delete_pic> |
75 | 75 | <p> |
76 | 76 | </td></tr>"; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | end_table(); |
79 | 79 | echo "</td></tr>"; |
80 | 80 | } else { |
81 | - rowify(tra("If you would like include a picture with your profile, click the \"Browse\" button and select a JPEG or PNG file. Please select images of %1 or less.", "50KB") . " |
|
81 | + rowify(tra("If you would like include a picture with your profile, click the \"Browse\" button and select a JPEG or PNG file. Please select images of %1 or less.", "50KB")." |
|
82 | 82 | <p> |
83 | 83 | <input name=picture type=file> |
84 | 84 | "); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | row1(tra("Language")); |
94 | 94 | echo "<tr><td> |
95 | 95 | <p>" . |
96 | - tra("Select the language in which your profile is written:") . " |
|
96 | + tra("Select the language in which your profile is written:")." |
|
97 | 97 | <p> |
98 | 98 | "; |
99 | 99 | if (isset($profile->language)) { |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | if ($recaptcha_public_key) { |
111 | 111 | table_row(boinc_recaptcha_get_html($recaptcha_public_key)); |
112 | 112 | } |
113 | - table_row("<p><input class=\"btn btn-success\" type=\"submit\" value=\"".tra("Create/edit profile") ."\" name=\"submit\">"); |
|
113 | + table_row("<p><input class=\"btn btn-success\" type=\"submit\" value=\"".tra("Create/edit profile")."\" name=\"submit\">"); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | // Returns an array containing: |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | // Determine if the filetype uploaded is supported. |
126 | 126 | // TODO: Change these to constants. |
127 | - switch($size[2]) { |
|
127 | + switch ($size[2]) { |
|
128 | 128 | case '2': // JPEG |
129 | 129 | $image = imageCreateFromJPEG($fileName); |
130 | 130 | break; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | function show_description() { |
163 | 163 | echo " |
164 | - <p>" .tra("Your %1 profile %2 lets you share your opinions and background with the %3 community.", "<b>", "</b>", PROJECT) . " |
|
164 | + <p>" .tra("Your %1 profile %2 lets you share your opinions and background with the %3 community.", "<b>", "</b>", PROJECT)." |
|
165 | 165 | <p> |
166 | 166 | "; |
167 | 167 | } |
@@ -179,14 +179,14 @@ discard block |
||
179 | 179 | row1(show_profile_heading1()); |
180 | 180 | rowify(show_profile_question1().bbcode_info()); |
181 | 181 | show_textarea("response1", $response1); |
182 | - row1( show_profile_heading2()); |
|
183 | - rowify( show_profile_question2().bbcode_info()); |
|
182 | + row1(show_profile_heading2()); |
|
183 | + rowify(show_profile_question2().bbcode_info()); |
|
184 | 184 | show_textarea("response2", $response2); |
185 | 185 | show_language_selection($profile); |
186 | 186 | } |
187 | 187 | |
188 | 188 | function show_textarea($name, $text) { |
189 | - rowify("<textarea name=\"$name\" class=\"form-control\" rows=\"10\">" . $text . "</textarea>"); |
|
189 | + rowify("<textarea name=\"$name\" class=\"form-control\" rows=\"10\">".$text."</textarea>"); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | // $profile is null if user doesn't already have a profile. |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | $delete_pic = "off"; |
233 | 233 | } |
234 | 234 | |
235 | - if (strlen($response1)==0 && |
|
236 | - strlen($response2)==0 && |
|
235 | + if (strlen($response1) == 0 && |
|
236 | + strlen($response2) == 0 && |
|
237 | 237 | $delete_pic != "on" && |
238 | 238 | !is_uploaded_file($_FILES['picture']['tmp_name']) |
239 | 239 | ) { |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $profile->verification = 0; |
248 | 248 | } |
249 | 249 | |
250 | - $profile ? $has_picture = $profile->has_picture: $has_picture = false; |
|
250 | + $profile ? $has_picture = $profile->has_picture : $has_picture = false; |
|
251 | 251 | |
252 | 252 | if (is_uploaded_file($_FILES['picture']['tmp_name'])) { |
253 | 253 | $has_picture = true; |
@@ -262,13 +262,13 @@ discard block |
||
262 | 262 | |
263 | 263 | // Write the original image file to disk. |
264 | 264 | // TODO: define a constant for image quality. |
265 | - ImageJPEG($images[0], IMAGE_PATH . $user->id . '.jpg'); |
|
266 | - ImageJPEG($images[1], IMAGE_PATH . $user->id . '_sm.jpg'); |
|
265 | + ImageJPEG($images[0], IMAGE_PATH.$user->id.'.jpg'); |
|
266 | + ImageJPEG($images[1], IMAGE_PATH.$user->id.'_sm.jpg'); |
|
267 | 267 | } |
268 | 268 | $response1 = sanitize_html($response1); |
269 | 269 | $response2 = sanitize_html($response2); |
270 | 270 | |
271 | - $has_picture = $has_picture?1:0; |
|
271 | + $has_picture = $has_picture ? 1 : 0; |
|
272 | 272 | if ($profile) { |
273 | 273 | $query = " response1 = '".BoincDb::escape_string($response1)."'," |
274 | 274 | ." response2 = '".BoincDb::escape_string($response2)."'," |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | page_tail(); |
311 | 311 | } |
312 | 312 | |
313 | -function show_profile_form($profile, $warning=null) { |
|
313 | +function show_profile_form($profile, $warning = null) { |
|
314 | 314 | if ($profile) { |
315 | 315 | page_head(tra("Edit your profile"), null, null, null, boinc_recaptcha_get_head_extra()); |
316 | 316 | } else { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | -form_start("create_account_action.php","post"); |
|
69 | +form_start("create_account_action.php", "post"); |
|
70 | 70 | create_account_form($teamid, $next_url); |
71 | 71 | global $recaptcha_public_key; |
72 | 72 | if ($recaptcha_public_key) { |
@@ -77,5 +77,5 @@ discard block |
||
77 | 77 | |
78 | 78 | page_tail(); |
79 | 79 | |
80 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
80 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
81 | 81 | ?> |
@@ -59,7 +59,7 @@ |
||
59 | 59 | if ($checkct) { |
60 | 60 | $rc1 = consent_to_a_policy($user, $ctid, 1, 0, 'Webform', time()); |
61 | 61 | if (!$rc1) { |
62 | - error_page("Database error when attempting to INSERT into table consent with ID=$user->id. " . BoincDb::error() . " Please contact site administrators."); |
|
62 | + error_page("Database error when attempting to INSERT into table consent with ID=$user->id. ".BoincDb::error()." Please contact site administrators."); |
|
63 | 63 | } |
64 | 64 | } else { |
65 | 65 | error_page("Error: consent type for enrollment not found. Please contact site administrators."); |