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

using the standard way to save configuration #11

Open
plegall opened this issue Feb 12, 2022 · 2 comments
Open

using the standard way to save configuration #11

plegall opened this issue Feb 12, 2022 · 2 comments

Comments

@plegall
Copy link

plegall commented Feb 12, 2022

I see that configuration is saved in the plugin directory, in the conf.php file. That makes the plugin immediately incompatible with "multiple site" Piwigo :-/ Why not using the standard way to store configuration with Piwigo? You have examples on how to do that with plugin Skeleton https://github.com/Piwigo/Piwigo-Skeleton

@jasperweyne
Copy link
Owner

During normal usage, the plugin stores the configuration in the same way as the Piwigo skeleton. However, if a problem occurs (this might also happen on the side of the OIDC identity provider), a user may inadvertently lock themselves out when the authorization flow is enabled. By enabling the authorization flow, the native Piwigo login flow is bypassed. This means that, if for some reason the user can't login to their Piwigo installation using the authorization flow, they're permanently locked out of their Piwigo installation.

Therefore, the conf.php file is provided to manually override the database-stored configuration. It's intended for emergency use, as manually editing database values is (usually) more difficult, compared to editing a file on disk. However, if you have another suggestion for this particular use case, let me know!

@plegall
Copy link
Author

plegall commented Feb 17, 2022

OK, that's very specific but I think I get it :-)

Instead of storing this configuration in the plugin directory, it should be stored in the local directory.

$conf_filepath = PHPWG_ROOT_PATH.PWG_LOCAL_DIR .'config/openid.inc.php';
if (file_exists($conf_filepath))
{
  include($conf_filepath);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants