Move phpinfo module to src/Module/Admin
This commit is contained in:
parent
ad02fd140a
commit
fa4b42c6dd
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @file mod/phpinfo.php
|
||||
*/
|
||||
|
||||
function phpinfo_content()
|
||||
{
|
||||
if (!is_site_admin()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
phpinfo();
|
||||
exit();
|
||||
}
|
|
@ -140,6 +140,8 @@ class Router
|
|||
$collector->addRoute(['GET'] , '/logs/view' , Module\Admin\Logs\View::class);
|
||||
$collector->addRoute(['GET', 'POST'], '/logs' , Module\Admin\Logs\Settings::class);
|
||||
|
||||
$collector->addRoute(['GET'] , '/phpinfo' , Module\Admin\PhpInfo::class);
|
||||
|
||||
$collector->addRoute(['GET'] , '/queue[/deferred]' , Module\Admin\Queue::class);
|
||||
|
||||
$collector->addRoute(['GET', 'POST'], '/site' , Module\Admin\Site::class);
|
||||
|
|
16
src/Module/Admin/PhpInfo.php
Normal file
16
src/Module/Admin/PhpInfo.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module\Admin;
|
||||
|
||||
use Friendica\Module\BaseAdminModule;
|
||||
|
||||
class PhpInfo extends BaseAdminModule
|
||||
{
|
||||
public static function rawContent()
|
||||
{
|
||||
parent::rawContent();
|
||||
|
||||
phpinfo();
|
||||
exit();
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ namespace Friendica\Module;
|
|||
use Friendica\BaseModule;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
|
||||
abstract class BaseAdminModule extends BaseModule
|
||||
|
@ -21,6 +22,19 @@ abstract class BaseAdminModule extends BaseModule
|
|||
}
|
||||
}
|
||||
|
||||
public static function rawContent()
|
||||
{
|
||||
if (!is_site_admin()) {
|
||||
System::httpExit(403);
|
||||
}
|
||||
|
||||
if (!empty($_SESSION['submanage'])) {
|
||||
System::httpExit(403);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
public static function content()
|
||||
{
|
||||
if (!is_site_admin()) {
|
||||
|
@ -75,6 +89,7 @@ abstract class BaseAdminModule extends BaseModule
|
|||
'logsview' => ['admin/logs/view' , L10n::t('View Logs') , 'viewlogs'],
|
||||
]],
|
||||
'diagnostics' => [L10n::t('Diagnostics'), [
|
||||
'phpinfo' => ['admin/phpinfo' , L10n::t('PHP Info') , 'phpinfo'],
|
||||
'itemsource' => ['admin/item/source' , L10n::t('Item Source') , 'itemsource'],
|
||||
]],
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue