Skip to content

Commit

Permalink
refs matomo-org/matomo#7124 Updated the usage of the deprecated registry
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Feb 16, 2015
1 parent 6be1022 commit b107dac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions LoginLdap.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

use Exception;
use Piwik\Access;
use Piwik\Auth;
use Piwik\Common;
use Piwik\Container\StaticContainer;
use Piwik\FrontController;
use Piwik\Menu\MenuAdmin;
use Piwik\Piwik;
Expand Down Expand Up @@ -43,7 +45,6 @@ public function getListHooksRegistered()
'Controller.Login.resetPassword' => 'disablePasswordResetForLdapUsers',
'Controller.LoginLdap.resetPassword' => 'disablePasswordResetForLdapUsers',
'Controller.Login.confirmResetPassword' => 'disableConfirmResetPasswordForLdapUsers',
'Controller.Login.confirmResetPassword' => 'disableConfirmResetPasswordForLdapUsers'
);
return $hooks;
}
Expand Down Expand Up @@ -158,8 +159,10 @@ function addMenu()
*/
public function ApiRequestAuthenticate($tokenAuth)
{
\Piwik\Registry::get('auth')->setLogin($login = null);
\Piwik\Registry::get('auth')->setTokenAuth($tokenAuth);
/** @var Auth $auth */
$auth = StaticContainer::get('Piwik\Auth');
$auth->setLogin($login = null);
$auth->setTokenAuth($tokenAuth);
}

/**
Expand All @@ -169,7 +172,7 @@ public function ApiRequestAuthenticate($tokenAuth)
function initAuthenticationObject($activateCookieAuth = false)
{
$auth = AuthBase::factory();
\Piwik\Registry::set('auth', $auth);
StaticContainer::getContainer()->set('Piwik\Auth', $auth);

Login::initAuthenticationFromCookie($auth, $activateCookieAuth);
}
Expand Down
4 changes: 2 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "LoginLdap",
"version": "3.1.2",
"version": "3.1.3",
"description": "LDAP authentication and synchronization for Piwik.",
"theme": false,
"keywords": ["ldap", "login", "authentication", "active", "directory", "kerberos", "sso"],
"license": "GPL v3+",
"homepage": "https://github.com/piwik/plugin-LoginLdap",
"require": {
"piwik": ">=2.10.0",
"piwik": ">=2.11.0-b5",
"php": ">=5.3.0"
},
"authors": [
Expand Down

0 comments on commit b107dac

Please sign in to comment.