@@ -5,8 +5,8 @@ |
||
5 | 5 | // Hackish... but there doesn't seem to be a non-hackish way to change the |
6 | 6 | // label on the search form!? Need a custom module to call hook_form_alter()... |
7 | 7 | function global_search_solr_form_alter(&$form, &$form_state, $form_id) { |
8 | - if ($form_id == 'apachesolr_search_custom_page_search_form') { |
|
8 | + if ($form_id == 'apachesolr_search_custom_page_search_form') { |
|
9 | 9 | $form['basic']['keys']['#title'] = t('Search'); |
10 | 10 | $form['basic']['keys']['#size'] = 40; |
11 | - } |
|
11 | + } |
|
12 | 12 | } |
@@ -42,15 +42,15 @@ |
||
42 | 42 | $start_id = 0; //Set this to something else if you like |
43 | 43 | $profiles = _mysql_query("select * from profile where userid>$start_id order by userid"); |
44 | 44 | echo _mysql_error(); |
45 | - $i=0; |
|
46 | - while ($profile = _mysql_fetch_object($profiles)){ |
|
45 | + $i = 0; |
|
46 | + while ($profile = _mysql_fetch_object($profiles)) { |
|
47 | 47 | $i++; |
48 | 48 | if ($i%100 == 0) { //For every 100 profiles |
49 | - echo $profile->userid.". "; flush(); // print out where we are |
|
49 | + echo $profile->userid.". "; flush(); // print out where we are |
|
50 | 50 | //usleep(200000); |
51 | 51 | } |
52 | 52 | |
53 | - if ($profile->userid > $start_id){ |
|
53 | + if ($profile->userid > $start_id) { |
|
54 | 54 | fix_profile($profile); |
55 | 55 | } |
56 | 56 | } |
@@ -43,14 +43,15 @@ |
||
43 | 43 | $profiles = _mysql_query("select * from profile where userid>$start_id order by userid"); |
44 | 44 | echo _mysql_error(); |
45 | 45 | $i=0; |
46 | - while ($profile = _mysql_fetch_object($profiles)){ |
|
46 | + while ($profile = _mysql_fetch_object($profiles)) { |
|
47 | 47 | $i++; |
48 | - if ($i%100 == 0) { //For every 100 profiles |
|
48 | + if ($i%100 == 0) { |
|
49 | +//For every 100 profiles |
|
49 | 50 | echo $profile->userid.". "; flush(); // print out where we are |
50 | 51 | //usleep(200000); |
51 | 52 | } |
52 | 53 | |
53 | - if ($profile->userid > $start_id){ |
|
54 | + if ($profile->userid > $start_id) { |
|
54 | 55 | fix_profile($profile); |
55 | 56 | } |
56 | 57 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } else { |
68 | 68 | sort($files); |
69 | 69 | start_table(); |
70 | - table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete","Download"); |
|
70 | + table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete", "Download"); |
|
71 | 71 | foreach ($files as $f) { |
72 | 72 | $path = "$dir/$f"; |
73 | 73 | list($error, $size, $md5) = sandbox_parse_link_file($path); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $s = stat($tmp_name); |
118 | 118 | $size = $s['size']; |
119 | 119 | [$exists, $elf] = sandbox_lf_exists($user, $md5); |
120 | - if (!$exists){ |
|
120 | + if (!$exists) { |
|
121 | 121 | // move file to download dir |
122 | 122 | // |
123 | 123 | $phys_path = sandbox_physical_path($user, $md5); |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | error_page("physical file is missing"); |
151 | 151 | } |
152 | 152 | $bused = sandbox_file_in_use($user, $name); |
153 | - if ($bused){ |
|
153 | + if ($bused) { |
|
154 | 154 | $notice = "<strong>$name</strong> is being used by batch(es), you can not delete it now!<br/>"; |
155 | - } else{ |
|
155 | + } else { |
|
156 | 156 | unlink("$dir/$name"); |
157 | 157 | $notice = "<strong>$name</strong> was deleted from your sandbox<br/>"; |
158 | 158 | [$exists, $elf] = sandbox_lf_exists($user, $md5); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | if (!$action) $action = post_str('action', true); |
197 | 197 | |
198 | 198 | switch ($action) { |
199 | -case '': list_files($user,""); break; |
|
199 | +case '': list_files($user, ""); break; |
|
200 | 200 | case 'upload_file': upload_file($user); break; |
201 | 201 | case 'delete_file': delete_file($user); break; |
202 | 202 | case 'download_file': download_file($user); break; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $s = stat($tmp_name); |
118 | 118 | $size = $s['size']; |
119 | 119 | [$exists, $elf] = sandbox_lf_exists($user, $md5); |
120 | - if (!$exists){ |
|
120 | + if (!$exists) { |
|
121 | 121 | // move file to download dir |
122 | 122 | // |
123 | 123 | $phys_path = sandbox_physical_path($user, $md5); |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | error_page("physical file is missing"); |
151 | 151 | } |
152 | 152 | $bused = sandbox_file_in_use($user, $name); |
153 | - if ($bused){ |
|
153 | + if ($bused) { |
|
154 | 154 | $notice = "<strong>$name</strong> is being used by batch(es), you can not delete it now!<br/>"; |
155 | - } else{ |
|
155 | + } else { |
|
156 | 156 | unlink("$dir/$name"); |
157 | 157 | $notice = "<strong>$name</strong> was deleted from your sandbox<br/>"; |
158 | 158 | [$exists, $elf] = sandbox_lf_exists($user, $md5); |
@@ -23,15 +23,15 @@ |
||
23 | 23 | admin_page_head("Account Ownership Keys"); |
24 | 24 | |
25 | 25 | if (!file_exists($account_ownership_private_key_file_path)) { |
26 | - echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
26 | + echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
27 | 27 | } else { |
28 | - echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' exists.</p>"; |
|
28 | + echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' exists.</p>"; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | if (!file_exists($account_ownership_public_key_file_path)) { |
32 | - echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
32 | + echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
33 | 33 | } else { |
34 | - echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' exists.</p>"; |
|
34 | + echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' exists.</p>"; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | echo "<p>For more info see the related wiki page: <a href=\"https://github.com/BOINC/boinc/wiki/ProofOfOwnership\">ProofOfOwnership</a></p>"; |
@@ -23,15 +23,15 @@ |
||
23 | 23 | admin_page_head("Account Ownership Keys"); |
24 | 24 | |
25 | 25 | if (!file_exists($account_ownership_private_key_file_path)) { |
26 | - echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
26 | + echo "<p>The account ownership private key '".$account_ownership_private_key_file_name."' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
27 | 27 | } else { |
28 | - echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' exists.</p>"; |
|
28 | + echo "<p>The account ownership private key '".$account_ownership_private_key_file_name."' exists.</p>"; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | if (!file_exists($account_ownership_public_key_file_path)) { |
32 | - echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
32 | + echo "<p>The account ownership public key '".$account_ownership_public_key_file_name."' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
33 | 33 | } else { |
34 | - echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' exists.</p>"; |
|
34 | + echo "<p>The account ownership public key '".$account_ownership_public_key_file_name."' exists.</p>"; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | echo "<p>For more info see the related wiki page: <a href=\"https://github.com/BOINC/boinc/wiki/ProofOfOwnership\">ProofOfOwnership</a></p>"; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | } |
137 | 137 | } |
138 | 138 | if ($fp_total) { |
139 | - $batch->fraction_done = $fp_done / $fp_total; |
|
139 | + $batch->fraction_done = $fp_done/$fp_total; |
|
140 | 140 | } |
141 | 141 | if ($completed && $batch->state == BATCH_STATE_IN_PROGRESS) { |
142 | 142 | $batch->state = BATCH_STATE_COMPLETE; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | // get the total size of output files of a batch |
228 | 228 | // |
229 | 229 | function batch_output_file_size($batchid) { |
230 | - $batch_td_size=0; |
|
230 | + $batch_td_size = 0; |
|
231 | 231 | $wus = BoincWorkunit::enum("batch=$batchid"); |
232 | 232 | $fanout = parse_config(get_config(), "<uldl_dir_fanout>"); |
233 | 233 | $upload_dir = parse_config(get_config(), "<upload_dir>"); |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | } |
258 | 258 | |
259 | 259 | function boinc_get_wu_output_files_url($user, $wu_id) { |
260 | - $auth_str = md5($user->authenticator.$wu_id); |
|
260 | + $auth_str = md5($user->authenticator.$wu_id); |
|
261 | 261 | return "get_output.php?cmd=workunit_files&wu_id=$wu_id&auth_str=$auth_str"; |
262 | 262 | } |
263 | 263 |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | if ($user->authenticator != $auth) die('bad auth'); |
52 | 52 | } |
53 | 53 | |
54 | -function do_result_aux($result, $batch, $file_num=null) { |
|
54 | +function do_result_aux($result, $batch, $file_num = null) { |
|
55 | 55 | $phys_names = get_outfile_names($result); |
56 | 56 | $log_names = get_outfile_log_names($result); |
57 | 57 | if ($file_num !== null) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $dir_path = "submit/$batch->id/$result->name"; |
72 | 72 | system("rm -r $dir_path"); |
73 | 73 | mkdir($dir_path); |
74 | - for ($i=0; $i<count($phys_names); $i++) { |
|
74 | + for ($i = 0; $i < count($phys_names); $i++) { |
|
75 | 75 | $cmd = sprintf('ln -s %s %s/%s', |
76 | 76 | upload_path($phys_names[$i]), |
77 | 77 | $dir_path, |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | -function do_result($result_id, $auth, $file_num=null) { |
|
91 | +function do_result($result_id, $auth, $file_num = null) { |
|
92 | 92 | $result = BoincResult::lookup_id($result_id); |
93 | 93 | if (!$result) die("no result $result_id"); |
94 | 94 | $workunit = BoincWorkunit::lookup_id($result->workunitid); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | system($cmd); |
136 | 136 | } else { |
137 | 137 | mkdir(sprintf('%s/%s', $dir_path, $result->name)); |
138 | - for ($i=0; $i<count($phys_names); $i++) { |
|
138 | + for ($i = 0; $i < count($phys_names); $i++) { |
|
139 | 139 | $cmd = sprintf('ln -s %s %s/%s/%s', |
140 | 140 | upload_path($phys_names[$i]), |
141 | 141 | $dir_path, |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | credit_to_ops($credit, $ops, $unit); |
44 | 44 | |
45 | 45 | if ($bolden) { |
46 | - $lbold="[["; |
|
47 | - $rbold="]]"; |
|
46 | + $lbold = "[["; |
|
47 | + $rbold = "]]"; |
|
48 | 48 | } else { |
49 | - $lbold=""; $rbold=""; |
|
49 | + $lbold = ""; $rbold = ""; |
|
50 | 50 | } |
51 | 51 | return " $lbold$cobbs Cobblestones$rbold of computation ($ops $unit floating-point operations)"; |
52 | 52 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | // |
87 | 87 | function show_share_buttons() { |
88 | 88 | echo '<p>'; |
89 | - $current_url = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; |
|
89 | + $current_url = (empty($_SERVER['HTTPS']) ? 'http' : 'https')."://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; |
|
90 | 90 | $cert_url = urlencode($current_url); |
91 | 91 | |
92 | 92 | // Share on Facebook |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | if (DISABLE_TEAMS) error_page("Teams are disabled"); |
28 | 28 | |
29 | 29 | $border = get_str("border", true); |
30 | -if ($border=="no") { |
|
31 | - $border=0; |
|
30 | +if ($border == "no") { |
|
31 | + $border = 0; |
|
32 | 32 | } else { |
33 | - $border=8; |
|
33 | + $border = 8; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // Make sure user_id is in the URL so that share functions work |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if (!$user_id) { |
40 | 40 | $user = get_logged_in_user(); |
41 | 41 | Header(sprintf('Location: %s/cert_team.php?user_id=%d%s', |
42 | - url_base(), $user->id, $border==0?'&border=no':'' |
|
42 | + url_base(), $user->id, $border == 0 ? '&border=no' : '' |
|
43 | 43 | )); |
44 | 44 | exit; |
45 | 45 | } |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | require_once("../inc/cert.inc"); |
25 | 25 | |
26 | 26 | $border = get_str("border", true); |
27 | -if ($border=="no") { |
|
28 | - $border=0; |
|
27 | +if ($border == "no") { |
|
28 | + $border = 0; |
|
29 | 29 | } else { |
30 | - $border=8; |
|
30 | + $border = 8; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | // Make sure user_id is in the URL so that share functions work |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | if (!$user_id) { |
37 | 37 | $user = get_logged_in_user(); |
38 | 38 | Header(sprintf('Location: %s/cert1.php?user_id=%d%s', |
39 | - url_base(), $user->id, $border==0?'&border=no':'' |
|
39 | + url_base(), $user->id, $border == 0 ? '&border=no' : '' |
|
40 | 40 | )); |
41 | 41 | exit; |
42 | 42 | } |