Linux ip-172-31-33-47 5.4.0-1045-aws #47~18.04.1-Ubuntu SMP Tue Apr 13 15:58:14 UTC 2021 x86_64
Apache/2.4.29 (Ubuntu)
: 172.31.33.47 | : 3.143.215.114
Cant Read [ /etc/named.conf ]
7.4.20
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
stage /
phpmyadmin /
tests /
unit /
Stubs /
[ HOME SHELL ]
Name
Size
Permission
Action
DbiDummy.php
98.94
KB
-rw-r--r--
DummyResult.php
6.44
KB
-rw-r--r--
ResponseRenderer.php
5.2
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : ResponseRenderer.php
<?php /** * Fake response stub for testing purposes * * It will concatenate HTML and JSON for given calls to addHTML and addJSON * respectively, what make it easy to determine whether the output is correct in test * suite. Feel free to modify for any future test needs. */ declare(strict_types=1); namespace PhpMyAdmin\Tests\Stubs; use PhpMyAdmin\Bookmarks\BookmarkRepository; use PhpMyAdmin\Config; use PhpMyAdmin\ConfigStorage\Relation; use PhpMyAdmin\Console; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Footer; use PhpMyAdmin\Header; use PhpMyAdmin\Http\Factory\ResponseFactory; use PhpMyAdmin\Http\Response; use PhpMyAdmin\Message; use PhpMyAdmin\Template; use function is_array; use function json_encode; class ResponseRenderer extends \PhpMyAdmin\ResponseRenderer { /** * HTML data to be used in the response */ protected string $htmlString = ''; /** * An array of JSON key-value pairs * to be sent back for ajax requests * * @var mixed[] */ protected array $json = []; /** * Creates a new class instance */ public function __construct() { $this->isSuccess = true; $this->isAjax = false; $this->isDisabled = false; $GLOBALS['lang'] = 'en'; $this->template = new Template(); $this->config = Config::getInstance(); $this->config->selectedServer['pmadb'] = 'phpmyadmin'; $dummyDbi = new DbiDummy(); $dummyDbi->addSelectDb('phpmyadmin'); $dbi = new DatabaseInterface($dummyDbi); $relation = new Relation($dbi); $this->header = new Header( $this->template, new Console($relation, $this->template, new BookmarkRepository($dbi, $relation)), $this->config, ); $this->footer = new Footer($this->template, $this->config); $this->response = ResponseFactory::create()->createResponse(); } /** * Append HTML code to the response stub */ public function addHTML(string $content): void { $this->htmlString .= $content; } /** * Add JSON code to the response stub * * @param array-key|array<array-key, mixed> $json Either a key (string) or an array or key-value pairs * @param mixed|null $value Null, if passing an array in $json otherwise * it's a string value to the key */ public function addJSON(string|int|array $json, mixed $value = null): void { if (is_array($json)) { foreach ($json as $key => $value) { $this->addJSON($key, $value); } } elseif ($value instanceof Message) { $this->json[$json] = $value->getDisplay(); } else { $this->json[$json] = $value; } } /** * Return the final concatenated HTML string */ public function getHTMLResult(): string { return $this->htmlString; } /** * Return the final JSON array * * @return mixed[] */ public function getJSONResult(): array { return $this->json; } /** * Current I choose to return PhpMyAdmin\Header object directly because * our test has nothing about the Scripts and PhpMyAdmin\Header class. */ public function getHeader(): Header { return $this->header; } /** * Set the status of an ajax response, * whether it is a success or an error * * @param bool $state Whether the request was successfully processed */ public function setRequestStatus(bool $state): void { $this->isSuccess = $state; } /** * Get the status of an ajax response. */ public function hasSuccessState(): bool { return $this->isSuccess; } /** * This function is used to clear all data to this * stub after any operations. */ public function clear(): void { $this->isSuccess = true; $this->json = []; $this->htmlString = ''; } /** * Set the ajax flag to indicate whether * we are servicing an ajax request * * @param bool $isAjax Whether we are servicing an ajax request */ public function setAjax(bool $isAjax): void { $this->isAjax = $isAjax; } /** * Returns true or false depending on whether * we are servicing an ajax request */ public function isAjax(): bool { return $this->isAjax; } public function isDisabled(): bool { return $this->isDisabled; } public function getResponse(): Response { return $this->response; } public function response(): Response { if ($this->isAjax()) { $json = $this->getJSONResult(); if ($this->isSuccess) { $json['success'] = true; } else { $json['success'] = false; $json['error'] = $json['message']; unset($json['message']); } $output = (string) json_encode($json); } else { $output = $this->getHTMLResult(); } $this->response->getBody()->write($output); return $this->response; } }
Close