$obj_updater_helper = new JSNAutoUpdaterHelper(); $template_manifest = $obj_read_xml_file->getTemplateManifestFileInformation(); $manifest_cache = $obj_utils->getTemplateManifestCache(); $manifest_cache = json_decode($manifest_cache); /* Determine front-end index path, including lang sef if available */ $frontIndexPath = JURI::root() . $obj_utils->determineFrontendIndex(); /* Form template identified_name */ $explodedName = explode('_', $template_manifest['name']); $templateIdName = 'tpl_' . $explodedName[1]; /* Get template latest version from session if possible */ $templateVersionSesId = md5('template_version_' . strtolower($template_manifest['full_name'])); $versionFromSes = $session->get($templateVersionSesId, null, 'jsntemplatesession'); if (!is_null($versionFromSes)) { $latest_version = $versionFromSes; } else { $latest_version = $obj_utils->getLatestProductVersion($templateIdName, 'template'); } if ($template_manifest['edition'] != '' && $template_manifest['edition'] != 'free') { $edition = $template_manifest['edition']; } else { $edition = 'free'; } $template_style_id = JRequest::getInt('template_style_id', 0, 'GET'); $task = JRequest::getWord('task', '', 'POST'); $login_identifier = md5('state_update_login_' . strtolower($template_manifest['full_name'])); $customer_info_identifier = md5('state_update_customer_info_' . strtolower($template_manifest['full_name'])); $authentication = false; $login = false; switch ($task) { case 'login': JRequest::checkToken() or jexit('Invalid Token');
} $manifest_cache = $obj_utils->getTemplateManifestCache(); $manifest_cache = json_decode($manifest_cache); /* Form template identified_name */ $template_name = strtolower($manifest_cache->name); $template_version_identifier = md5('template_version_' . $template_name); $customer_info_identifier = md5('state_update_customer_info_' . $template_name); $login_identifier = md5('state_update_login_' . $template_name); $version_from_session = $session->get($template_version_identifier, null, 'jsntemplatesession'); $customer_session = $session->get($customer_info_identifier, array(), 'jsntemplatesession'); $exploded_name = explode('_', strtolower($manifest_cache->name)); $identified_name = 'tpl_' . $exploded_name[1]; if (!is_null($version_from_session)) { $latest_version = $version_from_session; } else { $latest_version = $obj_utils->getLatestProductVersion($identified_name, 'template'); } $task = JRequest::getWord('task', '', 'POST'); switch ($task) { case 'download_modified_file': JRequest::checkToken() or jexit('Invalid Token'); $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');