@@ -35,14 +35,14 @@ |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $owner = BoincUser::lookup_id($thread->owner); |
| 38 | -if ($logged_in_user->id == $owner->id){ |
|
| 38 | +if ($logged_in_user->id == $owner->id) { |
|
| 39 | 39 | $action = get_str("action"); |
| 40 | 40 | if ($action == "set") { |
| 41 | 41 | $ret = $thread->update("status=1"); |
| 42 | 42 | } else { |
| 43 | 43 | $ret = $thread->update("status=0"); |
| 44 | 44 | } |
| 45 | - if (!$ret){ |
|
| 45 | + if (!$ret) { |
|
| 46 | 46 | error_page("Could not update the status of the thread: ".$thread->id); |
| 47 | 47 | } |
| 48 | 48 | } else { |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | // Object-caching and full-file caching is used to speed up queries |
| 24 | 24 | // for data from this page. |
| 25 | 25 | |
| 26 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
| 26 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
| 27 | 27 | |
| 28 | 28 | require_once("../inc/cache.inc"); |
| 29 | 29 | require_once("../inc/util.inc"); |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | $format = get_str("format", true); |
| 41 | 41 | |
| 42 | -if ($format=="xml"){ |
|
| 42 | +if ($format == "xml") { |
|
| 43 | 43 | // don't do caching for XML |
| 44 | 44 | xml_header(); |
| 45 | 45 | $retval = db_init_xml(); |
| 46 | 46 | if ($retval) xml_error($retval); |
| 47 | - if ($auth){ |
|
| 47 | + if ($auth) { |
|
| 48 | 48 | $user = BoincUser::lookup_auth($auth); |
| 49 | 49 | $show_hosts = true; |
| 50 | 50 | } else { |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | // The page may be presented in many different languages, |
| 59 | 59 | // so here we cache the data instead |
| 60 | 60 | // |
| 61 | - $cache_args="userid=".$id; |
|
| 61 | + $cache_args = "userid=".$id; |
|
| 62 | 62 | $cached_data = get_cached_data(USER_PAGE_TTL, $cache_args); |
| 63 | - if ($cached_data){ |
|
| 63 | + if ($cached_data) { |
|
| 64 | 64 | // We found some old but non-stale data, let's use it |
| 65 | 65 | $data = unserialize($cached_data); |
| 66 | 66 | $user = $data->user; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | BoincForumPrefs::lookup($user); |
| 78 | 78 | $user = @get_other_projects($user); |
| 79 | - $community_links = get_community_links_object($user); |
|
| 79 | + $community_links = get_community_links_object($user); |
|
| 80 | 80 | |
| 81 | 81 | $data = new StdClass; |
| 82 | 82 | $data->user = $user; |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | } else { |
| 40 | 40 | $last_mod_time = time(); |
| 41 | 41 | } |
| 42 | -$create_date = gmdate('D, d M Y H:i:s', $last_mod_time) . ' GMT'; |
|
| 42 | +$create_date = gmdate('D, d M Y H:i:s', $last_mod_time).' GMT'; |
|
| 43 | 43 | |
| 44 | 44 | header("Expires: ".gmdate('D, d M Y H:i:s', time())." GMT"); |
| 45 | 45 | header("Last-Modified: ".$create_date); |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | // Delete a user if they have no credit, results, or posts |
| 41 | 41 | // |
| 42 | -function possibly_delete_user($user){ |
|
| 43 | - if ($user->total_credit > 0.0){ |
|
| 42 | +function possibly_delete_user($user) { |
|
| 43 | + if ($user->total_credit > 0.0) { |
|
| 44 | 44 | admin_error_page("Cannot delete user: User has credit."); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | admin_error_page("Cannot delete user: User has forum posts."); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if ($user->teamid){ |
|
| 59 | + if ($user->teamid) { |
|
| 60 | 60 | user_quit_team($user); |
| 61 | 61 | } |
| 62 | 62 | delete_user($user); |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | function handle_special_user($user) { |
| 68 | 68 | global $special_user_bitfield; |
| 69 | 69 | $Nbf = sizeof($special_user_bitfield); |
| 70 | - $bits=""; |
|
| 71 | - for ($i=0; $i<$Nbf; $i++) { |
|
| 70 | + $bits = ""; |
|
| 71 | + for ($i = 0; $i < $Nbf; $i++) { |
|
| 72 | 72 | $key = "special_user_$i"; |
| 73 | 73 | if (array_key_exists($key, $_POST) && $_POST[$key]) { |
| 74 | 74 | $bits .= "1"; |
@@ -94,35 +94,35 @@ discard block |
||
| 94 | 94 | ); |
| 95 | 95 | } else { |
| 96 | 96 | if (is_numeric($dt)) { |
| 97 | - $t = $dt>0 ? time()+$dt : 0; |
|
| 97 | + $t = $dt > 0 ? time() + $dt : 0; |
|
| 98 | 98 | $q = "UPDATE forum_preferences SET banished_until=$t WHERE userid=$user->id"; |
| 99 | 99 | _mysql_query($q); |
| 100 | 100 | |
| 101 | 101 | // put a timestamp in wiki to trigger re-validation of credentials |
| 102 | 102 | |
| 103 | - if (function_exists('touch_wiki_user')){ |
|
| 103 | + if (function_exists('touch_wiki_user')) { |
|
| 104 | 104 | touch_wiki_user($user); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // Send suspension e-mail to user and administrators |
| 108 | 108 | |
| 109 | - if ($dt>0) { |
|
| 110 | - $subject = PROJECT." posting privileges suspended for ". $user->name; |
|
| 109 | + if ($dt > 0) { |
|
| 110 | + $subject = PROJECT." posting privileges suspended for ".$user->name; |
|
| 111 | 111 | $body = " |
| 112 | -Forum posting privileges for the " .PROJECT. " user \"".$user->name."\" |
|
| 113 | -have been suspended for " .time_diff($dt). " by ".$g_logged_in_user->name.". |
|
| 112 | +Forum posting privileges for the " .PROJECT." user \"".$user->name."\" |
|
| 113 | +have been suspended for " .time_diff($dt)." by ".$g_logged_in_user->name.". |
|
| 114 | 114 | The reason given was: |
| 115 | 115 | |
| 116 | 116 | $reason |
| 117 | 117 | |
| 118 | -The suspension will end at " .time_str($t)."\n"; |
|
| 118 | +The suspension will end at ".time_str($t)."\n"; |
|
| 119 | 119 | } else { |
| 120 | - $subject = PROJECT." user ". $user->name. " unsuspended"; |
|
| 120 | + $subject = PROJECT." user ".$user->name." unsuspended"; |
|
| 121 | 121 | $body = " |
| 122 | -Forum posting privileges for the " .PROJECT. " user \"".$user->name."\" |
|
| 122 | +Forum posting privileges for the " .PROJECT." user \"".$user->name."\" |
|
| 123 | 123 | have been restored by ".$g_logged_in_user->name."\n"; |
| 124 | 124 | if ($reason) { |
| 125 | - $body.="The reason given was:\n\n $reason\n"; |
|
| 125 | + $body .= "The reason given was:\n\n $reason\n"; |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -186,13 +186,13 @@ discard block |
||
| 186 | 186 | row1("Special User Status"); |
| 187 | 187 | |
| 188 | 188 | echo "<tr>\n"; |
| 189 | - for ($i=0; $i<$Nbf; $i++) { |
|
| 189 | + for ($i = 0; $i < $Nbf; $i++) { |
|
| 190 | 190 | $bit = substr($user->prefs->special_user, $i, 1); |
| 191 | 191 | echo "<tr><td><input type='checkbox'' name='special_user_".$i."' value='1'"; |
| 192 | 192 | if ($bit == 1) { |
| 193 | 193 | echo " checked='checked'"; |
| 194 | 194 | } |
| 195 | - echo ">". $special_user_bitfield[$i] ."</td></tr>\n"; |
|
| 195 | + echo ">".$special_user_bitfield[$i]."</td></tr>\n"; |
|
| 196 | 196 | } |
| 197 | 197 | echo "</tr>"; |
| 198 | 198 | |
@@ -217,10 +217,10 @@ discard block |
||
| 217 | 217 | if ($user->prefs->banished_until) { |
| 218 | 218 | $dt = $user->prefs->banished_until - time(); |
| 219 | 219 | if ($dt > 0) { |
| 220 | - $x = " Suspended until " . time_str($user->prefs->banished_until) |
|
| 221 | - ."<br/> (Expires in " . time_diff($dt) .")" ; |
|
| 220 | + $x = " Suspended until ".time_str($user->prefs->banished_until) |
|
| 221 | + ."<br/> (Expires in ".time_diff($dt).")"; |
|
| 222 | 222 | } else { |
| 223 | - $x = " last suspended " . time_str($user->prefs->banished_until); |
|
| 223 | + $x = " last suspended ".time_str($user->prefs->banished_until); |
|
| 224 | 224 | } |
| 225 | 225 | row1($x); |
| 226 | 226 | } else { |
@@ -238,11 +238,11 @@ discard block |
||
| 238 | 238 | "; |
| 239 | 239 | echo " |
| 240 | 240 | <input type='radio' name='suspend_for' value='172800'> 48 hours <br/> |
| 241 | - <input type='radio' name='suspend_for' value='",86400*7,"'> 1 week <br/> |
|
| 242 | - <input type='radio' name='suspend_for' value='",86400*14,"'> 2 weeks <br/> |
|
| 241 | + <input type='radio' name='suspend_for' value='",86400*7, "'> 1 week <br/> |
|
| 242 | + <input type='radio' name='suspend_for' value='",86400*14, "'> 2 weeks <br/> |
|
| 243 | 243 | "; |
| 244 | 244 | |
| 245 | - if ($dt>0) { |
|
| 245 | + if ($dt > 0) { |
|
| 246 | 246 | echo " |
| 247 | 247 | <input type='radio' name='suspend_for' value='-1'> <b>unsuspend</b> <br/>"; |
| 248 | 248 | } |
@@ -306,6 +306,6 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | show_manage_user_form($user); |
| 308 | 308 | |
| 309 | -$cvs_version_tracker[]= //Generated automatically - do not edit |
|
| 309 | +$cvs_version_tracker[] = //Generated automatically - do not edit |
|
| 310 | 310 | "\$Id$"; |
| 311 | 311 | ?> |
@@ -42,15 +42,15 @@ |
||
| 42 | 42 | $start_id = 0; //Set this to something else if you like |
| 43 | 43 | $forum_preferencess = _mysql_query("select * from forum_preferences where userid>$start_id order by userid"); |
| 44 | 44 | echo _mysql_error(); |
| 45 | - $i=0; |
|
| 46 | - while ($forum_preferences = _mysql_fetch_object($forum_preferencess)){ |
|
| 45 | + $i = 0; |
|
| 46 | + while ($forum_preferences = _mysql_fetch_object($forum_preferencess)) { |
|
| 47 | 47 | $i++; |
| 48 | 48 | if ($i%100 == 0) { //For every 100 forum_preferencess |
| 49 | - echo $forum_preferences->userid.". "; flush(); // print out where we are |
|
| 49 | + echo $forum_preferences->userid.". "; flush(); // print out where we are |
|
| 50 | 50 | //usleep(200000); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if ($forum_preferences->userid > $start_id){ |
|
| 53 | + if ($forum_preferences->userid > $start_id) { |
|
| 54 | 54 | fix_forum_preferences($forum_preferences); |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -26,13 +26,13 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | // Create the graph. These two calls are always required |
| 29 | - $graph = new Graph(350,250,"auto"); |
|
| 29 | + $graph = new Graph(350, 250, "auto"); |
|
| 30 | 30 | //$graph->SetScale("lin"); |
| 31 | 31 | //$graph->SetScale("textlin"); |
| 32 | 32 | $graph->SetScale("loglin"); |
| 33 | 33 | |
| 34 | 34 | // Create the linear plot |
| 35 | - $lineplot=new BarPlot($arr, $xarr); |
|
| 35 | + $lineplot = new BarPlot($arr, $xarr); |
|
| 36 | 36 | $lineplot->SetColor("blue"); |
| 37 | 37 | |
| 38 | 38 | // Add the plot to the graph |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | function show_text($xarr, $yarr) { |
| 46 | 46 | $n = sizeof($xarr); |
| 47 | - for ($i=0; $i<$n; $i++) { |
|
| 47 | + for ($i = 0; $i < $n; $i++) { |
|
| 48 | 48 | echo "<br>$xarr[$i] $yarr[$i]\n"; |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | if ($ind > $maxind) $maxind = $ind; |
| 91 | 91 | } |
| 92 | 92 | $xarr = array(); |
| 93 | - for ($i=0; $i<=$maxind; $i++) { |
|
| 93 | + for ($i = 0; $i <= $maxind; $i++) { |
|
| 94 | 94 | $xarr[$i] = $i; |
| 95 | - if (is_null($yarr[$i])) $yarr[$i]=0; |
|
| 95 | + if (is_null($yarr[$i])) $yarr[$i] = 0; |
|
| 96 | 96 | } |
| 97 | 97 | if ($show_text) { |
| 98 | 98 | show_text($xarr, $yarr); |
@@ -44,15 +44,15 @@ |
||
| 44 | 44 | $start_id = 0; //Set this to something else if you like |
| 45 | 45 | $posts = _mysql_query("select * from post where id>$start_id order by id"); |
| 46 | 46 | echo _mysql_error(); |
| 47 | - $i=0; |
|
| 48 | - while ($post = _mysql_fetch_object($posts)){ |
|
| 47 | + $i = 0; |
|
| 48 | + while ($post = _mysql_fetch_object($posts)) { |
|
| 49 | 49 | $i++; |
| 50 | 50 | if ($i%100 == 0) { //For every 100 posts |
| 51 | - echo $post->id.". "; flush(); // print out where we are |
|
| 51 | + echo $post->id.". "; flush(); // print out where we are |
|
| 52 | 52 | //usleep(200000); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - if ($post->id > $start_id){ |
|
| 55 | + if ($post->id > $start_id) { |
|
| 56 | 56 | fix_post($post); |
| 57 | 57 | } |
| 58 | 58 | } |
@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | Average credit: ".$host->expavg_credit." |
| 38 | 38 | Average update time: ".time_str($host->expavg_time)." |
| 39 | 39 | IP address: $host->last_ip_addr (same the last $host->nsame_ip_addr times) |
| 40 | - Domain name: " . $host->domain_name; |
|
| 40 | + Domain name: ".$host->domain_name; |
|
| 41 | 41 | $x = $host->timezone/3600; |
| 42 | - if ($x >= 0) $x="+$x"; |
|
| 43 | - $host_content.=" |
|
| 42 | + if ($x >= 0) $x = "+$x"; |
|
| 43 | + $host_content .= " |
|
| 44 | 44 | Local Time = UTC $x hours |
| 45 | - Number of CPUs: " . $host->p_ncpus." |
|
| 45 | + Number of CPUs: ".$host->p_ncpus." |
|
| 46 | 46 | CPU: $host->p_vendor $host->p_model |
| 47 | 47 | FP ops/sec: ".$host->p_fpops." |
| 48 | 48 | Int ops/sec: ".$host->p_iops." |
@@ -50,28 +50,28 @@ discard block |
||
| 50 | 50 | Operating System: $host->os_name $host->os_version"; |
| 51 | 51 | $x = $host->m_nbytes/(1024*1024); |
| 52 | 52 | $y = round($x, 2); |
| 53 | - $host_content.=" |
|
| 53 | + $host_content .= " |
|
| 54 | 54 | Memory: $y MB"; |
| 55 | 55 | $x = $host->m_cache/1024; |
| 56 | 56 | $y = round($x, 2); |
| 57 | - $host_content.=" |
|
| 57 | + $host_content .= " |
|
| 58 | 58 | Cache: $y KB"; |
| 59 | 59 | $x = $host->m_swap/(1024*1024); |
| 60 | 60 | $y = round($x, 2); |
| 61 | - $host_content.=" |
|
| 61 | + $host_content .= " |
|
| 62 | 62 | Swap Space: $y MB"; |
| 63 | 63 | $x = $host->d_total/(1024*1024*1024); |
| 64 | 64 | $y = round($x, 2); |
| 65 | - $host_content.=" |
|
| 65 | + $host_content .= " |
|
| 66 | 66 | Total Disk Space: $y GB"; |
| 67 | 67 | $x = $host->d_free/(1024*1024*1024); |
| 68 | 68 | $y = round($x, 2); |
| 69 | - $host_content.=" |
|
| 69 | + $host_content .= " |
|
| 70 | 70 | Free Disk Space: $y GB |
| 71 | 71 | Avg network bandwidth (upstream): $host->n_bwup bytes/sec |
| 72 | 72 | Avg network bandwidth (downstream): $host->n_bwdown bytes/sec"; |
| 73 | 73 | $x = $host->avg_turnaround/86400; |
| 74 | - $host_content.=" |
|
| 74 | + $host_content .= " |
|
| 75 | 75 | Average turnaround: ".round($x, 2)." days |
| 76 | 76 | Number of RPCs: $host->rpc_seqno |
| 77 | 77 | Last RPC: ".time_str($host->rpc_time)." |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | installation. Could you please have a look at it? |
| 89 | 89 | |
| 90 | 90 | Sincerely, |
| 91 | - The ". PROJECT." team |
|
| 91 | + The ".PROJECT." team |
|
| 92 | 92 | "; |
| 93 | 93 | $body .= " |
| 94 | 94 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | " . $host_content." |
| 97 | 97 | |
| 98 | 98 | For further information and assistance with ".PROJECT." go to $master_url"; |
| 99 | - echo nl2br($body) . "<br><br>"; |
|
| 99 | + echo nl2br($body)."<br><br>"; |
|
| 100 | 100 | return send_email($user, $subject, $body); |
| 101 | 101 | |
| 102 | 102 | } |
@@ -127,5 +127,5 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | admin_page_tail(); |
| 130 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
| 130 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
| 131 | 131 | ?> |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | "deprecated?", |
| 73 | 73 | "" |
| 74 | 74 | ); |
| 75 | - $clause = $all?"true":"deprecated = 0"; |
|
| 75 | + $clause = $all ? "true" : "deprecated = 0"; |
|
| 76 | 76 | $avs = BoincAppVersion::enum( |
| 77 | 77 | "$clause order by appid, platformid, plan_class, version_num" |
| 78 | 78 | ); |
@@ -80,20 +80,20 @@ discard block |
||
| 80 | 80 | foreach ($avs as $av) { |
| 81 | 81 | // grey out deprecated versions |
| 82 | 82 | // |
| 83 | - $f1=$f2=''; |
|
| 83 | + $f1 = $f2 = ''; |
|
| 84 | 84 | if ($av->deprecated == 1) { |
| 85 | - $f1="<font color='GREY'>"; |
|
| 86 | - $f2="</font>"; |
|
| 85 | + $f1 = "<font color='GREY'>"; |
|
| 86 | + $f2 = "</font>"; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $all_value = $all?1:0; |
|
| 89 | + $all_value = $all ? 1 : 0; |
|
| 90 | 90 | $app = $apps[$av->appid]; |
| 91 | 91 | // ignore app versions of deprecated apps by default |
| 92 | 92 | if ($all_value == 0 && $app->deprecated == 1) { |
| 93 | 93 | continue; |
| 94 | 94 | } |
| 95 | 95 | echo "<tr class=row$i><form action=manage_app_versions.php?all=$all_value#av_$av->id method=POST>\n"; |
| 96 | - $i = 1-$i; |
|
| 96 | + $i = 1 - $i; |
|
| 97 | 97 | echo "<input type=hidden name=id value=$av->id>"; |
| 98 | 98 | echo " <TD>$f1 <a id='av_$av->id' href=db_action.php?table=app_version&id=$av->id>$av->id</a> $f2</TD>\n"; |
| 99 | 99 | |
@@ -110,15 +110,15 @@ discard block |
||
| 110 | 110 | $v = $av->min_core_version; |
| 111 | 111 | echo " <TD><input type='text' size='4' name=min_core_version value='$v'></TD>\n"; |
| 112 | 112 | |
| 113 | - $v=$av->max_core_version; |
|
| 113 | + $v = $av->max_core_version; |
|
| 114 | 114 | echo " <TD><input type='text' size='4' name=max_core_version value='$v'></TD>\n"; |
| 115 | 115 | |
| 116 | - $v=''; |
|
| 117 | - if ($av->beta) $v=' CHECKED '; |
|
| 116 | + $v = ''; |
|
| 117 | + if ($av->beta) $v = ' CHECKED '; |
|
| 118 | 118 | echo " <TD> <input name=beta type='checkbox' $v></TD>\n"; |
| 119 | 119 | |
| 120 | - $v=''; |
|
| 121 | - if ($av->deprecated) $v=' CHECKED '; |
|
| 120 | + $v = ''; |
|
| 121 | + if ($av->deprecated) $v = ' CHECKED '; |
|
| 122 | 122 | echo " <TD> <input name=deprecated type='checkbox' $v></TD>\n"; |
| 123 | 123 | |
| 124 | 124 | if (!in_rops()) { |