Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.2
Cant Read [ /etc/named.conf ]
8.1.31
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
/
usr /
share /
phpmyadmin /
libraries /
classes /
[ HOME SHELL ]
Name
Size
Permission
Action
Charsets
[ DIR ]
drwxr-xr-x
Command
[ DIR ]
drwxr-xr-x
Config
[ DIR ]
drwxr-xr-x
Controllers
[ DIR ]
drwxr-xr-x
Database
[ DIR ]
drwxr-xr-x
Dbal
[ DIR ]
drwxr-xr-x
Display
[ DIR ]
drwxr-xr-x
Engines
[ DIR ]
drwxr-xr-x
Exceptions
[ DIR ]
drwxr-xr-x
Export
[ DIR ]
drwxr-xr-x
Gis
[ DIR ]
drwxr-xr-x
Html
[ DIR ]
drwxr-xr-x
Import
[ DIR ]
drwxr-xr-x
Navigation
[ DIR ]
drwxr-xr-x
Plugins
[ DIR ]
drwxr-xr-x
Properties
[ DIR ]
drwxr-xr-x
Providers
[ DIR ]
drwxr-xr-x
Query
[ DIR ]
drwxr-xr-x
Server
[ DIR ]
drwxr-xr-x
Setup
[ DIR ]
drwxr-xr-x
Table
[ DIR ]
drwxr-xr-x
Twig
[ DIR ]
drwxr-xr-x
Utils
[ DIR ]
drwxr-xr-x
Advisor.php
12.22
KB
-rw-r--r--
Bookmark.php
10.69
KB
-rw-r--r--
BrowseForeigners.php
10.82
KB
-rw-r--r--
Charsets.php
7.1
KB
-rw-r--r--
CheckUserPrivileges.php
11.94
KB
-rw-r--r--
Config.php
45.37
KB
-rw-r--r--
Console.php
3.38
KB
-rw-r--r--
Core.php
42.33
KB
-rw-r--r--
CreateAddField.php
17.57
KB
-rw-r--r--
DatabaseInterface.php
75
KB
-rw-r--r--
DbTableExists.php
3.21
KB
-rw-r--r--
Encoding.php
8.51
KB
-rw-r--r--
Error.php
13.97
KB
-rw-r--r--
ErrorHandler.php
17.15
KB
-rw-r--r--
ErrorReport.php
9.14
KB
-rw-r--r--
Export.php
46.24
KB
-rw-r--r--
File.php
21.28
KB
-rw-r--r--
FileListing.php
2.85
KB
-rw-r--r--
Font.php
5.58
KB
-rw-r--r--
Footer.php
10.54
KB
-rw-r--r--
Git.php
17.95
KB
-rw-r--r--
Header.php
21.45
KB
-rw-r--r--
Import.php
57.46
KB
-rw-r--r--
Index.php
15.07
KB
-rw-r--r--
IndexColumn.php
4.23
KB
-rw-r--r--
InsertEdit.php
130.18
KB
-rw-r--r--
InternalRelations.php
17.31
KB
-rw-r--r--
IpAllowDeny.php
9.76
KB
-rw-r--r--
Language.php
4.46
KB
-rw-r--r--
LanguageManager.php
23.96
KB
-rw-r--r--
Linter.php
5.25
KB
-rw-r--r--
ListAbstract.php
1.77
KB
-rw-r--r--
ListDatabase.php
4.3
KB
-rw-r--r--
Logging.php
2.72
KB
-rw-r--r--
Menu.php
21.3
KB
-rw-r--r--
Message.php
19.09
KB
-rw-r--r--
Mime.php
916
B
-rw-r--r--
Normalization.php
41.48
KB
-rw-r--r--
OpenDocument.php
8.42
KB
-rw-r--r--
Operations.php
37.84
KB
-rw-r--r--
OutputBuffering.php
3.98
KB
-rw-r--r--
ParseAnalyze.php
2.37
KB
-rw-r--r--
Partition.php
7.17
KB
-rw-r--r--
Pdf.php
4.34
KB
-rw-r--r--
Plugins.php
25.18
KB
-rw-r--r--
Profiling.php
2.26
KB
-rw-r--r--
RecentFavoriteTable.php
12.01
KB
-rw-r--r--
Relation.php
77.39
KB
-rw-r--r--
RelationCleanup.php
14.7
KB
-rw-r--r--
Replication.php
4.73
KB
-rw-r--r--
ReplicationGui.php
21.52
KB
-rw-r--r--
ReplicationInfo.php
4.83
KB
-rw-r--r--
Response.php
16.47
KB
-rw-r--r--
Routing.php
5.71
KB
-rw-r--r--
Sanitize.php
12.13
KB
-rw-r--r--
SavedSearches.php
11.93
KB
-rw-r--r--
Scripts.php
3.64
KB
-rw-r--r--
Session.php
8.01
KB
-rw-r--r--
Sql.php
66.67
KB
-rw-r--r--
SqlQueryForm.php
7.12
KB
-rw-r--r--
StorageEngine.php
12.53
KB
-rw-r--r--
SubPartition.php
3.32
KB
-rw-r--r--
SystemDatabase.php
3.66
KB
-rw-r--r--
Table.php
95.67
KB
-rw-r--r--
TablePartitionDefinition.php
6.51
KB
-rw-r--r--
Template.php
3.87
KB
-rw-r--r--
Theme.php
8.76
KB
-rw-r--r--
ThemeManager.php
9.58
KB
-rw-r--r--
Tracker.php
29.78
KB
-rw-r--r--
Tracking.php
37.25
KB
-rw-r--r--
Transformations.php
16.29
KB
-rw-r--r--
TwoFactor.php
6.8
KB
-rw-r--r--
Types.php
25.2
KB
-rw-r--r--
Url.php
8.76
KB
-rw-r--r--
UserPassword.php
7.11
KB
-rw-r--r--
UserPreferences.php
8.45
KB
-rw-r--r--
Util.php
102.31
KB
-rw-r--r--
Version.php
533
B
-rw-r--r--
VersionInformation.php
7.15
KB
-rw-r--r--
ZipExtension.php
10.76
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : Menu.php
<?php /** * Generates and renders the top menu */ declare(strict_types=1); namespace PhpMyAdmin; use PhpMyAdmin\Query\Utilities; use PhpMyAdmin\Utils\SessionCache; use function array_key_exists; use function count; use function in_array; use function mb_strpos; use function mb_strstr; use function mb_substr; use function md5; use function preg_replace; use function strlen; use function substr; /** * Class for generating the top menu */ class Menu { /** * Database name * * @access private * @var string */ private $db; /** * Table name * * @access private * @var string */ private $table; /** @var Relation */ private $relation; /** @var Template */ private $template; /** * Creates a new instance of Menu * * @param string $db Database name * @param string $table Table name */ public function __construct($db, $table) { global $dbi; $this->db = $db; $this->table = $table; $this->relation = new Relation($dbi); $this->template = new Template(); } /** * Returns the menu and the breadcrumbs as a string * * @return string */ public function getDisplay() { $retval = $this->getBreadcrumbs(); $retval .= $this->getMenu(); return $retval; } /** * Returns hash for the menu and the breadcrumbs * * @return string */ public function getHash() { return substr( md5($this->getMenu() . $this->getBreadcrumbs()), 0, 8 ); } /** * Returns the menu as HTML * * @return string HTML formatted menubar */ private function getMenu(): string { $url_params = []; $hasDbArg = strlen($this->db) > 0; // The URL will not work if the table is defined without a database if (strlen((string) $this->table) > 0 && $hasDbArg) { $tabs = $this->getTableTabs(); $url_params['db'] = $this->db; $url_params['table'] = $this->table; $level = 'table'; } elseif ($hasDbArg) { $tabs = $this->getDbTabs(); $url_params['db'] = $this->db; $level = 'db'; } else { $tabs = $this->getServerTabs(); $level = 'server'; } $allowedTabs = $this->getAllowedTabs($level); foreach ($tabs as $key => $value) { if (array_key_exists($key, $allowedTabs)) { continue; } unset($tabs[$key]); } return $this->template->render('top_menu', [ 'tabs' => $tabs, 'url_params' => $url_params, ]); } /** * Returns a list of allowed tabs for the current user for the given level * * @param string $level 'server', 'db' or 'table' level * * @return array list of allowed tabs */ private function getAllowedTabs($level) { /** @var DatabaseInterface $dbi */ global $dbi; $cache_key = 'menu-levels-' . $level; if (SessionCache::has($cache_key)) { return SessionCache::get($cache_key); } $allowedTabs = Util::getMenuTabList($level); $cfgRelation = $this->relation->getRelationsParam(); if ($cfgRelation['menuswork']) { $groupTable = Util::backquote($cfgRelation['db']) . '.' . Util::backquote($cfgRelation['usergroups']); $userTable = Util::backquote($cfgRelation['db']) . '.' . Util::backquote($cfgRelation['users']); $sql_query = 'SELECT `tab` FROM ' . $groupTable . " WHERE `allowed` = 'N'" . " AND `tab` LIKE '" . $level . "%'" . ' AND `usergroup` = (SELECT usergroup FROM ' . $userTable . " WHERE `username` = '" . $dbi->escapeString($GLOBALS['cfg']['Server']['user']) . "')"; $result = $this->relation->queryAsControlUser($sql_query, false); if ($result) { while ($row = $dbi->fetchAssoc($result)) { $tabName = mb_substr( $row['tab'], mb_strpos($row['tab'], '_') + 1 ); unset($allowedTabs[$tabName]); } } } SessionCache::set($cache_key, $allowedTabs); return $allowedTabs; } /** * Returns the breadcrumbs as HTML * * @return string HTML formatted breadcrumbs */ private function getBreadcrumbs(): string { global $cfg, $dbi; $server = []; $database = []; $table = []; if (empty($cfg['Server']['host'])) { $cfg['Server']['host'] = ''; } $server['name'] = ! empty($cfg['Server']['verbose']) ? $cfg['Server']['verbose'] : $cfg['Server']['host']; $server['name'] .= empty($cfg['Server']['port']) ? '' : ':' . $cfg['Server']['port']; $server['url'] = Util::getUrlForOption( $cfg['DefaultTabServer'], 'server' ) ?? '/'; if (strlen($this->db) > 0) { $database['name'] = $this->db; $database['url'] = Util::getUrlForOption( $cfg['DefaultTabDatabase'], 'database' ) ?? '/'; if (strlen((string) $this->table) > 0) { $table['name'] = $this->table; $table['url'] = Util::getUrlForOption( $cfg['DefaultTabTable'], 'table' ) ?? '/'; /** @var Table $tableObj */ $tableObj = $dbi->getTable($this->db, $this->table); $table['is_view'] = $tableObj->isView(); $table['comment'] = ''; if (! $table['is_view']) { $table['comment'] = $tableObj->getComment(); } if (mb_strstr($table['comment'], '; InnoDB free')) { $table['comment'] = preg_replace( '@; InnoDB free:.*?$@', '', $table['comment'] ); } } else { // no table selected, display database comment if present $cfgRelation = $this->relation->getRelationsParam(); // Get additional information about tables for tooltip is done // in Util::getDbInfo() only once if ($cfgRelation['commwork']) { $database['comment'] = $this->relation->getDbComment($this->db); } } } return $this->template->render('menu/breadcrumbs', [ 'server' => $server, 'database' => $database, 'table' => $table, ]); } /** * Returns the table tabs as an array * * @return array Data for generating table tabs */ private function getTableTabs() { /** @var DatabaseInterface $dbi */ global $route, $dbi; $isSystemSchema = Utilities::isSystemSchema($this->db); $tbl_is_view = $dbi->getTable($this->db, $this->table) ->isView(); $updatable_view = false; if ($tbl_is_view) { $updatable_view = $dbi->getTable($this->db, $this->table) ->isUpdatableView(); } $is_superuser = $dbi->isSuperUser(); $isCreateOrGrantUser = $dbi->isGrantUser() || $dbi->isCreateUser(); $tabs = []; $tabs['browse']['icon'] = 'b_browse'; $tabs['browse']['text'] = __('Browse'); $tabs['browse']['route'] = '/sql'; $tabs['browse']['args']['pos'] = 0; $tabs['browse']['active'] = $route === '/sql'; $tabs['structure']['icon'] = 'b_props'; $tabs['structure']['route'] = '/table/structure'; $tabs['structure']['text'] = __('Structure'); $tabs['structure']['active'] = in_array($route, [ '/table/relation', '/table/structure', ]); $tabs['sql']['icon'] = 'b_sql'; $tabs['sql']['route'] = '/table/sql'; $tabs['sql']['text'] = __('SQL'); $tabs['sql']['active'] = $route === '/table/sql'; $tabs['search']['icon'] = 'b_search'; $tabs['search']['text'] = __('Search'); $tabs['search']['route'] = '/table/search'; $tabs['search']['active'] = in_array($route, [ '/table/find-replace', '/table/search', '/table/zoom-search', ]); if (! $isSystemSchema && (! $tbl_is_view || $updatable_view)) { $tabs['insert']['icon'] = 'b_insrow'; $tabs['insert']['route'] = '/table/change'; $tabs['insert']['text'] = __('Insert'); $tabs['insert']['active'] = $route === '/table/change'; } $tabs['export']['icon'] = 'b_tblexport'; $tabs['export']['route'] = '/table/export'; $tabs['export']['args']['single_table'] = 'true'; $tabs['export']['text'] = __('Export'); $tabs['export']['active'] = $route === '/table/export'; /** * Don't display "Import" for views and information_schema */ if (! $tbl_is_view && ! $isSystemSchema) { $tabs['import']['icon'] = 'b_tblimport'; $tabs['import']['route'] = '/table/import'; $tabs['import']['text'] = __('Import'); $tabs['import']['active'] = $route === '/table/import'; } if (($is_superuser || $isCreateOrGrantUser) && ! $isSystemSchema ) { $tabs['privileges']['route'] = '/server/privileges'; $tabs['privileges']['args']['checkprivsdb'] = $this->db; $tabs['privileges']['args']['checkprivstable'] = $this->table; // stay on table view $tabs['privileges']['args']['viewing_mode'] = 'table'; $tabs['privileges']['text'] = __('Privileges'); $tabs['privileges']['icon'] = 's_rights'; $tabs['privileges']['active'] = $route === '/server/privileges'; } /** * Don't display "Operations" for views and information_schema */ if (! $tbl_is_view && ! $isSystemSchema) { $tabs['operation']['icon'] = 'b_tblops'; $tabs['operation']['route'] = '/table/operations'; $tabs['operation']['text'] = __('Operations'); $tabs['operation']['active'] = $route === '/table/operations'; } /** * Views support a limited number of operations */ if ($tbl_is_view && ! $isSystemSchema) { $tabs['operation']['icon'] = 'b_tblops'; $tabs['operation']['route'] = '/view/operations'; $tabs['operation']['text'] = __('Operations'); $tabs['operation']['active'] = $route === '/view/operations'; } if (Tracker::isActive() && ! $isSystemSchema) { $tabs['tracking']['icon'] = 'eye'; $tabs['tracking']['text'] = __('Tracking'); $tabs['tracking']['route'] = '/table/tracking'; $tabs['tracking']['active'] = $route === '/table/tracking'; } if (! $isSystemSchema && Util::currentUserHasPrivilege( 'TRIGGER', $this->db, $this->table ) && ! $tbl_is_view ) { $tabs['triggers']['route'] = '/table/triggers'; $tabs['triggers']['text'] = __('Triggers'); $tabs['triggers']['icon'] = 'b_triggers'; $tabs['triggers']['active'] = $route === '/table/triggers'; } return $tabs; } /** * Returns the db tabs as an array * * @return array Data for generating db tabs */ private function getDbTabs() { /** @var DatabaseInterface $dbi */ global $route, $dbi; $isSystemSchema = Utilities::isSystemSchema($this->db); $num_tables = count($dbi->getTables($this->db)); $is_superuser = $dbi->isSuperUser(); $isCreateOrGrantUser = $dbi->isGrantUser() || $dbi->isCreateUser(); /** * Gets the relation settings */ $cfgRelation = $this->relation->getRelationsParam(); $tabs = []; $tabs['structure']['route'] = '/database/structure'; $tabs['structure']['text'] = __('Structure'); $tabs['structure']['icon'] = 'b_props'; $tabs['structure']['active'] = $route === '/database/structure'; $tabs['sql']['route'] = '/database/sql'; $tabs['sql']['text'] = __('SQL'); $tabs['sql']['icon'] = 'b_sql'; $tabs['sql']['active'] = $route === '/database/sql'; $tabs['search']['text'] = __('Search'); $tabs['search']['icon'] = 'b_search'; $tabs['search']['route'] = '/database/search'; $tabs['search']['active'] = $route === '/database/search'; if ($num_tables == 0) { $tabs['search']['warning'] = __('Database seems to be empty!'); } $tabs['query']['text'] = __('Query'); $tabs['query']['icon'] = 's_db'; $tabs['query']['route'] = '/database/multi-table-query'; $tabs['query']['active'] = $route === '/database/multi-table-query' || $route === '/database/qbe'; if ($num_tables == 0) { $tabs['query']['warning'] = __('Database seems to be empty!'); } $tabs['export']['text'] = __('Export'); $tabs['export']['icon'] = 'b_export'; $tabs['export']['route'] = '/database/export'; $tabs['export']['active'] = $route === '/database/export'; if ($num_tables == 0) { $tabs['export']['warning'] = __('Database seems to be empty!'); } if (! $isSystemSchema) { $tabs['import']['route'] = '/database/import'; $tabs['import']['text'] = __('Import'); $tabs['import']['icon'] = 'b_import'; $tabs['import']['active'] = $route === '/database/import'; $tabs['operation']['route'] = '/database/operations'; $tabs['operation']['text'] = __('Operations'); $tabs['operation']['icon'] = 'b_tblops'; $tabs['operation']['active'] = $route === '/database/operations'; if ($is_superuser || $isCreateOrGrantUser) { $tabs['privileges']['route'] = '/server/privileges'; $tabs['privileges']['args']['checkprivsdb'] = $this->db; // stay on database view $tabs['privileges']['args']['viewing_mode'] = 'db'; $tabs['privileges']['text'] = __('Privileges'); $tabs['privileges']['icon'] = 's_rights'; $tabs['privileges']['active'] = $route === '/server/privileges'; } $tabs['routines']['route'] = '/database/routines'; $tabs['routines']['text'] = __('Routines'); $tabs['routines']['icon'] = 'b_routines'; $tabs['routines']['active'] = $route === '/database/routines'; if (Util::currentUserHasPrivilege('EVENT', $this->db)) { $tabs['events']['route'] = '/database/events'; $tabs['events']['text'] = __('Events'); $tabs['events']['icon'] = 'b_events'; $tabs['events']['active'] = $route === '/database/events'; } if (Util::currentUserHasPrivilege('TRIGGER', $this->db)) { $tabs['triggers']['route'] = '/database/triggers'; $tabs['triggers']['text'] = __('Triggers'); $tabs['triggers']['icon'] = 'b_triggers'; $tabs['triggers']['active'] = $route === '/database/triggers'; } } if (Tracker::isActive() && ! $isSystemSchema) { $tabs['tracking']['text'] = __('Tracking'); $tabs['tracking']['icon'] = 'eye'; $tabs['tracking']['route'] = '/database/tracking'; $tabs['tracking']['active'] = $route === '/database/tracking'; } if (! $isSystemSchema) { $tabs['designer']['text'] = __('Designer'); $tabs['designer']['icon'] = 'b_relations'; $tabs['designer']['route'] = '/database/designer'; $tabs['designer']['active'] = $route === '/database/designer'; } if (! $isSystemSchema && $cfgRelation['centralcolumnswork'] ) { $tabs['central_columns']['text'] = __('Central columns'); $tabs['central_columns']['icon'] = 'centralColumns'; $tabs['central_columns']['route'] = '/database/central-columns'; $tabs['central_columns']['active'] = $route === '/database/central-columns'; } return $tabs; } /** * Returns the server tabs as an array * * @return array Data for generating server tabs */ private function getServerTabs() { /** @var DatabaseInterface $dbi */ global $route, $dbi; $is_superuser = $dbi->isSuperUser(); $isCreateOrGrantUser = $dbi->isGrantUser() || $dbi->isCreateUser(); if (SessionCache::has('binary_logs')) { $binary_logs = SessionCache::get('binary_logs'); } else { $binary_logs = $dbi->fetchResult( 'SHOW MASTER LOGS', 'Log_name', null, DatabaseInterface::CONNECT_USER, DatabaseInterface::QUERY_STORE ); SessionCache::set('binary_logs', $binary_logs); } $tabs = []; $tabs['databases']['icon'] = 's_db'; $tabs['databases']['route'] = '/server/databases'; $tabs['databases']['text'] = __('Databases'); $tabs['databases']['active'] = $route === '/server/databases'; $tabs['sql']['icon'] = 'b_sql'; $tabs['sql']['route'] = '/server/sql'; $tabs['sql']['text'] = __('SQL'); $tabs['sql']['active'] = $route === '/server/sql'; $tabs['status']['icon'] = 's_status'; $tabs['status']['route'] = '/server/status'; $tabs['status']['text'] = __('Status'); $tabs['status']['active'] = in_array($route, [ '/server/status', '/server/status/advisor', '/server/status/monitor', '/server/status/processes', '/server/status/queries', '/server/status/variables', ]); if ($is_superuser || $isCreateOrGrantUser) { $tabs['rights']['icon'] = 's_rights'; $tabs['rights']['route'] = '/server/privileges'; $tabs['rights']['text'] = __('User accounts'); $tabs['rights']['active'] = in_array($route, [ '/server/privileges', '/server/user-groups', ]); $tabs['rights']['args']['viewing_mode'] = 'server'; } $tabs['export']['icon'] = 'b_export'; $tabs['export']['route'] = '/server/export'; $tabs['export']['text'] = __('Export'); $tabs['export']['active'] = $route === '/server/export'; $tabs['import']['icon'] = 'b_import'; $tabs['import']['route'] = '/server/import'; $tabs['import']['text'] = __('Import'); $tabs['import']['active'] = $route === '/server/import'; $tabs['settings']['icon'] = 'b_tblops'; $tabs['settings']['route'] = '/preferences/manage'; $tabs['settings']['text'] = __('Settings'); $tabs['settings']['active'] = in_array($route, [ '/preferences/export', '/preferences/features', '/preferences/import', '/preferences/main-panel', '/preferences/manage', '/preferences/navigation', '/preferences/sql', '/preferences/two-factor', ]); if (! empty($binary_logs)) { $tabs['binlog']['icon'] = 's_tbl'; $tabs['binlog']['route'] = '/server/binlog'; $tabs['binlog']['text'] = __('Binary log'); $tabs['binlog']['active'] = $route === '/server/binlog'; } if ($is_superuser) { $tabs['replication']['icon'] = 's_replication'; $tabs['replication']['route'] = '/server/replication'; $tabs['replication']['text'] = __('Replication'); $tabs['replication']['active'] = $route === '/server/replication'; } $tabs['vars']['icon'] = 's_vars'; $tabs['vars']['route'] = '/server/variables'; $tabs['vars']['text'] = __('Variables'); $tabs['vars']['active'] = $route === '/server/variables'; $tabs['charset']['icon'] = 's_asci'; $tabs['charset']['route'] = '/server/collations'; $tabs['charset']['text'] = __('Charsets'); $tabs['charset']['active'] = $route === '/server/collations'; $tabs['engine']['icon'] = 'b_engine'; $tabs['engine']['route'] = '/server/engines'; $tabs['engine']['text'] = __('Engines'); $tabs['engine']['active'] = $route === '/server/engines'; $tabs['plugins']['icon'] = 'b_plugin'; $tabs['plugins']['route'] = '/server/plugins'; $tabs['plugins']['text'] = __('Plugins'); $tabs['plugins']['active'] = $route === '/server/plugins'; return $tabs; } /** * Set current table * * @param string $table Current table * * @return Menu */ public function setTable($table) { $this->table = $table; return $this; } }
Close