Move phpinfo module to src/Module/Admin
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);
|
||||
|
|
|
@ -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()) {
|
||||
|
@ -71,10 +85,11 @@ abstract class BaseAdminModule extends BaseModule
|
|||
'deleteitem' => ['admin/item/delete' , L10n::t('Delete Item') , 'deleteitem'],
|
||||
]],
|
||||
'logs' => [L10n::t('Logs'), [
|
||||
'logsconfig' => ['admin/logs/', L10n::t('Logs') , 'logs'],
|
||||
'logsconfig' => ['admin/logs/', L10n::t('Logs') , 'logs'],
|
||||
'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 New Issue