]> git.mxchange.org Git - friendica.git/commitdiff
Add phpinfo page only accessible to admins
authorHypolite Petovan <mrpetovan@gmail.com>
Sat, 3 Feb 2018 06:26:28 +0000 (01:26 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Sat, 3 Feb 2018 06:26:28 +0000 (01:26 -0500)
mod/admin.php
mod/phpinfo.php [new file with mode: 0644]

index 55a8a78f1c637253440d0336e9c961e29fd97013..d7495340b4c961932c84e7ec81732ff3263ee5a6 100644 (file)
@@ -180,10 +180,10 @@ function admin_content(App $a)
                        'addons'       => ["admin/addons/"      , L10n::t("Addons")               , "addons"],
                        'themes'       => ["admin/themes/"      , L10n::t("Themes")               , "themes"],
                        'features'     => ["admin/features/"    , L10n::t("Additional features")  , "features"] ]],
-               'database' => [ L10n::t('Database'), [ 
+               'database' => [ L10n::t('Database'), [
                        'dbsync'       => ["admin/dbsync/"      , L10n::t('DB updates')           , "dbsync"],
                        'queue'        => ["admin/queue/"       , L10n::t('Inspect Queue')        , "queue"], ]],
-               'tools' => [ L10n::t('Tools'), [ 
+               'tools' => [ L10n::t('Tools'), [
                        'contactblock' => ["admin/contactblock/", L10n::t('Contact Blocklist')    , "contactblock"],
                        'blocklist'    => ["admin/blocklist/"   , L10n::t('Server Blocklist')     , "blocklist"],
                        'deleteitem'   => ["admin/deleteitem/"  , L10n::t('Delete Item')          , 'deleteitem'], ]],
@@ -192,6 +192,7 @@ function admin_content(App $a)
                        "logsview" => ["admin/viewlogs/", L10n::t("View Logs"), 'viewlogs']
                ]],
                "diagnostics" => [ L10n::t("Diagnostics"), [
+                       "phpinfo" => ['phpinfo/', L10n::t('PHP Info'), 'phpinfo'],
                        "probe" => ['probe/', L10n::t('probe address'), 'probe'],
                        "webfinger" =>['webfinger/', L10n::t('check webfinger'), 'webfinger']
                ]]
diff --git a/mod/phpinfo.php b/mod/phpinfo.php
new file mode 100644 (file)
index 0000000..ec2897d
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+/**
+ * @file mod/phpinfo.php
+ */
+
+require_once 'boot.php';
+
+function phpinfo_content()
+{
+       if (!is_site_admin()) {
+               return false;
+       }
+
+       phpinfo();
+       killme();
+}