* Adjust for task #5162.
This commit is contained in:
+17
-20
@@ -90,15 +90,13 @@ class misc extends control
|
||||
* @access public
|
||||
* @param string $action
|
||||
* @param string $os
|
||||
* @param string $version
|
||||
* @return void
|
||||
*/
|
||||
public function downloadClient($action = 'check', $os = '', $version = '')
|
||||
public function downloadClient($action = 'check', $os = '')
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$version = $this->post->version;
|
||||
$os = $this->post->os;
|
||||
$os = $this->post->os;
|
||||
|
||||
die(js::locate($this->createLink('misc', 'downloadClient', "action=getPackage&os=$os"), 'parent'));
|
||||
}
|
||||
@@ -144,7 +142,7 @@ class misc extends control
|
||||
|
||||
if($action == 'getPackage')
|
||||
{
|
||||
$this->view->os = $os;
|
||||
$this->view->os = $os;
|
||||
$this->view->account = $this->app->user->account;
|
||||
}
|
||||
|
||||
@@ -167,7 +165,7 @@ class misc extends control
|
||||
$account = $this->app->user->account;
|
||||
$clientDir = $this->app->getBasePath() . 'tmp/cache/client/' . "$account/";
|
||||
|
||||
$clientFile = $clientDir . 'zentaoClient.zip';
|
||||
$clientFile = $clientDir . 'zentaoclient.zip';
|
||||
$zipContent = file_get_contents($clientFile);
|
||||
if(is_dir($clientDir))
|
||||
{
|
||||
@@ -175,7 +173,7 @@ class misc extends control
|
||||
$zfile->removeDir($clientDir);
|
||||
}
|
||||
|
||||
$this->fetch('file', 'sendDownHeader', array('fileName' => 'client.zip', 'zip', $zipContent));
|
||||
$this->fetch('file', 'sendDownHeader', array('fileName' => 'zentaoclient.zip', 'zip', $zipContent));
|
||||
}
|
||||
|
||||
$this->view->action = $action;
|
||||
@@ -186,11 +184,10 @@ class misc extends control
|
||||
* Ajax get client package.
|
||||
*
|
||||
* @param string $os
|
||||
* @param string $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetClientPackage($os = '', $version = '')
|
||||
public function ajaxGetClientPackage($os = '')
|
||||
{
|
||||
set_time_limit (0);
|
||||
session_write_close();
|
||||
@@ -206,17 +203,18 @@ class misc extends control
|
||||
$tmpDir = $clientDir . "/$account/";
|
||||
if(!is_dir($tmpDir)) mkdir($tmpDir, 0755, true);
|
||||
|
||||
if($os == 'windows64') $clientName = "xuanxuan.win64.zip";
|
||||
if($os == 'windows32') $clientName = "xuanxuan.win32.zip";
|
||||
if($os == 'linux64') $clientName = "xuanxuan.linux.x64.zip";
|
||||
if($os == 'linux32') $clientName = "xuanxuan.linux.ia32.zip";
|
||||
if($os == 'mac') $clientName = "xuanxuan.mac.zip";
|
||||
if($os == 'windows64') $clientName = "zentaoclient.win64.zip";
|
||||
if($os == 'windows32') $clientName = "zentaoclient.win32.zip";
|
||||
if($os == 'linux64') $clientName = "zentaoclient.linux.x64.zip";
|
||||
if($os == 'linux32') $clientName = "zentaoclient.linux.ia32.zip";
|
||||
if($os == 'mac') $clientName = "zentaoclient.mac.zip";
|
||||
|
||||
$needCache = false;
|
||||
$version = $this->config->xuanxuan->version;
|
||||
$packageFile = $clientDir . $clientName;
|
||||
if(!file_exists($packageFile))
|
||||
{
|
||||
$url = "http://dl.pts.com/xuanxuan/";
|
||||
$url = "http://dl.cnezsoft.com/zentaoclient/$version/";
|
||||
$xxFile = $url . $clientName;
|
||||
$needCache = true;
|
||||
}
|
||||
@@ -225,7 +223,7 @@ class misc extends control
|
||||
$xxFile = $packageFile;
|
||||
}
|
||||
|
||||
$clientFile = $tmpDir . 'zentaoClient.zip';
|
||||
$clientFile = $tmpDir . 'zentaoclient.zip';
|
||||
if($xxHd = fopen($xxFile, "rb"))
|
||||
{
|
||||
if($clientHd = fopen($clientFile, "wb"))
|
||||
@@ -266,11 +264,10 @@ class misc extends control
|
||||
* Ajax set client config to client package.
|
||||
*
|
||||
* @param string $os
|
||||
* @param string $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxSetClientConfig($os = '', $version = '')
|
||||
public function ajaxSetClientConfig($os = '')
|
||||
{
|
||||
$response['result'] = 'success';
|
||||
|
||||
@@ -292,7 +289,7 @@ class misc extends control
|
||||
|
||||
define('PCLZIP_TEMPORARY_DIR', $clientDir);
|
||||
$this->app->loadClass('pclzip', true);
|
||||
$clientFile = $clientDir . 'zentaoClient.zip';
|
||||
$clientFile = $clientDir . 'zentaoclient.zip';
|
||||
$archive = new pclzip($clientFile);
|
||||
|
||||
if($os == 'mac')
|
||||
@@ -323,7 +320,7 @@ class misc extends control
|
||||
public function ajaxGetPackageSize()
|
||||
{
|
||||
$account = $this->app->user->account;
|
||||
$packageFile = $this->app->getBasePath() . 'tmp/cache/client/' . $account . '/zentaoClient.zip';
|
||||
$packageFile = $this->app->getBasePath() . 'tmp/cache/client/' . $account . '/zentaoclient.zip';
|
||||
|
||||
$size = 0;
|
||||
if(file_exists($packageFile))
|
||||
|
||||
Reference in New Issue
Block a user