Skip to content
Snippets Groups Projects
Commit b26c1b97 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Enable modules by config

parent 9d8d4c60
No related branches found
No related tags found
No related merge requests found
......@@ -19,13 +19,7 @@ First we need to create the module directory:
cd modules
mkdir mymodule
Since this is a custom module, it should always be enabled.
Therefore we create a `default-enable` file in the module.
We do that by copying the `default-enable` file from the `core` module.
cd mymodule
cp ../core/default-enable .
Since this is a custom module, it should always be enabled in the configuration.
Now that we have our own module, we can move on to creating an authentication source.
......
......@@ -46,23 +46,13 @@ Each SimpleSAMLphp module is stored in a directory under the
`modules`-directory. The module directory contains the following
directories and files:
default-disable
: The presence of this file indicates that the module is disabled
by default. It can be enabled using the `module.enable`
option in `config.php`.
default-enable
: The presence of this file indicates that the module is enabled
by default. It can be disabled using the `module.enable`
option in `config.php`.
dictionaries
locales
: This directory contains dictionaries which belong to this
module. To use a dictionary stored in a module, the extended tag
names can be used:
`{<module name>:<dictionary name>:<tag name>}` For
example, `{example:login:hello}` will look up `hello` in
`modules/example/dictionaries/login.php`.
`modules/example/locales/<lang>/login.po`.
: It is also possible to specify
`<module name>:<dictionary name>` as the default
......
......@@ -44,8 +44,8 @@ The first thing you need to do is having a SimpleSAMLphp module to place your th
cd modules
mkdir mymodule
cd mymodule
touch default-enable
Enable the module by setting `$config['module.enable' => ['mymodule' => true]]`
Then within this module, you can create a new theme named `fancytheme`.
......
......@@ -342,24 +342,6 @@ class Module
throw new \Exception("Invalid module.enable value for the '$module' module.");
}
if (
assert_options(ASSERT_ACTIVE)
&& !file_exists($moduleDir . '/default-enable')
&& !file_exists($moduleDir . '/default-disable')
) {
Logger::error("Missing default-enable or default-disable file for the module $module");
}
if (file_exists($moduleDir . '/enable')) {
self::$module_info[$module]['enabled'] = true;
return true;
}
if (!file_exists($moduleDir . '/disable') && file_exists($moduleDir . '/default-enable')) {
self::$module_info[$module]['enabled'] = true;
return true;
}
self::$module_info[$module]['enabled'] = false;
return false;
}
......
......@@ -18,7 +18,7 @@ use Webmozart\Assert\Assert;
*
* To adapt this to your own web site, you should:
* 1. Create your own module directory.
* 2. Add a file "default-enable" to that directory.
* 2. Enable to module in the config by adding '<module-dir>' => true to the $config['module.enable'] array.
* 3. Copy this file and modules/exampleauth/www/resume.php to their corresponding
* location in the new module.
* 4. Replace all occurrences of "exampleauth" in this file and in resume.php with the name of your module.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment