Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Created September 1, 2017 13:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kurozumi/388ea60a8e6259ebb3fd2c10f144c67b to your computer and use it in GitHub Desktop.
【EC-CUBE3】会員ログインしないとお問い合わせフォームが表示されないようにする方法
<?php
/*
* This file is part of the SamplePlugin
*
* Copyright (C) 2017 kurozumi
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Plugin\SamplePlugin\ServiceProvider;
use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
use Monolog\Handler\FingersCrossedHandler;
use Monolog\Handler\RotatingFileHandler;
use Monolog\Logger;
use Plugin\SamplePlugin\Form\Type\SamplePluginConfigType;
use Silex\Application as BaseApplication;
use Silex\ServiceProviderInterface;
use Plugin\SamplePlugin\Security\DefaultAuthenticationSuccessHandler;
class SamplePluginServiceProvider implements ServiceProviderInterface
{
public function register(BaseApplication $app)
{
$channel = null;
// 強制SSL
if ($app['config']['force_ssl'] == \Eccube\Common\Constant::ENABLED) {
$channel = "https";
}
$access_rules = $app['security.access_rules'];
$access_rules[] = array("^/contact", 'ROLE_USER', $channel);
$app['security.access_rules'] = $access_rules;
}
public function boot(BaseApplication $app)
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment