From 9e2e0605ed6280daa4d74c4b962e4630d1078d90 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Tue, 5 Jan 2010 13:56:22 -0500 Subject: [PATCH] Move Authorization and Authentication plugin structures into core, instead of as plugins. This move makes sense as you can addPlugin('Authentication') for example - these are abstract classes designed to be implemented, not used directly. --- .../Authentication => classes}/User_username.php | 0 .../authenticationplugin.php | 12 ------------ .../authorizationplugin.php | 3 --- .../CasAuthentication/CasAuthenticationPlugin.php | 1 - .../LdapAuthentication/LdapAuthenticationPlugin.php | 1 - .../LdapAuthorization/LdapAuthorizationPlugin.php | 1 - .../ReverseUsernameAuthenticationPlugin.php | 2 -- 7 files changed, 20 deletions(-) rename {plugins/Authentication => classes}/User_username.php (100%) rename plugins/Authentication/AuthenticationPlugin.php => lib/authenticationplugin.php (97%) rename plugins/Authorization/AuthorizationPlugin.php => lib/authorizationplugin.php (98%) diff --git a/plugins/Authentication/User_username.php b/classes/User_username.php similarity index 100% rename from plugins/Authentication/User_username.php rename to classes/User_username.php diff --git a/plugins/Authentication/AuthenticationPlugin.php b/lib/authenticationplugin.php similarity index 97% rename from plugins/Authentication/AuthenticationPlugin.php rename to lib/authenticationplugin.php index 07f14035da..de479a5768 100644 --- a/plugins/Authentication/AuthenticationPlugin.php +++ b/lib/authenticationplugin.php @@ -207,18 +207,6 @@ abstract class AuthenticationPlugin extends Plugin } } - function onAutoload($cls) - { - switch ($cls) - { - case 'User_username': - require_once(INSTALLDIR.'/plugins/Authentication/User_username.php'); - return false; - default: - return true; - } - } - function onCheckSchema() { $schema = Schema::get(); $schema->ensureTable('user_username', diff --git a/plugins/Authorization/AuthorizationPlugin.php b/lib/authorizationplugin.php similarity index 98% rename from plugins/Authorization/AuthorizationPlugin.php rename to lib/authorizationplugin.php index e4e046d088..733b0c0656 100644 --- a/plugins/Authorization/AuthorizationPlugin.php +++ b/lib/authorizationplugin.php @@ -66,9 +66,6 @@ abstract class AuthorizationPlugin extends Plugin } //------------Below are the methods that connect StatusNet to the implementing Auth plugin------------\\ - function onInitializePlugin(){ - - } function onStartSetUser(&$user) { $loginAllowed = $this->loginAllowed($user); diff --git a/plugins/CasAuthentication/CasAuthenticationPlugin.php b/plugins/CasAuthentication/CasAuthenticationPlugin.php index 8f29c7d2ad..26f21af160 100644 --- a/plugins/CasAuthentication/CasAuthenticationPlugin.php +++ b/plugins/CasAuthentication/CasAuthenticationPlugin.php @@ -34,7 +34,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { // We bundle the phpCAS library... set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/extlib/CAS'); -require_once INSTALLDIR.'/plugins/Authentication/AuthenticationPlugin.php'; class CasAuthenticationPlugin extends AuthenticationPlugin { public $server; diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php index 39967fe425..af42be761e 100644 --- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php +++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php @@ -31,7 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR.'/plugins/Authentication/AuthenticationPlugin.php'; require_once 'Net/LDAP2.php'; class LdapAuthenticationPlugin extends AuthenticationPlugin diff --git a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php index 5e759c3793..7673e61efb 100644 --- a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php +++ b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php @@ -31,7 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR.'/plugins/Authorization/AuthorizationPlugin.php'; require_once 'Net/LDAP2.php'; class LdapAuthorizationPlugin extends AuthorizationPlugin diff --git a/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php b/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php index d48283b2ee..d157ea067c 100644 --- a/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php +++ b/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php @@ -31,8 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR.'/plugins/Authentication/AuthenticationPlugin.php'; - class ReverseUsernameAuthenticationPlugin extends AuthenticationPlugin { //---interface implementation---// -- 2.39.5