Ejemplo n.º 1
0
 /**
  * check easy install
  * @return void
  */
 function checkEasyinstall()
 {
     $lastTime = (int) FileHandler::readFile($this->easyinstallCheckFile);
     if ($lastTime > $_SERVER['REQUEST_TIME'] - 60 * 60 * 24 * 30) {
         return;
     }
     $oAutoinstallModel = getModel('autoinstall');
     $params = array();
     $params["act"] = "getResourceapiLastupdate";
     $body = XmlGenerater::generate($params);
     $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml");
     $xml_lUpdate = new XmlParser();
     $lUpdateDoc = $xml_lUpdate->parse($buff);
     $updateDate = $lUpdateDoc->response->updatedate->body;
     if (!$updateDate) {
         $this->_markingCheckEasyinstall();
         return;
     }
     $item = $oAutoinstallModel->getLatestPackage();
     if (!$item || $item->updatedate < $updateDate) {
         $oController = getAdminController('autoinstall');
         $oController->_updateinfo();
     }
     $this->_markingCheckEasyinstall();
 }
Ejemplo n.º 2
0
 /**
  * Request data to server and returns result
  *
  * @param array $params Request data
  * @return object
  */
 function getXmlDoc(&$params)
 {
     $body = XmlGenerater::generate($params);
     $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml");
     if (!$buff) {
         return;
     }
     $xml = new XmlParser();
     $xmlDoc = $xml->parse($buff);
     return $xmlDoc;
 }
Ejemplo n.º 3
0
 /**
  * Request data to server and returns result
  *
  * @param array $params Request data
  * @return object
  */
 function getXmlDoc(&$params)
 {
     $body = XmlGenerater::generate($params);
     $request_config = array('ssl_verify_peer' => FALSE, 'ssl_verify_host' => FALSE);
     $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config);
     if (!$buff) {
         return;
     }
     $xml = new XmlParser();
     $xmlDoc = $xml->parse($buff);
     return $xmlDoc;
 }
Ejemplo n.º 4
0
 /**
  * Update easy install information
  *
  * @return void
  */
 function _updateinfo()
 {
     $oModel =& getModel('autoinstall');
     $item = $oModel->getLatestPackage();
     if ($item) {
         $params["updatedate"] = $item->updatedate;
     }
     $params["act"] = "getResourceapiUpdate";
     $body = XmlGenerater::generate($params);
     $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml");
     $xml = new XmlParser();
     $xmlDoc = $xml->parse($buff);
     $this->updateCategory($xmlDoc);
     $this->updatePackages($xmlDoc);
     $this->checkInstalled();
 }
Ejemplo n.º 5
0
 /**
  * Update easy install information
  *
  * @return void
  */
 function _updateinfo()
 {
     $oModel = getModel('autoinstall');
     $item = $oModel->getLatestPackage();
     if ($item) {
         $params["updatedate"] = $item->updatedate;
     }
     $params["act"] = "getResourceapiUpdate";
     $body = XmlGenerater::generate($params);
     $request_config = array('ssl_verify_peer' => FALSE, 'ssl_verify_host' => FALSE);
     $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config);
     $xml = new XmlParser();
     $xmlDoc = $xml->parse($buff);
     $this->updateCategory($xmlDoc);
     $this->updatePackages($xmlDoc);
     $this->checkInstalled();
     $oAdminController = getAdminController('admin');
     $output = $oAdminController->cleanFavorite();
 }
Ejemplo n.º 6
0
 /**
  * Display uninstall package
  *
  * @return Object
  */
 function dispAutoinstallAdminUninstall()
 {
     $package_srl = Context::get('package_srl');
     if (!$package_srl) {
         return $this->dispAutoinstallAdminIndex();
     }
     $oModel =& getModel('autoinstall');
     $installedPackage = $oModel->getInstalledPackage($package_srl);
     if (!$installedPackage) {
         return $this->dispAutoinstallAdminInstalledPackages();
     }
     if (!$_SESSION['ftp_password']) {
         Context::set('need_password', true);
     }
     $installedPackage = $oModel->getPackage($package_srl);
     $path = $installedPackage->path;
     $type = $oModel->getTypeFromPath($path);
     if (!$type || $type == "core") {
         return $this->stop("msg_invalid_request");
     }
     $config_file = $oModel->getConfigFilePath($type);
     if (!$config_file) {
         return $this->stop("msg_invalid_request");
     }
     $params["act"] = "getResourceapiPackages";
     $params["package_srls"] = $package_srl;
     $body = XmlGenerater::generate($params);
     $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml");
     $xml_lUpdate = new XmlParser();
     $xmlDoc = $xml_lUpdate->parse($buff);
     if ($xmlDoc && $xmlDoc->response->packagelist->item) {
         $item_list = $this->rearranges($xmlDoc->response->packagelist->item);
         $installedPackage->title = $item_list[$package_srl]->title;
         $installedPackage->type = $item_list[$package_srl]->category;
         $installedPackage->avail_remove = $item_list[$package_srl]->avail_remove;
         $installedPackage->deps = $item_list[$package_srl]->deps;
         Context::set('package', $installedPackage);
         $this->setTemplateFile('uninstall');
         Context::addJsFilter($this->module_path . 'tpl/filter', 'uninstall_package.xml');
         $security = new Security();
         $security->encodeHTML('package.');
         $this->setTemplateFile('uninstall');
     } else {
         return $this->stop('msg_connection_fail');
     }
 }