Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

管理画面からphpinfoの情報を削除 #5342

Merged
merged 5 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ MAILER_DSN=null://null
#ECCUBE_ADMIN_ALLOW_HOSTS=[]
#ECCUBE_ADMIN_DENY_HOSTS=[]
#ECCUBE_FORCE_SSL=false
#ECCUBE_PHPINFO_ENABLED=false
#ECCUBE_TEMPLATE_CODE=default
#ECCUBE_AUTH_MAGIC=<change.me>
#ECCUBE_COOKIE_NAME=eccube
Expand Down
2 changes: 2 additions & 0 deletions app/config/eccube/packages/eccube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ parameters:
env(ECCUBE_ADMIN_ALLOW_HOSTS): '[]'
env(ECCUBE_ADMIN_DENY_HOSTS): '[]'
env(ECCUBE_FORCE_SSL): '0'
env(ECCUBE_PHPINFO_ENABLED): '0'
env(ECCUBE_TEMPLATE_CODE): 'default'
env(ECCUBE_AUTH_MAGIC): '<change.me>'
env(ECCUBE_COOKIE_NAME): 'eccube'
Expand All @@ -31,6 +32,7 @@ parameters:
eccube_admin_allow_hosts: '%env(json:ECCUBE_ADMIN_ALLOW_HOSTS)%'
eccube_admin_deny_hosts: '%env(json:ECCUBE_ADMIN_DENY_HOSTS)%'
eccube_force_ssl: '%env(bool:ECCUBE_FORCE_SSL)%'
eccube_phpinfo_enabled: '%env(bool:ECCUBE_PHPINFO_ENABLED)%'
eccube.theme: '%env(ECCUBE_TEMPLATE_CODE)%'
eccube_theme_code: '%eccube.theme%'
eccube_auth_magic: '%env(ECCUBE_AUTH_MAGIC)%'
Expand Down
6 changes: 4 additions & 2 deletions codeception/acceptance/EA08SysteminfoCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ public function systeminfo_システム情報(AcceptanceTester $I)
$I->see('WEBサーバー', '#server_info_box__body_inner > div:nth-child(4) > div:first-child');
$I->see('PHP', '#server_info_box__body_inner > div:nth-child(5) > div:first-child');
$I->see('User Agent', '#server_info_box__body_inner > div:nth-child(6) > div:first-child');
$I->see('PHP情報', '#php_info_box__header > div > span');

if ($config['eccube_phpinfo_enabled'] == 1) {
$I->see('PHP情報', '#php_info_box__header > div > span');
}

$I->expect('session.save_path をチェックします');
$I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/system/phpinfo');
$I->scrollTo('a[name=module_session]');
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ services:
# ECCUBE_USER_DATA_ROUTE: "user_data"
# ECCUBE_ADMIN_ALLOW_HOSTS: []
# ECCUBE_FORCE_SSL: false
# ECCUBE_PHPINFO_ENABLED=false
# ECCUBE_TEMPLATE_CODE: "default"
# ECCUBE_COOKIE_NAME: "eccube"
# ECCUBE_COOKIE_PATH: "/"
Expand Down
15 changes: 13 additions & 2 deletions src/Eccube/Controller/Admin/Setting/System/SystemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Eccube\Controller\Admin\Setting\System;

use Eccube\Common\EccubeConfig;
use Eccube\Common\Constant;
use Eccube\Service\SystemService;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
Expand All @@ -22,6 +23,11 @@

class SystemController
{
/**
* @var EccubeConfig
*/
protected $eccubeConfig;

/**
* @var SystemService
*/
Expand All @@ -30,10 +36,14 @@ class SystemController
/**
* SystemController constructor.
*
* @param EccubeConfig $eccubeConfig
* @param SystemService $systemService
*/
public function __construct(SystemService $systemService)
{
public function __construct(
EccubeConfig $eccubeConfig,
SystemService $systemService
){
$this->eccubeConfig = $eccubeConfig;
$this->systemService = $systemService;
}

Expand All @@ -55,6 +65,7 @@ public function index(Request $request)

return [
'info' => $info,
'phpinfo_enabled' => $this->eccubeConfig->get('eccube_phpinfo_enabled'),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ file that was distributed with this source code.
</div>
</div>
</div>


{% if phpinfo_enabled %}
<div class="c-primaryCol">
<div class="card rounded border-0 mb-4">
<div class="card-header">
Expand All @@ -76,6 +77,7 @@ file that was distributed with this source code.

</div>
</div>
{% endif %}

</div>
</div>
Expand Down
Loading