com web/bugs: List actions only in one place: www/admin/index.php
| From: | Johannes Schlüter | Date: | Mon, 24 Jul 2017 22:09:14 +0000 |
| Subject: | com web/bugs: List actions only in one place: www/admin/index.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-26239@lists.php.net to get a copy of this message | ||
Commit: 8f536b423e393a5e52c03d7924ab3486bde327c7
Author: Johannes Schlüter <johannes@schlueters.de> Tue, 25 Jul 2017 00:09:14 +0200
Parents: 187d5a7d33777fd9cc189bc55e15aaf3014f2c77
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=8f536b423e393a5e52c03d7924ab3486bde327c7
Log:
List actions only in one place
Changed paths:
M www/admin/index.php
Diff:
diff --git a/www/admin/index.php b/www/admin/index.php
index ad1a3c2..8861718 100644
--- a/www/admin/index.php
+++ b/www/admin/index.php
@@ -10,8 +10,14 @@ if (!$logged_in) {
exit;
}
-$actions = array('list_lists', 'list_responses', 'phpinfo');
-$action = !empty($_GET['action']) && in_array($_GET['action'],
$actions) ? $_GET['action'] : 'list_lists';
+$actions = array(
+ 'phpinfo' => 'phpinfo()',
+ 'list_lists' => 'Package mailing lists',
+ 'list_responses' => 'Quick fix responses',
+ 'mysql' => 'Database status',
+);
+
+$action = !empty($_GET['action']) && isset($actions[$_GET['action']])
? $_GET['action'] : 'list_lists';
if ($action === 'phpinfo') {
ob_start();
@@ -33,12 +39,7 @@ if ($action === 'phpinfo') {
response_header("Bugs admin suite");
-inline_content_menu('/admin/', $action, array(
- 'phpinfo' => 'phpinfo()',
- 'list_lists' => 'Package mailing lists',
- 'list_responses' => 'Quick fix responses',
- 'mysql' => 'Database status',
- ));
+inline_content_menu('/admin/', $action, $actions);
if ($action === 'list_lists') {