Skip to content

Commit

Permalink
context fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RBoelter committed Jul 9, 2021
1 parent 17e9728 commit 024e074
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion OpenIDPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ class OpenIDPlugin extends GenericPlugin
{


public function isSitePlugin()
{
return !Application::get()->getRequest()->getContext();
}

/**
* Get the display name of this plugin
* @return string
Expand Down Expand Up @@ -61,7 +66,12 @@ public function register($category, $path, $mainContextId = null)
$success = parent::register($category, $path);
if ($success && $this->getEnabled()) {
$request = Application::get()->getRequest();
$settings = json_decode($this->getSetting($request->getContext()->getId(), 'openIDSettings'), true);
if($request->getContext() && $request->getContext()->getId()){
$contextId = $request->getContext()->getId();
} else {
$contextId = 0;
}
$settings = json_decode($this->getSetting($contextId, 'openIDSettings'), true);
$user = $request->getUser();
if ($user && $user->getData('openid::lastProvider') && isset($settings)
&& key_exists('disableFields', $settings) && key_exists('providerSync', $settings) && $settings['providerSync'] == 1) {
Expand Down

0 comments on commit 024e074

Please sign in to comment.