modify by xu qing

on web.pm update.php updateprocess.php
for update page to remember user's last choice

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6685 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
xq2005 2010-07-09 08:02:51 +00:00
parent 7c5a4ba731
commit 29cf4f50f1
4 changed files with 25 additions and 10 deletions

View File

@ -4,9 +4,9 @@ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
require_once "../lib/functions.php";
require_once "../lib/security.php";
require_once "jsonwrapper.php";
require_once "lib/functions.php";
require_once "lib/security.php";
require_once "security/jsonwrapper.php";
if(isset($_GET["logout"]) or isset($_POST["logout"])){
logout();

View File

@ -25,9 +25,20 @@
$StableRepository = "http://xcat.sourceforge.net/yum/xcat-core/";
}
echo "<input type=\"radio\" name= \"reporadio\" value=\"" . $DevelRepository . "\">" . $DevelRepository . "(<strong>Devel</strong>)<br/>";
echo "<input type=\"radio\" name=\"reporadio\" value=\"" . $StableRepository . "\">" . $StableRepository . "(<strong>Stable</strong>)<br/>";
if(isset($_COOKIE["xcatrepository"]))
echo "<input type='radio' ";
if (1 == $_COOKIE["xcatrepository"])
{
echo "checked='true'";
}
echo "name='reporadio' value='" . $DevelRepository . "'>" . $DevelRepository . "(<strong>Devel</strong>)<br/>";
echo "<input type='radio' ";
if (2 == $_COOKIE["xcatrepository"])
{
echo "checked='true'";
}
echo "name='reporadio' value='" . $StableRepository . "'>" . $StableRepository . "(<strong>Stable</strong>)<br/>";
if((1 != $_COOKIE["xcatrepository"]) && (2 != $_COOKIE["xcatrepository"]))
{
echo "<input type=\"radio\" checked=\"true\" name=\"reporadio\" value=\"\">Other:";
echo "<input style=\"width: 500px\" id=repositoryaddr value=\"" . $_COOKIE["xcatrepository"] ."\"<br/>";

View File

@ -57,13 +57,17 @@ if (!checkRpmPath($sRpmPath))
}
//set cookie must in front of any output
if (isset($_REQUEST["remember"]))
if (1 == $_REQUEST["remember"])
{
setcookie("xcatrepository", $sRpmPath, time() + 864000, "/");
setcookie("xcatrepository", "1", time() + 864000, "/");
}
elseif(2 == $_REQUEST["remember"])
{
setcookie("xcatrepository", "2", time() + 864000, "/");
}
else
{
setcookie("xcatrepository", "", time() - 172800, "/");
setcookie("xcatrepository", $sRpmPath, time() + 864000, "/");
}
echo "<div class=\"mContent\">It will update <b>" . $sRpmNames ."</b> from <b>" . $sRpmPath . "</b>.<ul>";

View File

@ -367,7 +367,7 @@ sub web_update {
}
#update rpm by rpm packages.
$cmd = "rpm -U " . $LocalRpmFilePath;
$cmd = "rpm -U " . $LocalRpmFilePath . " 2>&1";
$ReturnInfo = $ReturnInfo . readpipe($cmd);
}
$callback->({info=>$ReturnInfo});