2006-11-17 19:52:09 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-11-17 19:52:09 +00:00
|
|
|
/***********************************************************************\
|
|
|
|
* Display and Manage BOINC Application Versions
|
|
|
|
*
|
|
|
|
* This page presents a form with information about application versions.
|
|
|
|
* Some of the fields can be changed. An application version can be deleted
|
|
|
|
* by entering the word "DELETE" (all caps required) in the provided field.
|
|
|
|
* It is better to deprecate a version first than to delete it, but it is also
|
|
|
|
* good to remove old versions after they have been unused for a while,
|
|
|
|
* lest you over-fill the feeder (which results in new versions not being
|
|
|
|
* used by clients).
|
|
|
|
*
|
|
|
|
* Eric Myers <myers@spy-hill.net> - 4 June 2006
|
|
|
|
* @(#) $Id$
|
|
|
|
\***********************************************************************/
|
|
|
|
|
2008-03-18 21:22:44 +00:00
|
|
|
// TODO: rewrite this using the new DB interface
|
|
|
|
|
2006-11-17 19:52:09 +00:00
|
|
|
require_once('../inc/util_ops.inc');
|
|
|
|
|
|
|
|
db_init();
|
|
|
|
|
|
|
|
// Platform and application labels (are better than numbers)
|
|
|
|
|
|
|
|
$result = mysql_query("SELECT * FROM platform");
|
|
|
|
$Nplatform = mysql_num_rows($result);
|
|
|
|
for($i=0;$i<=$Nplatform;$i++){
|
|
|
|
$item=mysql_fetch_object($result);
|
|
|
|
$id=$item->id;
|
|
|
|
$plat_off[$id]=$item->deprecated;
|
|
|
|
$platform[$id]=$item->user_friendly_name;
|
2008-03-18 21:22:44 +00:00
|
|
|
}
|
2006-11-17 19:52:09 +00:00
|
|
|
mysql_free_result($result);
|
|
|
|
|
|
|
|
|
|
|
|
$result = mysql_query("SELECT * FROM app");
|
|
|
|
$Napp = mysql_num_rows($result);
|
|
|
|
for($i=0;$i<=$Napp;$i++){
|
|
|
|
$item=mysql_fetch_object($result);
|
|
|
|
$id=$item->id;
|
|
|
|
$app_off[$id]=$item->deprecated;
|
|
|
|
$app[$id]=$item->name;
|
2008-03-18 21:22:44 +00:00
|
|
|
}
|
2006-11-17 19:52:09 +00:00
|
|
|
mysql_free_result($result);
|
|
|
|
|
|
|
|
$commands="";
|
|
|
|
|
|
|
|
/***************************************************\
|
|
|
|
* Action: process form input for changes
|
|
|
|
\***************************************************/
|
|
|
|
|
|
|
|
if( !empty($_POST) ) {
|
|
|
|
|
|
|
|
$result = mysql_query("SELECT * FROM app_version");
|
|
|
|
$Nrow=mysql_num_rows($result);
|
|
|
|
|
|
|
|
for($j=1;$j<=$Nrow;$j++){ // test/update each row in DB
|
|
|
|
$item=mysql_fetch_object($result);
|
|
|
|
$id=$item->id;
|
|
|
|
|
|
|
|
/* Delete this entry? */
|
|
|
|
$field="delete_".$id;
|
2008-03-18 21:22:44 +00:00
|
|
|
if ($_POST[$field]=='DELETE' ) {
|
2006-11-17 19:52:09 +00:00
|
|
|
$cmd = "DELETE FROM app_version WHERE id=$id";
|
|
|
|
$commands .= "<P><pre>$cmd</pre>\n";
|
|
|
|
mysql_query($cmd);
|
|
|
|
continue; // next row, this one is gone
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Change deprecated status? */
|
|
|
|
$field="deprecated_".$id;
|
|
|
|
$new_v= ($_POST[$field]=='on') ? 1 : 0;
|
|
|
|
$old_v=$item->deprecated;
|
2008-03-18 21:22:44 +00:00
|
|
|
if ($new_v != $old_v ) {
|
2006-11-17 19:52:09 +00:00
|
|
|
$cmd = "UPDATE app_version SET deprecated=$new_v WHERE id=$id";
|
|
|
|
$commands .= "<P><pre>$cmd</pre>\n";
|
|
|
|
mysql_query($cmd);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Minimum core version limit */
|
|
|
|
$field="min_core_version_".$id;
|
|
|
|
$new_v= $_POST[$field];
|
|
|
|
$old_v=$item->min_core_version;
|
2008-03-18 21:22:44 +00:00
|
|
|
if ($new_v != $old_v ) {
|
2006-11-17 19:52:09 +00:00
|
|
|
$cmd = "UPDATE app_version SET min_core_version=$new_v WHERE id=$id";
|
|
|
|
$commands .= "<P><pre>$cmd</pre>\n";
|
|
|
|
mysql_query($cmd);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Maximum core version limit */
|
|
|
|
$field="max_core_version_".$id;
|
|
|
|
$new_v= $_POST[$field];
|
|
|
|
$old_v=$item->max_core_version;
|
|
|
|
if($new_v != $old_v ) {
|
|
|
|
$cmd = "UPDATE app_version SET max_core_version=$new_v WHERE id=$id";
|
|
|
|
$commands .= "<P><pre>$cmd</pre>\n";
|
|
|
|
mysql_query($cmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mysql_free_result($result);
|
2008-03-18 21:22:44 +00:00
|
|
|
touch("../../reread_db");
|
|
|
|
}
|
2006-11-17 19:52:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
/***************************************************\
|
|
|
|
* Display the DB contents in a form
|
|
|
|
\***************************************************/
|
|
|
|
|
|
|
|
admin_page_head("Manage Application Versions");
|
|
|
|
|
|
|
|
if($commands) echo $commands; // show the last DB commands given
|
|
|
|
|
|
|
|
$self=$_SERVER['PHP_SELF'];
|
|
|
|
echo "<form action='$self' method='POST'>\n";
|
|
|
|
|
|
|
|
|
|
|
|
// Application Version table:
|
|
|
|
|
|
|
|
start_table("align='center'");
|
|
|
|
|
|
|
|
echo "<TR><TH>ID #</TH>
|
2010-02-26 21:34:20 +00:00
|
|
|
<TH>Application</TH>
|
2006-11-17 19:52:09 +00:00
|
|
|
<TH>Version</TH>
|
|
|
|
<TH>Platform</TH>
|
2009-09-26 04:39:50 +00:00
|
|
|
<TH>Plan Class</TH>
|
2006-11-17 19:52:09 +00:00
|
|
|
<TH>minimum<br>core version</TH>
|
|
|
|
<TH>maximum<br>core version</TH>
|
|
|
|
<TH>deprecated?</TH>
|
|
|
|
<TH>DELETE?<sup>*</sup>
|
|
|
|
</TH>
|
|
|
|
</TR>\n";
|
|
|
|
|
|
|
|
$q="SELECT * FROM app_version ORDER BY appid, version_num, platformid";
|
|
|
|
$result = mysql_query($q);
|
|
|
|
$Nrow=mysql_num_rows($result);
|
|
|
|
for($j=1;$j<=$Nrow;$j++){
|
|
|
|
$item=mysql_fetch_object($result);
|
|
|
|
$id=$item->id;
|
|
|
|
|
|
|
|
// grey-out deprecated versions
|
|
|
|
$f1=$f2='';
|
|
|
|
if($item->deprecated==1) {
|
|
|
|
$f1="<font color='GREY'>";
|
|
|
|
$f2="</font>";
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "<tr> ";
|
|
|
|
echo " <TD align='center'>$f1 $id $f2</TD>\n";
|
|
|
|
|
|
|
|
$i=$item->appid;
|
|
|
|
echo " <TD align='center'>$f1 $app[$i] $f2</TD>\n";
|
|
|
|
|
|
|
|
echo " <TD align='center'>$f1 $item->version_num $f2</TD>\n";
|
|
|
|
|
|
|
|
$i=$item->platformid;
|
|
|
|
echo " <TD align='center'>$f1 $platform[$i] $f2</TD>\n";
|
|
|
|
|
2009-09-26 04:39:50 +00:00
|
|
|
echo " <td align=center>$f1 $item->plan_class $f2</td>\n";
|
2006-11-17 19:52:09 +00:00
|
|
|
|
|
|
|
$field="min_core_version_".$id;
|
|
|
|
$v=$item->min_core_version;
|
|
|
|
echo " <TD align='center'>
|
|
|
|
<input type='text' size='4' name='$field' value='$v'></TD>\n";
|
|
|
|
|
|
|
|
$field="max_core_version_".$id;
|
|
|
|
$v=$item->max_core_version;
|
|
|
|
echo " <TD align='center'>
|
|
|
|
<input type='text' size='4' name='$field' value='$v'></TD>\n";
|
|
|
|
|
|
|
|
$field="deprecated_".$id;
|
|
|
|
$v='';
|
|
|
|
if($item->deprecated) $v=' CHECKED ';
|
|
|
|
echo " <TD align='center'>
|
|
|
|
<input name='$field' type='checkbox' $v></TD>\n";
|
|
|
|
|
|
|
|
$field="delete_".$id;
|
|
|
|
echo " <TD align='center'>
|
|
|
|
<input type='text' size='6' name='$field' value=''></TD>\n";
|
|
|
|
echo "</tr> ";
|
2008-03-18 21:22:44 +00:00
|
|
|
}
|
2006-11-17 19:52:09 +00:00
|
|
|
mysql_free_result($result);
|
|
|
|
|
|
|
|
|
2009-09-26 04:39:50 +00:00
|
|
|
echo "<tr><td colspan=7><font color='RED'><sup>*</sup>
|
2008-03-18 21:22:44 +00:00
|
|
|
To delete an entry you must enter 'DELETE' in this field.
|
|
|
|
</font></td>
|
|
|
|
<td align='center' colspan=2 bgcolor='#FFFF88'>
|
|
|
|
<input type='submit' value='Update'></td>
|
|
|
|
</tr>
|
|
|
|
";
|
2006-11-17 19:52:09 +00:00
|
|
|
|
|
|
|
end_table();
|
|
|
|
|
|
|
|
|
|
|
|
echo "</form><P>\n";
|
|
|
|
admin_page_tail();
|
|
|
|
|
|
|
|
//Generated automatically - do not edit
|
|
|
|
$cvs_version_tracker[]="\$Id$";
|
|
|
|
?>
|