File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,12 @@ php artisan vendor:publish --provider="Vdlp\BasicAuthentication\ServiceProviders
2929This will create a ` config/basicauthentication.php ` file in your app where you can modify the configuration if you don't
3030want to use .env variables.
3131
32+ ## Enable / disable plugin
33+
34+ By default basic authentication is disabled.
35+
36+ To enable basic authentication, you have to set the env variable to ` BASIC_AUTHENTICATION_ENABLED ` to ` true ` in your ` .env ` file or edit the published config file.
37+
3238## Questions? Need help?
3339
3440If you have any question about how to use this plugin, please don't hesitate to contact us at octobercms@vdlp.nl . We're happy to help you. You can also visit the support forum and drop your questions/issues there.
Original file line number Diff line number Diff line change 88use Backend \Behaviors \ListController ;
99use Backend \Classes \NavigationManager ;
1010use Backend \Classes \Controller ;
11+ use Illuminate \Contracts \Config \Repository ;
1112use System \Classes \SettingsManager ;
1213
1314/**
@@ -36,14 +37,19 @@ class Credentials extends Controller
3637 /** {@inheritdoc} */
3738 public $ requiredPermissions = ['vdlp.basicauthentication.access_settings ' ];
3839
40+ /** @var bool */
41+ public $ enabled ;
42+
3943 /**
4044 * {@inheritdoc}
4145 */
42- public function __construct ()
46+ public function __construct (Repository $ config )
4347 {
4448 parent ::__construct ();
4549
4650 NavigationManager::instance ()->setContext ('October.System ' , 'system ' , 'settings ' );
4751 SettingsManager::setContext ('Vdlp.BasicAuthentication ' , 'credentials ' );
52+
53+ $ this ->enabled = $ config ->get ('basicauthentication.enabled ' );
4854 }
4955}
Original file line number Diff line number Diff line change 88use Backend \Behaviors \ListController ;
99use Backend \Classes \NavigationManager ;
1010use Backend \Classes \Controller ;
11+ use Illuminate \Contracts \Config \Repository ;
1112use System \Classes \SettingsManager ;
1213
1314/**
@@ -36,14 +37,19 @@ class ExcludedUrls extends Controller
3637 /** {@inheritdoc} */
3738 public $ requiredPermissions = ['vdlp.basicauthentication.access_settings ' ];
3839
40+ /** @var bool */
41+ public $ enabled ;
42+
3943 /**
4044 * {@inheritdoc}
4145 */
42- public function __construct ()
46+ public function __construct (Repository $ config )
4347 {
4448 parent ::__construct ();
4549
4650 NavigationManager::instance ()->setContext ('October.System ' , 'system ' , 'settings ' );
4751 SettingsManager::setContext ('Vdlp.BasicAuthentication ' , 'excludedurls ' );
52+
53+ $ this ->enabled = $ config ->get ('basicauthentication.enabled ' );
4854 }
4955}
Original file line number Diff line number Diff line change 1+ < ?php if(!$this-> enabled): ?>
2+ < div class ="container-fluid ">
3+ < div class ="callout fade in callout-warning no-subheader ">
4+ < div class ="header ">
5+ < i class ="icon-warning "> </ i >
6+ < h3 > < ?= e(trans('vdlp.basicauthentication::lang.notifications.disabled')) ?> </ h3 >
7+ </ div >
8+ </ div >
9+ </ div >
10+ < ?php endif; ?>
11+
112< ?= $this-> listRender() ?>
Original file line number Diff line number Diff line change 1+ < ?php if(!$this-> enabled): ?>
2+ < div class ="container-fluid ">
3+ < div class ="callout fade in callout-warning no-subheader ">
4+ < div class ="header ">
5+ < i class ="icon-warning "> </ i >
6+ < h3 > < ?= e(trans('vdlp.basicauthentication::lang.notifications.disabled')) ?> </ h3 >
7+ </ div >
8+ </ div >
9+ </ div >
10+ < ?php endif; ?>
11+
112< ?= $this-> listRender() ?>
Original file line number Diff line number Diff line change 5858 'create_button ' => 'New excluded URL ' ,
5959 ],
6060 ],
61+ 'notifications ' => [
62+ 'disabled ' => 'Basic Authentication is disabled, you can enable it in the configuration file. Read the README for more information. ' ,
63+ ],
6164];
You can’t perform that action at this time.
0 commit comments