special_schema_links.inc.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Links configuration for MySQL system tables
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. if (! defined('PHPMYADMIN')) {
  9. exit;
  10. }
  11. /**
  12. * This global variable represent the details for generating links inside
  13. * special schemas like mysql, information_schema etc.
  14. * Major element represent a schema.
  15. * All the strings in this array represented in lower case
  16. * This global variable has not modified anywhere
  17. *
  18. * Variable structure ex:
  19. * $GLOBALS['special_schema_links'] = array(
  20. * // Database name is the major element
  21. * 'mysql' => array(
  22. * // Table name
  23. * 'db' => array(
  24. * // Column name
  25. * 'user' => array(
  26. * // Main url param (can be an array where represent sql)
  27. * 'link_param' => 'username',
  28. * // Other url params
  29. * 'link_dependancy_params' => array(
  30. * 0 => array(
  31. * // URL parameter name
  32. * // (can be array where url param has static value)
  33. * 'param_info' => 'hostname',
  34. * // Column name related to url param
  35. * 'column_name' => 'host'
  36. * )
  37. * ),
  38. * // Page to link
  39. * 'default_page' => './server_privileges.php'
  40. * )
  41. * )
  42. * )
  43. * );
  44. *
  45. */
  46. $GLOBALS['special_schema_links'] = array(
  47. 'mysql' => array(
  48. 'columns_priv' => array(
  49. 'user' => array(
  50. 'link_param' => 'username',
  51. 'link_dependancy_params' => array(
  52. 0 => array(
  53. 'param_info' => 'hostname',
  54. 'column_name' => 'host'
  55. )
  56. ),
  57. 'default_page' => './server_privileges.php'
  58. ),
  59. 'table_name' => array(
  60. 'link_param' => 'table',
  61. 'link_dependancy_params' => array(
  62. 0 => array(
  63. 'param_info' => 'db',
  64. 'column_name' => 'Db'
  65. ),
  66. ),
  67. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  68. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  69. )
  70. ),
  71. 'column_name' => array(
  72. 'link_param' => 'field',
  73. 'link_dependancy_params' => array(
  74. 0 => array(
  75. 'param_info' => 'db',
  76. 'column_name' => 'Db'
  77. ),
  78. 1 => array(
  79. 'param_info' => 'table',
  80. 'column_name' => 'Table_name'
  81. )
  82. ),
  83. 'default_page' => './tbl_structure.php?change_column=1'
  84. ),
  85. ),
  86. 'db' => array(
  87. 'user' => array(
  88. 'link_param' => 'username',
  89. 'link_dependancy_params' => array(
  90. 0 => array(
  91. 'param_info' => 'hostname',
  92. 'column_name' => 'host'
  93. )
  94. ),
  95. 'default_page' => './server_privileges.php'
  96. )
  97. ),
  98. 'event' => array(
  99. 'name' => array(
  100. 'link_param' => 'item_name',
  101. 'link_dependancy_params' => array(
  102. 0 => array(
  103. 'param_info' => 'db',
  104. 'column_name' => 'db'
  105. )
  106. ),
  107. 'default_page' => './db_events.php?edit_item=1'
  108. ),
  109. ),
  110. 'innodb_index_stats' => array(
  111. 'table_name' => array(
  112. 'link_param' => 'table',
  113. 'link_dependancy_params' => array(
  114. 0 => array(
  115. 'param_info' => 'db',
  116. 'column_name' => 'database_name'
  117. ),
  118. ),
  119. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  120. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  121. )
  122. ),
  123. 'index_name' => array(
  124. 'link_param' => 'index',
  125. 'link_dependancy_params' => array(
  126. 0 => array(
  127. 'param_info' => 'db',
  128. 'column_name' => 'database_name'
  129. ),
  130. 1 => array(
  131. 'param_info' => 'table',
  132. 'column_name' => 'table_name'
  133. )
  134. ),
  135. 'default_page' => './tbl_structure.php'
  136. ),
  137. ),
  138. 'innodb_table_stats' => array(
  139. 'table_name' => array(
  140. 'link_param' => 'table',
  141. 'link_dependancy_params' => array(
  142. 0 => array(
  143. 'param_info' => 'db',
  144. 'column_name' => 'database_name'
  145. ),
  146. ),
  147. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  148. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  149. )
  150. ),
  151. ),
  152. 'proc' => array(
  153. 'name' => array(
  154. 'link_param' => 'item_name',
  155. 'link_dependancy_params' => array(
  156. 0 => array(
  157. 'param_info' => 'db',
  158. 'column_name' => 'db'
  159. ),
  160. 1 => array(
  161. 'param_info' => 'item_type',
  162. 'column_name' => 'type'
  163. )
  164. ),
  165. 'default_page' => './db_routines.php?edit_item=1'
  166. ),
  167. 'specific_name' => array(
  168. 'link_param' => 'item_name',
  169. 'link_dependancy_params' => array(
  170. 0 => array(
  171. 'param_info' => 'db',
  172. 'column_name' => 'db'
  173. ),
  174. 1 => array(
  175. 'param_info' => 'item_type',
  176. 'column_name' => 'type'
  177. )
  178. ),
  179. 'default_page' => './db_routines.php?edit_item=1'
  180. ),
  181. ),
  182. 'proc_priv' => array(
  183. 'user' => array(
  184. 'link_param' => 'username',
  185. 'link_dependancy_params' => array(
  186. 0 => array(
  187. 'param_info' => 'hostname',
  188. 'column_name' => 'Host'
  189. )
  190. ),
  191. 'default_page' => './server_privileges.php'
  192. ),
  193. 'routine_name' => array(
  194. 'link_param' => 'item_name',
  195. 'link_dependancy_params' => array(
  196. 0 => array(
  197. 'param_info' => 'db',
  198. 'column_name' => 'Db'
  199. ),
  200. 1 => array(
  201. 'param_info' => 'item_type',
  202. 'column_name' => 'Routine_type'
  203. )
  204. ),
  205. 'default_page' => './db_routines.php?edit_item=1'
  206. ),
  207. ),
  208. 'proxies_priv' => array(
  209. 'user' => array(
  210. 'link_param' => 'username',
  211. 'link_dependancy_params' => array(
  212. 0 => array(
  213. 'param_info' => 'hostname',
  214. 'column_name' => 'Host'
  215. )
  216. ),
  217. 'default_page' => './server_privileges.php'
  218. ),
  219. ),
  220. 'tables_priv' => array(
  221. 'user' => array(
  222. 'link_param' => 'username',
  223. 'link_dependancy_params' => array(
  224. 0 => array(
  225. 'param_info' => 'hostname',
  226. 'column_name' => 'Host'
  227. )
  228. ),
  229. 'default_page' => './server_privileges.php'
  230. ),
  231. 'table_name' => array(
  232. 'link_param' => 'table',
  233. 'link_dependancy_params' => array(
  234. 0 => array(
  235. 'param_info' => 'db',
  236. 'column_name' => 'Db'
  237. ),
  238. ),
  239. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  240. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  241. )
  242. ),
  243. ),
  244. 'user' => array(
  245. 'user' => array(
  246. 'link_param' => 'username',
  247. 'link_dependancy_params' => array(
  248. 0 => array(
  249. 'param_info' => 'hostname',
  250. 'column_name' => 'host'
  251. )
  252. ),
  253. 'default_page' => './server_privileges.php'
  254. )
  255. )
  256. ),
  257. 'information_schema' => array(
  258. 'columns' => array(
  259. 'table_name' => array(
  260. 'link_param' => 'table',
  261. 'link_dependancy_params' => array(
  262. 0 => array(
  263. 'param_info' => 'db',
  264. 'column_name' => 'table_schema'
  265. )
  266. ),
  267. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  268. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  269. )
  270. ),
  271. 'column_name' => array(
  272. 'link_param' => 'field',
  273. 'link_dependancy_params' => array(
  274. 0 => array(
  275. 'param_info' => 'db',
  276. 'column_name' => 'table_schema'
  277. ),
  278. 1 => array(
  279. 'param_info' => 'table',
  280. 'column_name' => 'table_name'
  281. )
  282. ),
  283. 'default_page' => './tbl_structure.php?change_column=1'
  284. )
  285. ),
  286. 'key_column_usage' => array(
  287. 'table_name' => array(
  288. 'link_param' => 'table',
  289. 'link_dependancy_params' => array(
  290. 0 => array(
  291. 'param_info' => 'db',
  292. 'column_name' => 'constraint_schema'
  293. )
  294. ),
  295. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  296. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  297. )
  298. ),
  299. 'column_name' => array(
  300. 'link_param' => 'field',
  301. 'link_dependancy_params' => array(
  302. 0 => array(
  303. 'param_info' => 'db',
  304. 'column_name' => 'table_schema'
  305. ),
  306. 1 => array(
  307. 'param_info' => 'table',
  308. 'column_name' => 'table_name'
  309. )
  310. ),
  311. 'default_page' => './tbl_structure.php?change_column=1'
  312. ),
  313. 'referenced_table_name' => array(
  314. 'link_param' => 'table',
  315. 'link_dependancy_params' => array(
  316. 0 => array(
  317. 'param_info' => 'db',
  318. 'column_name' => 'referenced_table_schema'
  319. )
  320. ),
  321. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  322. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  323. )
  324. ),
  325. 'referenced_column_name' => array(
  326. 'link_param' => 'field',
  327. 'link_dependancy_params' => array(
  328. 0 => array(
  329. 'param_info' => 'db',
  330. 'column_name' => 'referenced_table_schema'
  331. ),
  332. 1 => array(
  333. 'param_info' => 'table',
  334. 'column_name' => 'referenced_table_name'
  335. )
  336. ),
  337. 'default_page' => './tbl_structure.php?change_column=1'
  338. )
  339. ),
  340. 'partitions' => array(
  341. 'table_name' => array(
  342. 'link_param' => 'table',
  343. 'link_dependancy_params' => array(
  344. 0 => array(
  345. 'param_info' => 'db',
  346. 'column_name' => 'table_schema'
  347. )
  348. ),
  349. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  350. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  351. )
  352. )
  353. ),
  354. 'processlist' => array(
  355. 'user' => array(
  356. 'link_param' => 'username',
  357. 'link_dependancy_params' => array(
  358. 0 => array(
  359. 'param_info' => 'hostname',
  360. 'column_name' => 'host'
  361. )
  362. ),
  363. 'default_page' => './server_privileges.php'
  364. )
  365. ),
  366. 'referential_constraints' => array(
  367. 'table_name' => array(
  368. 'link_param' => 'table',
  369. 'link_dependancy_params' => array(
  370. 0 => array(
  371. 'param_info' => 'db',
  372. 'column_name' => 'constraint_schema'
  373. )
  374. ),
  375. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  376. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  377. )
  378. ),
  379. 'referenced_table_name' => array(
  380. 'link_param' => 'table',
  381. 'link_dependancy_params' => array(
  382. 0 => array(
  383. 'param_info' => 'db',
  384. 'column_name' => 'constraint_schema'
  385. )
  386. ),
  387. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  388. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  389. )
  390. )
  391. ),
  392. 'routines' => array(
  393. 'routine_name' => array(
  394. 'link_param' => 'item_name',
  395. 'link_dependancy_params' => array(
  396. 0 => array(
  397. 'param_info' => 'db',
  398. 'column_name' => 'routine_schema'
  399. ),
  400. 1 => array(
  401. 'param_info' => 'item_type',
  402. 'column_name' => 'routine_type'
  403. )
  404. ),
  405. 'default_page' => './db_routines.php'
  406. ),
  407. ),
  408. 'schemata' => array(
  409. 'schema_name' => array(
  410. 'link_param' => 'db',
  411. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  412. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  413. )
  414. )
  415. ),
  416. 'statistics' => array(
  417. 'table_name' => array(
  418. 'link_param' => 'table',
  419. 'link_dependancy_params' => array(
  420. 0 => array(
  421. 'param_info' => 'db',
  422. 'column_name' => 'table_schema'
  423. )
  424. ),
  425. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  426. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  427. )
  428. ),
  429. 'column_name' => array(
  430. 'link_param' => 'field',
  431. 'link_dependancy_params' => array(
  432. 0 => array(
  433. 'param_info' => 'db',
  434. 'column_name' => 'table_schema'
  435. ),
  436. 1 => array(
  437. 'param_info' => 'table',
  438. 'column_name' => 'table_name'
  439. )
  440. ),
  441. 'default_page' => './tbl_structure.php?change_column=1'
  442. )
  443. ),
  444. 'tables' => array(
  445. 'table_name' => array(
  446. 'link_param' => 'table',
  447. 'link_dependancy_params' => array(
  448. 0 => array(
  449. 'param_info' => 'db',
  450. 'column_name' => 'table_schema'
  451. )
  452. ),
  453. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  454. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  455. )
  456. ),
  457. ),
  458. 'table_constraints' => array(
  459. 'table_name' => array(
  460. 'link_param' => 'table',
  461. 'link_dependancy_params' => array(
  462. 0 => array(
  463. 'param_info' => 'db',
  464. 'column_name' => 'table_schema'
  465. )
  466. ),
  467. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  468. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  469. )
  470. ),
  471. ),
  472. 'views' => array(
  473. 'table_name' => array(
  474. 'link_param' => 'table',
  475. 'link_dependancy_params' => array(
  476. 0 => array(
  477. 'param_info' => 'db',
  478. 'column_name' => 'table_schema'
  479. )
  480. ),
  481. 'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
  482. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  483. )
  484. ),
  485. ),
  486. )
  487. );