芝麻web文件管理V1.00
编辑当前文件:/home/asmplong/www/ancien-site-2019/site/templates/jsn_epic_free/includes/lib/jsn_ajax.php
_setPhysicalTmplInfo(); require_once($this->_template_folder_path.DS.'includes'.DS.'lib'.DS.'jsn_utils.php'); $this->_setUtilsInstance(); $this->_setTmplInfo(); } /** * * Initialize instance of JSNUtils class */ function _setUtilsInstance() { $this->_obj_utils = JSNUtils::getInstance(); } /** * Initialize Physical template information variable * */ function _setPhysicalTmplInfo() { $template_name = explode(DS, str_replace(array('\includes\lib', '/includes/lib'), '', dirname(__FILE__))); $template_name = $template_name [count( $template_name ) - 1]; $path_base = str_replace(DS."templates".DS.$template_name.DS.'includes'.DS.'lib', "", dirname(__FILE__)); $this->_template_folder_name = $template_name; $this->_template_folder_path = $path_base . DS . 'templates' . DS . $template_name; } /** * Initialize template information variable * */ function _setTmplInfo() { $result = $this->_obj_utils->getTemplateDetails($this->_template_folder_path, $this->_template_folder_name); $this->_template_edition = $result->edition; $this->_template_version = $result->version; $this->_template_name = $result->name; $this->_template_copyright = $result->copyright; $this->_template_author = $result->author; $this->_template_author_url = $result->authorUrl; $template_name = JString::strtolower($this->_template_name); $exploded_template_name = explode('_', $template_name); $template_name = @$exploded_template_name[0].'-'.@$exploded_template_name[1]; $this->_product_info_url = 'http://www.joomlashine.com/joomla-templates/'.$template_name.'-version-check.html'; } /** * Check cache folder writable or not * */ function checkCacheFolder() { $cache_folder = JRequest::getVar('cache_folder'); $isDir = is_dir($cache_folder); $isWritable = is_writable($cache_folder); echo json_encode(array('isDir' => $isDir, 'isWritable' => $isWritable)); } /** * Check template version * */ function checkVersion() { $obj_http_request = new JSNHTTPRequests($this->_product_info_url, null, null, 'get'); $result = $obj_http_request->sendRequest(); if($result == false) { echo json_encode(array('connection' => false, 'version' => '')); } else { $stringExplode = explode("\n", $result); echo json_encode(array('connection' => true, 'version' => @$stringExplode[2])); } } /** * Check Files Integrity * */ function checkFilesIntegrity() { require_once($this->_template_folder_path.DS.'includes'.DS.'lib'.DS.'jsn_checksum.php'); $checksum = new JSNCheckSum(); $result = $checksum->compare(); if (is_array($result) && count($result)) { // Some files have been modified , added, or deleted echo json_encode(array('integrity' => 1)); } elseif (is_array($result) && !count($result)) { // No files modification found echo json_encode(array('integrity' => 0)); } else { // The checksum file is missing or empty echo json_encode(array('integrity' => 2)); } } }