@@ -93,9 +93,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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( |
@@ -100,7 +100,7 @@ discard block |
||
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 |
||
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", |
@@ -30,10 +30,10 @@ discard block |
||
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 |
||
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)); |
@@ -55,7 +55,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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')) { |
@@ -114,7 +114,7 @@ discard block |
||
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 |
||
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'); |
@@ -87,15 +87,15 @@ discard block |
||
87 | 87 | 'teaser' => $teaser, |
88 | 88 | 'uid' => boincuser_lookup_uid($boincteam->userid), |
89 | 89 | 'path' => null, |
90 | - 'status' => 1, // published or not - always publish |
|
90 | + 'status' => 1, // published or not - always publish |
|
91 | 91 | 'promote' => 0, |
92 | 92 | 'created' => $boincteam->create_time, |
93 | - 'comment' => 0, // comments disabled |
|
93 | + 'comment' => 0, // comments disabled |
|
94 | 94 | 'moderate' => 0, |
95 | 95 | 'sticky' => 0, |
96 | 96 | 'format' => $input_format |
97 | 97 | ); |
98 | - $node = (object) $node; // node_save requires an object form |
|
98 | + $node = (object)$node; // node_save requires an object form |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $node->taxonomy[] = taxonomy_get_term($team_type_tid); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * flag send_email=1, meaning their notification privacy will be |
126 | 126 | * respected. This is useful the list of users are to be contacted. |
127 | 127 | */ |
128 | -function _boincteam_userids($boincteamid, $boincid=TRUE, $respectprivacy=TRUE) { |
|
128 | +function _boincteam_userids($boincteamid, $boincid = TRUE, $respectprivacy = TRUE) { |
|
129 | 129 | $sql = 'SELECT user.id as id FROM {user} user WHERE user.teamid=%s'; |
130 | 130 | if ($respectprivacy) { |
131 | 131 | $sql .= ' AND user.send_email=1'; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * flag send_email=1, meaning their notification privacy will be |
158 | 158 | * respected. This is useful the list of users are to be contacted. |
159 | 159 | */ |
160 | -function _boincteam_emails($boincteamid, $respectprivacy=TRUE) { |
|
160 | +function _boincteam_emails($boincteamid, $respectprivacy = TRUE) { |
|
161 | 161 | $sql = 'SELECT user.email_addr as email_addr FROM {user} user WHERE user.teamid=%s'; |
162 | 162 | if ($respectprivacy) { |
163 | 163 | $sql .= ' AND user.send_email=1'; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | '#suffix' => '</li>', |
120 | 120 | ); |
121 | 121 | $form['form control tabs'] = array( |
122 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>' |
|
122 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>' |
|
123 | 123 | ); |
124 | 124 | |
125 | 125 | return $form; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | |
164 | 164 | // Create the team in the BOINC db |
165 | 165 | |
166 | - require_boinc(array('user','team')); |
|
166 | + require_boinc(array('user', 'team')); |
|
167 | 167 | $boinc_team = make_team( |
168 | 168 | $account->boincuser_id, |
169 | 169 | $values['name'], |
@@ -199,10 +199,10 @@ discard block |
||
199 | 199 | 'teaser' => $teaser, |
200 | 200 | 'uid' => $user->uid, |
201 | 201 | 'path' => null, |
202 | - 'status' => 1, // published or not - always publish |
|
202 | + 'status' => 1, // published or not - always publish |
|
203 | 203 | 'promote' => 0, |
204 | 204 | 'created' => $created_time, |
205 | - 'comment' => 0, // comments disabled |
|
205 | + 'comment' => 0, // comments disabled |
|
206 | 206 | 'moderate' => 0, |
207 | 207 | 'sticky' => 0, |
208 | 208 | 'format' => $input_format |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $node['og_private'] = 0; |
230 | 230 | */ |
231 | 231 | |
232 | - $node = (object) $node; // node_save requires an object form |
|
232 | + $node = (object)$node; // node_save requires an object form |
|
233 | 233 | |
234 | 234 | /* |
235 | 235 | $node->field_description[]['value'] = $boincteam->description; |
@@ -379,12 +379,12 @@ discard block |
||
379 | 379 | '#suffix' => '</li>', |
380 | 380 | ); |
381 | 381 | $form['form control tabs'] = array( |
382 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>' |
|
382 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/edit', TRUE)).'</li>' |
|
383 | 383 | ); |
384 | 384 | } |
385 | 385 | else { |
386 | 386 | $form['description'] = array( |
387 | - '#prefix' => '<div class="form-item"><label>' . bts('Description', array(), NULL, 'boinc:team-description') . ':</label></div><div class="form-item">', |
|
387 | + '#prefix' => '<div class="form-item"><label>'.bts('Description', array(), NULL, 'boinc:team-description').':</label></div><div class="form-item">', |
|
388 | 388 | '#value' => $default['description'], |
389 | 389 | '#suffix' => '</div>', |
390 | 390 | ); |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | '#suffix' => '</li>', |
541 | 541 | ); |
542 | 542 | $form['form control tabs'] = array( |
543 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>' |
|
543 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/edit', TRUE)).'</li>' |
|
544 | 544 | ); |
545 | 545 | |
546 | 546 | //$form['#redirect'] = "community/teams/{$team_id}"; |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | drupal_set_title($mytitle); |
657 | 657 | |
658 | 658 | $form['emailteam']['header'] = array( |
659 | - '#value' => '<h1>' . $mytitle . '</h1>', |
|
659 | + '#value' => '<h1>'.$mytitle.'</h1>', |
|
660 | 660 | '#weight' => '-10', |
661 | 661 | '#prefix' => "<div id='sendmessageteammembers-header'>", |
662 | 662 | '#suffix' => "</div>", |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | } |
779 | 779 | |
780 | 780 | // Check body |
781 | - if ( ($message['body'] === NULL || $message['body'] === '') ) { |
|
781 | + if (($message['body'] === NULL || $message['body'] === '')) { |
|
782 | 782 | form_set_error('body', |
783 | 783 | bts('Not allowed to send an empty message.', array(), NULL, 'boinc:team-message-form') |
784 | 784 | ); |
@@ -803,8 +803,8 @@ discard block |
||
803 | 803 | global $base_path; |
804 | 804 | |
805 | 805 | $suid = $form_state['values']['_senderuid']; |
806 | - $account = user_load(array('uid' => $suid )); |
|
807 | - $site_url = $base_url . $base_path . "messages/new/" . $suid; |
|
806 | + $account = user_load(array('uid' => $suid)); |
|
807 | + $site_url = $base_url.$base_path."messages/new/".$suid; |
|
808 | 808 | |
809 | 809 | // Form is validated, now send to all team members. Lookup boinc |
810 | 810 | // id of all team members, and then use user_load() to load user |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | // emails removed. |
816 | 816 | $member_emails = _boincteam_emails($boinc_id); |
817 | 817 | // Remove sender's email address, unless selfsend is true. |
818 | - if ( !$form_state['values']['selfsend'] ) { |
|
818 | + if (!$form_state['values']['selfsend']) { |
|
819 | 819 | $pos = array_search($account->mail, $member_emails); |
820 | 820 | unset($member_emails[$pos]); |
821 | 821 | } |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | |
840 | 840 | $om = bts( |
841 | 841 | 'Sent your email message to !number team members.', |
842 | - array( '!number' => count($member_emails) ), |
|
842 | + array('!number' => count($member_emails)), |
|
843 | 843 | 'NULL', |
844 | 844 | 'boinc:team-message-sent' |
845 | 845 | ); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | // Call our custom authentication function to check for an existing BOINC user |
36 | 36 | if (!boincuser_login_authenticate($form_state['values'])) { |
37 | 37 | // Authentication failed; set an error accordingly |
38 | - form_set_error('name', bts('Sorry, unrecognized email address or password.', array(), NULL, 'boinc:forgot-password') . ' ' . l(bts('Have you forgotten your password?', array(), NULL, 'boinc:forgot-password'), 'user/password')); |
|
38 | + form_set_error('name', bts('Sorry, unrecognized email address or password.', array(), NULL, 'boinc:forgot-password').' '.l(bts('Have you forgotten your password?', array(), NULL, 'boinc:forgot-password'), 'user/password')); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | } else { |
85 | 85 | // Create a Drupal user from the BOINC user |
86 | 86 | if ($user = boincuser_register_make_drupal_user($boinc_user)) { |
87 | - watchdog('user', 'New external user: %email using module %module.', array('%email' => $email_addr, '%module' => $module), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $user->uid .'/edit')); |
|
87 | + watchdog('user', 'New external user: %email using module %module.', array('%email' => $email_addr, '%module' => $module), WATCHDOG_NOTICE, l(t('edit'), 'user/'.$user->uid.'/edit')); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | } |
@@ -394,14 +394,14 @@ discard block |
||
394 | 394 | // set email address lower-case |
395 | 395 | $edit['mail'] = strtolower($edit['mail']); |
396 | 396 | |
397 | - $boinc_user_already_exists = ( BoincUser::lookup_email_addr($edit['mail']) || BoincUser::lookup_prev_email_addr($edit['mail']) ); |
|
397 | + $boinc_user_already_exists = (BoincUser::lookup_email_addr($edit['mail']) || BoincUser::lookup_prev_email_addr($edit['mail'])); |
|
398 | 398 | if ($boinc_user_already_exists) { |
399 | 399 | form_set_error('mail', bts('A BOINC account already exists for @email.', array('@email' => $edit['mail']), NULL, 'boinc:add-new-user')); |
400 | 400 | } |
401 | 401 | |
402 | 402 | // Check email has not been changed in last X days (default X=7). |
403 | - $duration = 86400 * 7; |
|
404 | - if ( (($boinc_user->email_addr_change_time + $duration) > time()) and (!(user_access('administer users'))) ) { |
|
403 | + $duration = 86400*7; |
|
404 | + if ((($boinc_user->email_addr_change_time + $duration) > time()) and (!(user_access('administer users')))) { |
|
405 | 405 | form_set_error('email_addr_change_time', |
406 | 406 | bts('Your email address was changed within the past seven (7) days. You must wait until !futuredate to change your email again. If you need to reverse this change, please look for an email sent to !prev_email_addr.', |
407 | 407 | array( |
@@ -422,11 +422,11 @@ discard block |
||
422 | 422 | unset($_SESSION['reset_pass']); |
423 | 423 | } |
424 | 424 | else { |
425 | - $given_hash = md5($edit['current_pass'] . strtolower($account->mail)); |
|
425 | + $given_hash = md5($edit['current_pass'].strtolower($account->mail)); |
|
426 | 426 | if (!$edit['current_pass']) { |
427 | 427 | form_set_error('current_pass', bts('Authentication is required when changing E-mail address or setting new password.', array(), NULL, 'boinc:account-credentials-change')); |
428 | 428 | } |
429 | - elseif ( (!password_verify($given_hash, $boinc_user->passwd_hash)) and ($given_hash != $boinc_user->passwd_hash) ) { |
|
429 | + elseif ((!password_verify($given_hash, $boinc_user->passwd_hash)) and ($given_hash != $boinc_user->passwd_hash)) { |
|
430 | 430 | form_set_error('current_pass', bts('Password entered is not valid. Please verify that it is correct.', array(), NULL, 'boinc:account-credentials-change')); |
431 | 431 | } |
432 | 432 | |
@@ -489,29 +489,29 @@ discard block |
||
489 | 489 | $project_domain = $headers['Host']; |
490 | 490 | $form['heading'] = array( |
491 | 491 | '#type' => 'markup', |
492 | - '#value' => '<h3>' . bts("If you forgot your account's email address, or you can't receive email there:", array(), NULL, 'boinc:authenticator-login-page') . '</h3>' |
|
492 | + '#value' => '<h3>'.bts("If you forgot your account's email address, or you can't receive email there:", array(), NULL, 'boinc:authenticator-login-page').'</h3>' |
|
493 | 493 | ); |
494 | 494 | $form['instructions'] = array( |
495 | 495 | '#type' => 'markup', |
496 | - '#value' => '' . |
|
497 | - '<p>' . bts("If you have run BOINC under the account, you can still access it. Here's how:", array(), NULL, 'boinc:authenticator-login-page') . |
|
498 | - ' <ul>' . |
|
499 | - ' <li>' . bts('Go to the BOINC data directory on your computer (see !boinc_wiki for help finding this).', array('!boinc_wiki' => l(bts('BOINC documentation', array(), NULL, 'boinc:authenticator-login-page'), 'http://boinc.berkeley.edu/wiki/BOINC_Data_directory')), NULL, 'boinc:authenticator-login-page') . '</li>' . |
|
500 | - ' <li>' . bts('Find your account file for this project; it will have a name like %file (where the project URL is %url).', array('%file' => "account_{$project_domain}.xml", '%url' => "http://{$project_domain}"), NULL, 'boinc:authenticator-login-page') . '</li>' . |
|
501 | - ' <li>' . bts("Open the file in a text editor like Notepad. You'll see something like:", array(), NULL, 'boinc:authenticator-login-page') . |
|
502 | - ' <pre>' . |
|
503 | - '<account>' . "\n" . |
|
504 | - " <master_url>http://{$project_domain}/</master_url>" . "\n" . |
|
505 | - ' <authenticator>8b8496fdd26df7dc0423ecd43c09a56b</authenticator>' . "\n" . |
|
506 | - " <project_name>{$project_name}</project_name>" . "\n" . |
|
507 | - ' ...' . "\n" . |
|
508 | - '</account>' . |
|
509 | - ' </pre>' . |
|
510 | - ' </li>' . |
|
511 | - ' <li>' . bts('Select and Copy the string between <authenticator> and </authenticator> (%auth in the above example).', array('%auth' => '8b8496fdd26df7dc0423ecd43c09a56b'), NULL, 'boinc:authenticator-login-page') . '</li>' . |
|
512 | - ' <li>' . bts('Paste the string into the field below, and click OK.', array(), NULL, 'boinc:authenticator-login-page') . '</li>' . |
|
513 | - ' <li>' . bts('You will now be logged in to your account; update the email and password of your account.', array(), NULL, 'boinc:authenticator-login-page') . '</li>' . |
|
514 | - ' </ul>' . |
|
496 | + '#value' => ''. |
|
497 | + '<p>'.bts("If you have run BOINC under the account, you can still access it. Here's how:", array(), NULL, 'boinc:authenticator-login-page'). |
|
498 | + ' <ul>'. |
|
499 | + ' <li>'.bts('Go to the BOINC data directory on your computer (see !boinc_wiki for help finding this).', array('!boinc_wiki' => l(bts('BOINC documentation', array(), NULL, 'boinc:authenticator-login-page'), 'http://boinc.berkeley.edu/wiki/BOINC_Data_directory')), NULL, 'boinc:authenticator-login-page').'</li>'. |
|
500 | + ' <li>'.bts('Find your account file for this project; it will have a name like %file (where the project URL is %url).', array('%file' => "account_{$project_domain}.xml", '%url' => "http://{$project_domain}"), NULL, 'boinc:authenticator-login-page').'</li>'. |
|
501 | + ' <li>'.bts("Open the file in a text editor like Notepad. You'll see something like:", array(), NULL, 'boinc:authenticator-login-page'). |
|
502 | + ' <pre>'. |
|
503 | + '<account>'."\n". |
|
504 | + " <master_url>http://{$project_domain}/</master_url>"."\n". |
|
505 | + ' <authenticator>8b8496fdd26df7dc0423ecd43c09a56b</authenticator>'."\n". |
|
506 | + " <project_name>{$project_name}</project_name>"."\n". |
|
507 | + ' ...'."\n". |
|
508 | + '</account>'. |
|
509 | + ' </pre>'. |
|
510 | + ' </li>'. |
|
511 | + ' <li>'.bts('Select and Copy the string between <authenticator> and </authenticator> (%auth in the above example).', array('%auth' => '8b8496fdd26df7dc0423ecd43c09a56b'), NULL, 'boinc:authenticator-login-page').'</li>'. |
|
512 | + ' <li>'.bts('Paste the string into the field below, and click OK.', array(), NULL, 'boinc:authenticator-login-page').'</li>'. |
|
513 | + ' <li>'.bts('You will now be logged in to your account; update the email and password of your account.', array(), NULL, 'boinc:authenticator-login-page').'</li>'. |
|
514 | + ' </ul>'. |
|
515 | 515 | '</p>' |
516 | 516 | ); |
517 | 517 | $form['authenticator'] = array( |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | '#weight' => 1002, |
537 | 537 | ); |
538 | 538 | $form['form control tabs'] = array( |
539 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/password') . '</li>', |
|
539 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/password').'</li>', |
|
540 | 540 | '#weight' => 1003, |
541 | 541 | ); |
542 | 542 | $form['form control tabs suffix'] = array( |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | '#weight' => 1002, |
600 | 600 | ); |
601 | 601 | $form['form control tabs'] = array( |
602 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/{$uid}") . '</li>', |
|
602 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/{$uid}").'</li>', |
|
603 | 603 | '#weight' => 1003, |
604 | 604 | ); |
605 | 605 | $form['form control tabs suffix'] = array( |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | '#weight' => 1002, |
651 | 651 | ); |
652 | 652 | $form['form control tabs'] = array( |
653 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/{$uid}") . '</li>', |
|
653 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/{$uid}").'</li>', |
|
654 | 654 | '#weight' => 1003, |
655 | 655 | ); |
656 | 656 | $form['form control tabs suffix'] = array( |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | $uid = $form_state['storage']['ban_user_uid']; |
668 | 668 | $reason = $form_state['values']['reason']; |
669 | 669 | $duration = $form_state['values']['duration']; |
670 | - if ($duration) $duration = $duration * 24*60*60; |
|
670 | + if ($duration) $duration = $duration*24*60*60; |
|
671 | 671 | boincuser_moderate_user_ban($uid, $reason, $duration); |
672 | 672 | } |
673 | 673 | |
@@ -694,10 +694,10 @@ discard block |
||
694 | 694 | drupal_goto(); |
695 | 695 | } |
696 | 696 | |
697 | - drupal_set_message( bts('WARNING: You have not agreed to our terms of use. Please agree to the terms of use before continuing.', array(), NULL, 'boinc:termsofuse-form'), 'warning' ); |
|
697 | + drupal_set_message(bts('WARNING: You have not agreed to our terms of use. Please agree to the terms of use before continuing.', array(), NULL, 'boinc:termsofuse-form'), 'warning'); |
|
698 | 698 | |
699 | 699 | $form = array(); |
700 | - drupal_add_js(drupal_get_path('module', 'boincuser') . '/boincuser.js'); |
|
700 | + drupal_add_js(drupal_get_path('module', 'boincuser').'/boincuser.js'); |
|
701 | 701 | $termsofuse = variable_get('boinc_weboptions_termsofuse', ''); |
702 | 702 | |
703 | 703 | // Fieldset to hold all of the form as a container |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | |
711 | 711 | $form['termsofuse']['title1'] = array( |
712 | 712 | '#weight' => -12, |
713 | - '#value' => '<h2>' . bts( variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), array(), NULL, 'project:termsofuse-form' ) . '</h2>', |
|
713 | + '#value' => '<h2>'.bts(variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), array(), NULL, 'project:termsofuse-form').'</h2>', |
|
714 | 714 | '#prefix' => '<div id="register-title1">', |
715 | 715 | '#suffix' => '</div>', |
716 | 716 | ); |
@@ -745,12 +745,12 @@ discard block |
||
745 | 745 | '#suffix' => '</li>', |
746 | 746 | ); |
747 | 747 | $form['form control tabs'] = array( |
748 | - '#value' => '<li class="tab">' . l(bts('NO - LOGOUT', array(), NULL, 'boinc:form-cancel'), '/logout') . '</li>', |
|
748 | + '#value' => '<li class="tab">'.l(bts('NO - LOGOUT', array(), NULL, 'boinc:form-cancel'), '/logout').'</li>', |
|
749 | 749 | ); |
750 | 750 | if (module_exists('boincuser_delete')) { |
751 | - $deletelink = '/user/' . $user->uid . '/delete'; |
|
751 | + $deletelink = '/user/'.$user->uid.'/delete'; |
|
752 | 752 | $form['deleteaccount'] = array( |
753 | - '#value' => '<li class="tab">' . l(bts('NO - DELETE ACCOUNT', array(), NULL, 'boinc:form-delete-user'), $deletelink) . '</li>', |
|
753 | + '#value' => '<li class="tab">'.l(bts('NO - DELETE ACCOUNT', array(), NULL, 'boinc:form-delete-user'), $deletelink).'</li>', |
|
754 | 754 | ); |
755 | 755 | } |
756 | 756 | |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | $form['buttons']['submit']['#suffix'] = '</li>'; |
844 | 844 | $form['buttons']['submit']['#weight'] = 1002; |
845 | 845 | $form['buttons']['cancel'] = array( |
846 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/info/edit') . '</li>', |
|
846 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/info/edit').'</li>', |
|
847 | 847 | '#weight' => 1005, |
848 | 848 | ); |
849 | 849 | $form['buttons']['form control tabs suffix'] = array( |
@@ -887,7 +887,7 @@ discard block |
||
887 | 887 | |
888 | 888 | // Set new password based on previous email address and entered |
889 | 889 | // password. |
890 | - $new_passwd_hash = password_hash( md5($form_state['values']['pass'].$pem), PASSWORD_DEFAULT); |
|
890 | + $new_passwd_hash = password_hash(md5($form_state['values']['pass'].$pem), PASSWORD_DEFAULT); |
|
891 | 891 | |
892 | 892 | $boinc_user->update("email_addr='${pem}', previous_email_addr='', email_addr_change_time=0, passwd_hash='${new_passwd_hash}'"); |
893 | 893 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | require_once("../inc/util.inc"); |
34 | 34 | require_once("../inc/account_ownership.inc"); |
35 | 35 | |
36 | -if ( !function_exists('openssl_pkey_new') ) { |
|
36 | +if (!function_exists('openssl_pkey_new')) { |
|
37 | 37 | echo "WARNING: OpenSSL functions not available. Not generating account ownership keys.\n"; |
38 | 38 | exit(1); |
39 | 39 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | throw new Exception('Failed to generate account ownership keypair.'); |
74 | 74 | } |
75 | 75 | } catch (Exception $e) { |
76 | - echo 'Caught exception during account ownership key generation: ', $e->getMessage(), "\n"; |
|
76 | + echo 'Caught exception during account ownership key generation: ', $e->getMessage(), "\n"; |
|
77 | 77 | } |
78 | 78 | } else { |
79 | 79 | echo "The private and public keys already exist. Repeat the command with the 'overwrite' parameter to replace the existing ownership keys. \n"; |