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:
parent
7c5a4ba731
commit
29cf4f50f1
@ -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();
|
||||
|
@ -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/>";
|
||||
|
@ -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>";
|
||||
|
@ -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});
|
||||
|
Loading…
Reference in New Issue
Block a user