Anonymous Login
2019-11-17 22:09 PST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001126Pending RequestsCore Infrastructurepublic2016-12-26 10:25
Reportertomar99 
Assigned Tocaseydk 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusassignedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0001126: Add a custom authentication mode to Web2Project
DescriptionFew month ago, I was able to add a custom authentication mode to web2project.

I explained what I did in this message :
http://forums.web2project.net/viewtopic.php?t=4738

    First, you need to create your custom authenticator. Put the file in W2P\classes\w2p\Authenticators
    Enclosed to this post is an example.



    Then you need to add an entry in the database to register your new authentication mode.
    This query should work. 3 is the config_id for 'auth_method'
    Code:
    INSERT INTO `w2p`.`config_list` (`config_list_id`, `config_id`, `config_list_name`) VALUES (NULL, '3', 'YourAuthenticationID');



    To have a nice text in the drop down list of the System admin, update the locales file in W2P/locales/en/system.inc
    And add
    Code:
    YourAuthenticationID_item_title'=>'Custom authentication'



    You need to specify the action to do in case the new authentication mode is selected.
    Go to W2P/includes/cleanup_functions.php.
    Update the function &getAuth($auth_mode) to include your authentication ID in the switch.
    Code:
    function &getAuth($auth_mode) {
        switch ($auth_mode) {
            case 'ldap':
                $auth = new w2p_Authenticators_LDAP();
                return $auth;
                break;
            case 'pn':
                $auth = new w2p_Authenticators_PostNuke();
                return $auth;
                break;
            case 'custom':
                $auth = new w2p_Authenticators_Custom();
                return $auth;
                break;
            default:
                $auth = new w2p_Authenticators_SQL();
                return $auth;
                break;
        }
    }


Additional InformationHow to implement it in a generic way:

> The database insert could be easily inserted in a core feature.

> For the modification of the local file, I don't really know how variable and translations are handles in W2P. Any ideas ?

> Finally, use a Facotry Pattern, with the name of the class to instantiate stored in the database or in a configuration file.
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes
There are no notes attached to this issue.
+Notes

-Issue History
Date Modified Username Field Change
2012-04-10 23:01 tomar99 New Issue
2012-04-10 23:01 tomar99 File Added: CustomAuthenticator.class.php
2013-11-22 10:33 caseydk Category -- none specified -- => Core Infrastructure
2014-01-01 16:34 caseydk Project Pending Requests => v4.0 Release (Planning)
2014-01-21 17:57 caseydk Target Version => 4.0
2014-03-30 22:11 caseydk Category General => Core Infrastructure
2014-06-15 23:12 caseydk Assigned To => caseydk
2014-06-15 23:12 caseydk Status new => assigned
2016-12-26 10:25 caseydk Project v4.0 Release (Planning) => Pending Requests
+Issue History