示例#1
0
/**
 * @author    JoomlaShine.com http://www.joomlashine.com
 * @copyright Copyright (C) 2008 - 2012 JoomlaShine.com. All rights reserved.
 * @license   GNU/GPL v2 http://www.gnu.org/licenses/gpl-2.0.html
 * @version   $Id: jsn_upgrade.php 13532 2012-06-26 03:20:42Z ngocpm $
 */
// No direct access
defined('_JEXEC') or die('Restricted access');
require_once 'includes' . DS . 'jsn_defines.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_readxmlfile.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_proupgrade_helper.php';
$jsnUtils = new JSNUtils();
$jsnReadXml = new JSNReadXMLFile();
$joomlaVersion = $jsnUtils->getJoomlaVersion(true);
$templateManifest = $jsnReadXml->getTemplateManifestFileInformation();
$templateLowName = strtolower($templateManifest['full_name']);
$jsnUpgradeHelper = new JSNProUpgradeHelper($templateManifest, $joomlaVersion);
$task = JRequest::getVar('task', '');
$manualUpgrade = JRequest::getVar('manual', 0);
$autoUpgradeTried = JRequest::getVar('auto_tried', 0, 'GET');
$templateStyleId = JRequest::getInt('template_style_id', 0, 'GET');
$frontIndexPath = JURI::root() . $jsnUtils->determineFrontendIndex();
/* Session variables */
$session = JFactory::getSession();
$sessionTemp = array();
$sessionTemp['upgrader'] = md5('jsn_upgrader_' . $templateLowName);
$sessionTemp['joomla_login'] = md5('joomla_login_' . $templateLowName);
$sessionTemp['jsn_login'] = md5('jsn_login_' . $templateLowName);
$sessionTemp['multiple_edition'] = md5('multiple_edition_' . $templateLowName);
示例#2
0
     $file_name = JRequest::getCmd('modified_file_name', '', 'POST');
     if ($obj_updater_helper->downloadFile('zip', $file_name)) {
         jexit();
     } else {
         JError::raiseWarning('SOME_ERROR_CODE', JText::_('JSN_UPDATE_BACKUP_FILE_NOT_FOUND'));
     }
     break;
 case 'download_template_package':
     JRequest::checkToken() or jexit('Invalid Token');
     $post = JRequest::get('post');
     if (empty($post['package_name'])) {
         JError::raiseWarning('SOME_ERROR_CODE', JText::_('JSN_UPDATE_NOTIFICATION_FILE_NOT_FOUND'));
     } else {
         $tmp_path = JPATH_ROOT . DS . 'tmp';
         if ($type == 'auto') {
             $new_name = 'jsn_' . $exploded_name[1] . '_' . $edition . '_j' . $obj_utils->getJoomlaVersion(true) . '_' . $latest_version . '_install.zip';
             $old_name = $post['package_name'];
             $file_old_path = $tmp_path . DS . $old_name;
             $file_new_path = $tmp_path . DS . $new_name;
         } else {
             $old_name = $post['package_name'];
         }
         if (is_file($file_old_path)) {
             if ($type == 'auto') {
                 @rename($file_old_path, $file_new_path);
             }
             if ($obj_updater_helper->downloadFile('zip', $new_name, false, $tmp_path, true)) {
                 jexit();
             } else {
                 JError::raiseWarning('SOME_ERROR_CODE', JText::_('JSN_UPDATE_NOTIFICATION_FILE_NOT_FOUND'));
             }
示例#3
0
# @version $Id: jsn_installsampledata.php 14966 2012-08-11 04:19:46Z tuyetvt $
-------------------------------------------------------------------------*/
defined('_JEXEC') or die('Restricted access');
require_once 'includes' . DS . 'jsn_defines.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_backup.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_readxmlfile.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_sampledata_helper.php';
global $error;
$obj_read_xml_file = new JSNReadXMLFile();
$obj_utils = new JSNUtils();
$obj_sampledata_helper = new JSNSampleDataHelper();
$obj_sampledata_helper->setSampleDataURL();
$backup_obj = JSNBackup::getInstance();
$template_manifest = $obj_read_xml_file->getTemplateManifestFileInformation();
$joomla_version = $obj_utils->getJoomlaVersion();
$folderWritable = $obj_sampledata_helper->checkFolderPermission();
//////////////////////////////////////MAIN//////////////////////////////////////
$folderFailList = '';
if (count($folderWritable) > 0) {
    $folderFailList = '<div id="jsn-li-folder-perm-failed">' . JText::_('JSN_SAMPLE_DATA_FOLDER_PERMISSION_MES') . '<ul>';
    foreach ($folderWritable as $failed) {
        $folderFailList .= '<li>' . $failed . '</li>';
    }
    $folderFailList .= '</ul>' . JText::_('JSN_SAMPLE_DATA_FOLDER_PERMISSION_MES2') . '<div class="jsn-install-admin-navigation"><hr class="jsn-horizontal-line" />' . '<button class="action-submit" type="button" id="jsn-perm-try-again" onclick="JSNSampleData.checkFolderPermission(\'' . strtolower($template_manifest['full_name']) . '\',\'' . JURI::root() . '\');">' . JText::_('JSN_SAMPLE_DATA_FOLDER_PERMISSION_TRY_AGAIN_BUTTON') . '</button></div></div>';
}
$frontIndexPath = JURI::root() . $obj_utils->determineFrontendIndex();
$strLiveDemoLink = 'http://demo.joomlashine.com/joomla-templates/' . $template_manifest['name'] . '/index.php';
$identifier = md5('state_installation_' . strtolower($template_manifest['full_name']));
$login_identifier = md5('state_login_' . strtolower($template_manifest['full_name']));
$session = JFactory::getSession();