feat(baseline): add remaining legit files (postupdate, isis js, windwalker cli, sbtrack)
Completeness: administrator/postupdate.php + isis/js/_template.js (clean core files absent from the downloaded package), bin/windwalker (Windwalker CLI), sbtrack.php (Cadline tracking docroot PHP). All vetted malware-free. Signed-off-by: LÁZÁR Imre <imre@illusion.hu> Assisted-by: claude-code@claude-opus-4-8
This commit is contained in:
parent
64e3db16f3
commit
65ebcef76e
114
cadline/docroot/sbtrack.php
Normal file
114
cadline/docroot/sbtrack.php
Normal file
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
$cURL = isset($_GET['curl']) ? 1 : 0;
|
||||
|
||||
define('MT_RELEASE', '1.0');
|
||||
define('MT_CURL_OK', ($cURL && in_array('curl', get_loaded_extensions())));
|
||||
define('MT_TIMEOUT', 10);
|
||||
define('MT_ERR', !empty($_GET['err']));
|
||||
|
||||
if (isset($_GET['mtnotrk'])) {
|
||||
die();
|
||||
}
|
||||
|
||||
if (MT_ERR) {
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 'On');
|
||||
}
|
||||
else {
|
||||
error_reporting(0);
|
||||
}
|
||||
|
||||
if (basename(__FILE__) == 'mytracking.php') {
|
||||
die('For your safety: you should really change the name of this file');
|
||||
}
|
||||
|
||||
if (!empty($_GET['test'])) {
|
||||
die("OK: ".MT_RELEASE);
|
||||
}
|
||||
|
||||
$hop = isset($_GET['hop']) ? $_GET['hop'] : '';
|
||||
process_content(retrieve_content(calculate_url($hop)));
|
||||
exit;
|
||||
|
||||
function calculate_url($link) {
|
||||
$returnurl = '';
|
||||
if ($link == '') {
|
||||
$returnurl = 'http://trkapi.com/mytrackingok.gif';
|
||||
} else if ((preg_match("/.+/", $link))) {
|
||||
$src = array('/m/', '/r/', '/l/');
|
||||
$rpl = array('', '/', '/');
|
||||
$link = str_replace($src, $rpl, $link);
|
||||
$returnurl = 'http://trkapi.com/' . $link; // 2.0 format
|
||||
}
|
||||
return $returnurl;
|
||||
}
|
||||
|
||||
function retrieve_content($url) {
|
||||
$response = '';
|
||||
$mt_errstr = '';
|
||||
$agent = 'MyTracking/'.MT_RELEASE;
|
||||
$refr = ($_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http';
|
||||
$refr .= '://';
|
||||
$refr .= $_SERVER['HTTP_HOST'];
|
||||
$refr .= $_SERVER['REQUEST_URI'];
|
||||
if ($url != '') {
|
||||
if (MT_CURL_OK) {
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 1);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
|
||||
curl_setopt($ch, CURLOPT_REFERER, $refr);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, MT_TIMEOUT);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
if (!$response = curl_exec($ch)) {
|
||||
$mt_errstr = curl_errno($ch).' '.curl_error($ch);
|
||||
}
|
||||
curl_close($ch);
|
||||
}
|
||||
else {
|
||||
$parts = parse_url($url);
|
||||
$scheme = isset($parts['scheme']) ? $parts['scheme'] : 'http';
|
||||
$host = isset($parts['host']) ? $parts['host'] : 'trkapi.com';
|
||||
$port = isset($parts['port']) ? $parts['port'] : 80;
|
||||
$path = isset($parts['path']) ? $parts['path'] : '/';
|
||||
$query = isset($parts['query']) ? $parts['query'] : '';
|
||||
if ($fp = fsockopen ($host, $port, $errno, $errstr, MT_TIMEOUT)) {
|
||||
$agent = 'MyTracking/'.MT_RELEASE;
|
||||
fputs ($fp, "GET $path?$query HTTP/1.0\r\nHost: $host\r\nUser-Agent: $agent\r\nReferer: $refr\r\n\r\n");
|
||||
while (!feof($fp)) {
|
||||
$response .= fgets ($fp,128);
|
||||
}
|
||||
fclose ($fp);
|
||||
}
|
||||
else {
|
||||
$response = false;
|
||||
$mt_errstr = $errno.' '.$errstr;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($response === false) {
|
||||
if (MT_ERR) {
|
||||
echo $mt_errstr;
|
||||
}
|
||||
else {
|
||||
header("Location: /?mtnotrk=1");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
function process_content($pagecontent) {
|
||||
if ($pagecontent != '') {
|
||||
list($headers, $body) = explode("\r\n\r\n", $pagecontent, 2);
|
||||
$headerlines = explode("\r\n", $headers);
|
||||
foreach ($headerlines as $header) {
|
||||
if (preg_match("/^HTTP|Location:|Vary:|Content-Length:|Content-Type:/i", $header)) {
|
||||
header($header);
|
||||
}
|
||||
}
|
||||
echo $body;
|
||||
}
|
||||
}
|
||||
4
deployed/windwalker/bin/windwalker
Normal file
4
deployed/windwalker/bin/windwalker
Normal file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
include_once dirname(__DIR__) . '/libraries/windwalker/bin/windwalker.php';
|
||||
97
overrides/administrator/postupdate.php
Normal file
97
overrides/administrator/postupdate.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
*
|
||||
* @copyright Copyright (C) 2016 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
/**
|
||||
* Define the application's minimum supported PHP version as a constant so it can be referenced within the application.
|
||||
*/
|
||||
define('JOOMLA_MINIMUM_PHP', '5.3.10');
|
||||
|
||||
if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<'))
|
||||
{
|
||||
die('Your host needs to use PHP ' . JOOMLA_MINIMUM_PHP . ' or higher to run this version of Joomla!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Constant that is checked in included files to prevent direct access.
|
||||
* define() is used in the installation folder rather than "const" to not error for PHP 5.2 and lower
|
||||
*/
|
||||
define('_JEXEC', 1);
|
||||
|
||||
// Load the administrator application's path constants
|
||||
if (file_exists(__DIR__ . '/defines.php'))
|
||||
{
|
||||
include_once __DIR__ . '/defines.php';
|
||||
}
|
||||
|
||||
if (!defined('_JDEFINES'))
|
||||
{
|
||||
define('JPATH_BASE', __DIR__);
|
||||
require_once JPATH_BASE . '/includes/defines.php';
|
||||
}
|
||||
|
||||
require_once JPATH_BASE . '/includes/framework.php';
|
||||
require_once JPATH_BASE . '/includes/helper.php';
|
||||
require_once JPATH_BASE . '/includes/toolbar.php';
|
||||
|
||||
// Boot JApplicationAdministrator so the application references in the factory resolve correctly.
|
||||
JFactory::getApplication('administrator');
|
||||
|
||||
// Set the component path (un)constants
|
||||
define('JPATH_COMPONENT', JPATH_ADMINISTRATOR . '/components/com_joomlaupdate');
|
||||
define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/com_joomlaupdate');
|
||||
define('JPATH_COMPONENT_SITE', JPATH_SITE . '/components/com_joomlaupdate');
|
||||
|
||||
// Load the update component's model to run the cleanup methods
|
||||
JModelLegacy::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/models', 'JoomlaupdateModel');
|
||||
|
||||
/** @var JoomlaupdateModelDefault $model */
|
||||
$model = JModelLegacy::getInstance('default', 'JoomlaupdateModel');
|
||||
|
||||
// Make sure we got the model
|
||||
if (!($model instanceof JoomlaupdateModelDefault))
|
||||
{
|
||||
echo 'Could not load update component model, please check the logs for additional details.' . PHP_EOL;
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Load up the logger
|
||||
JLog::addLogger(
|
||||
array(
|
||||
'format' => '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}',
|
||||
'text_file' => 'joomla_update.php',
|
||||
),
|
||||
JLog::INFO,
|
||||
array('Update', 'databasequery', 'jerror')
|
||||
);
|
||||
|
||||
JLog::add('Starting manual update using postupdate', JLog::INFO, 'Update');
|
||||
|
||||
// Load the Joomla library and update component language files
|
||||
JFactory::getLanguage()->load('lib_joomla');
|
||||
JFactory::getLanguage()->load('com_joomlaupdate');
|
||||
|
||||
JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_FINALISE'), JLog::INFO, 'Update');
|
||||
|
||||
// Finalize the update
|
||||
if ($model->finaliseUpgrade() === false)
|
||||
{
|
||||
echo 'Failed to finalize the upgrade, please check the logs for additional details.' . PHP_EOL;
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_CLEANUP'), JLog::INFO, 'Update');
|
||||
|
||||
// Cleanup after the update
|
||||
$model->cleanUp();
|
||||
|
||||
JLog::add(JText::sprintf('COM_JOOMLAUPDATE_UPDATE_LOG_COMPLETE', JVERSION), JLog::INFO, 'Update');
|
||||
JLog::add('Finished manual update using postupdate', JLog::INFO, 'Update');
|
||||
|
||||
echo 'Update to ' . JVERSION . ' completed successfully.' . PHP_EOL;
|
||||
224
overrides/administrator/templates/isis/js/_template.js
Normal file
224
overrides/administrator/templates/isis/js/_template.js
Normal file
@ -0,0 +1,224 @@
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage Templates.isis
|
||||
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
* @since 3.0
|
||||
*/
|
||||
|
||||
(function($)
|
||||
{
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('*[rel=tooltip]').tooltip();
|
||||
|
||||
// Turn radios into btn-group
|
||||
$('.radio.btn-group label').addClass('btn');
|
||||
$('.btn-group label:not(.active)').click(function()
|
||||
{
|
||||
var label = $(this);
|
||||
var input = $('#' + label.attr('for'));
|
||||
|
||||
if (!input.prop('checked')) {
|
||||
label.closest('.btn-group').find('label').removeClass('active btn-success btn-danger btn-primary');
|
||||
if (input.val() == '') {
|
||||
label.addClass('active btn-primary');
|
||||
} else if (input.val() == 0) {
|
||||
label.addClass('active btn-danger');
|
||||
} else {
|
||||
label.addClass('active btn-success');
|
||||
}
|
||||
input.prop('checked', true);
|
||||
input.trigger('change');
|
||||
}
|
||||
});
|
||||
$('.btn-group input[checked=checked]').each(function()
|
||||
{
|
||||
if ($(this).val() == '') {
|
||||
$('label[for=' + $(this).attr('id') + ']').addClass('active btn-primary');
|
||||
} else if ($(this).val() == 0) {
|
||||
$('label[for=' + $(this).attr('id') + ']').addClass('active btn-danger');
|
||||
} else {
|
||||
$('label[for=' + $(this).attr('id') + ']').addClass('active btn-success');
|
||||
}
|
||||
});
|
||||
// add color classes to chosen field based on value
|
||||
$('select[class^="chzn-color"], select[class*=" chzn-color"]').on('liszt:ready', function(){
|
||||
var select = $(this);
|
||||
var cls = this.className.replace(/^.(chzn-color[a-z0-9-_]*)$.*/, '\1');
|
||||
var container = select.next('.chzn-container').find('.chzn-single');
|
||||
container.addClass(cls).attr('rel', 'value_' + select.val());
|
||||
select.on('change click', function()
|
||||
{
|
||||
container.attr('rel', 'value_' + select.val());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* USED IN: All views with toolbar and sticky bar enabled
|
||||
*/
|
||||
var navTop;
|
||||
var isFixed = false;
|
||||
|
||||
if (window.isisStickyToolbar == 1) {
|
||||
processScrollInit();
|
||||
processScroll();
|
||||
|
||||
$(window).on('resize', processScrollInit);
|
||||
$(window).on('scroll', processScroll);
|
||||
}
|
||||
|
||||
function processScrollInit() {
|
||||
if ($('.subhead').length) {
|
||||
navTop = $('.subhead').length && $('.subhead').offset().top - window.isisOffsetTop;
|
||||
|
||||
// Fix the container top
|
||||
$(".container-main").css("top", $('.subhead').height() + $('nav.navbar').height());
|
||||
|
||||
// Only apply the scrollspy when the toolbar is not collapsed
|
||||
if (document.body.clientWidth > 480) {
|
||||
$('.subhead-collapse').height($('.subhead').height());
|
||||
$('.subhead').scrollspy({offset: {top: $('.subhead').offset().top - $('nav.navbar').height()}});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function processScroll() {
|
||||
if ($('.subhead').length) {
|
||||
var scrollTop = $(window).scrollTop();
|
||||
if (scrollTop >= navTop && !isFixed) {
|
||||
isFixed = true;
|
||||
$('.subhead').addClass('subhead-fixed');
|
||||
|
||||
// Fix the container top
|
||||
$(".container-main").css("top", $('.subhead').height() + $('nav.navbar').height());
|
||||
} else if (scrollTop <= navTop && isFixed) {
|
||||
isFixed = false;
|
||||
$('.subhead').removeClass('subhead-fixed');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* USED IN: All list views to hide/show the sidebar
|
||||
*/
|
||||
window.toggleSidebar = function(force)
|
||||
{
|
||||
var context = 'jsidebar';
|
||||
|
||||
var $sidebar = $('#j-sidebar-container'),
|
||||
$main = $('#j-main-container'),
|
||||
$message = $('#system-message-container'),
|
||||
$debug = $('#system-debug'),
|
||||
$toggleSidebarIcon = $('#j-toggle-sidebar-icon'),
|
||||
$toggleButtonWrapper = $('#j-toggle-button-wrapper'),
|
||||
$toggleButton = $('#j-toggle-sidebar-button'),
|
||||
$sidebarToggle = $('#j-toggle-sidebar');
|
||||
|
||||
var openIcon = 'icon-arrow-left-2',
|
||||
closedIcon = 'icon-arrow-right-2';
|
||||
|
||||
var $visible = $sidebarToggle.is(":visible");
|
||||
|
||||
if (jQuery(document.querySelector("html")).attr('dir') == 'rtl')
|
||||
{
|
||||
openIcon = 'icon-arrow-right-2';
|
||||
closedIcon = 'icon-arrow-left-2';
|
||||
}
|
||||
|
||||
var isComponent = $('body').hasClass('component');
|
||||
|
||||
$sidebar.removeClass('span2').addClass('j-sidebar-container');
|
||||
$message.addClass('j-toggle-main');
|
||||
$main.addClass('j-toggle-main');
|
||||
if (!isComponent) {
|
||||
$debug.addClass('j-toggle-main');
|
||||
}
|
||||
|
||||
var mainHeight = $main.outerHeight()+30,
|
||||
sidebarHeight = $sidebar.outerHeight(),
|
||||
bodyWidth = $('body').outerWidth(),
|
||||
sidebarWidth = $sidebar.outerWidth(),
|
||||
contentWidth = $('#content').outerWidth(),
|
||||
contentWidthRelative = contentWidth / bodyWidth * 100,
|
||||
mainWidthRelative = (contentWidth - sidebarWidth) / bodyWidth * 100;
|
||||
|
||||
if (force)
|
||||
{
|
||||
// Load the value from localStorage
|
||||
if (typeof(Storage) !== "undefined")
|
||||
{
|
||||
$visible = localStorage.getItem(context);
|
||||
}
|
||||
|
||||
// Need to convert the value to a boolean
|
||||
$visible = ($visible == 'true');
|
||||
}
|
||||
else
|
||||
{
|
||||
$message.addClass('j-toggle-transition');
|
||||
$sidebar.addClass('j-toggle-transition');
|
||||
$toggleButtonWrapper.addClass('j-toggle-transition');
|
||||
$main.addClass('j-toggle-transition');
|
||||
if (!isComponent) {
|
||||
$debug.addClass('j-toggle-transition');
|
||||
}
|
||||
}
|
||||
|
||||
if ($visible)
|
||||
{
|
||||
$sidebarToggle.hide();
|
||||
$sidebar.removeClass('j-sidebar-visible').addClass('j-sidebar-hidden');
|
||||
$toggleButtonWrapper.removeClass('j-toggle-visible').addClass('j-toggle-hidden');
|
||||
$toggleSidebarIcon.removeClass('j-toggle-visible').addClass('j-toggle-hidden');
|
||||
$message.removeClass('span10').addClass('span12');
|
||||
$main.removeClass('span10').addClass('span12 expanded');
|
||||
$toggleSidebarIcon.removeClass(openIcon).addClass(closedIcon);
|
||||
$toggleButton.attr( 'data-original-title', Joomla.JText._('JTOGGLE_SHOW_SIDEBAR') );
|
||||
$sidebar.attr('aria-hidden', true);
|
||||
$sidebar.find('a').attr('tabindex', '-1');
|
||||
$sidebar.find(':input').attr('tabindex', '-1');
|
||||
|
||||
if (!isComponent) {
|
||||
$debug.css( 'width', contentWidthRelative + '%' );
|
||||
}
|
||||
|
||||
if (typeof(Storage) !== "undefined")
|
||||
{
|
||||
// Set the last selection in localStorage
|
||||
localStorage.setItem(context, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sidebarToggle.show();
|
||||
$sidebar.removeClass('j-sidebar-hidden').addClass('j-sidebar-visible');
|
||||
$toggleButtonWrapper.removeClass('j-toggle-hidden').addClass('j-toggle-visible');
|
||||
$toggleSidebarIcon.removeClass('j-toggle-hidden').addClass('j-toggle-visible');
|
||||
$message.removeClass('span12').addClass('span10');
|
||||
$main.removeClass('span12 expanded').addClass('span10');
|
||||
$toggleSidebarIcon.removeClass(closedIcon).addClass(openIcon);
|
||||
$toggleButton.attr( 'data-original-title', Joomla.JText._('JTOGGLE_HIDE_SIDEBAR') );
|
||||
$sidebar.removeAttr('aria-hidden');
|
||||
$sidebar.find('a').removeAttr('tabindex');
|
||||
$sidebar.find(':input').removeAttr('tabindex');
|
||||
|
||||
if (!isComponent && bodyWidth > 768 && mainHeight < sidebarHeight)
|
||||
{
|
||||
$debug.css( 'width', mainWidthRelative + '%' );
|
||||
}
|
||||
else if (!isComponent)
|
||||
{
|
||||
$debug.css( 'width', contentWidthRelative + '%' );
|
||||
}
|
||||
|
||||
if (typeof(Storage) !== "undefined")
|
||||
{
|
||||
// Set the last selection in localStorage
|
||||
localStorage.setItem( context, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
Loading…
Reference in New Issue
Block a user