Authentification
Posted by bpiwowar
All files from this thread
File Name | File Size | Posted by | Date | ||
---|---|---|---|---|---|
phorum-5.0.21-auth.patch | 4.4 KB | open | download | bpiwowar | 12/10/2005 | Read message |
Authentification July 13, 2005 10:23PM |
Registered: 19 years ago Posts: 9 |
Hi,
I have decided to update the forum website from phorum 3 to phorum 5. However, I had to hack the former in order to plug in my own authentification module. Apparently, I will have to do the same with phorum 5.
I know that on the "modules" forum there is a thread about plugging in one's own authentification system. However, I am not satisfied with these solutions as they also imply that everything has to be duplicated. I am also not satistified by simply modifying the include/users.php as it implies that everything (including user/group privileges on forum itself) has to be handled by the external module.
I eventually modified the users.php and include/db/mysql.php to fit my needs; however, this means also that I will have to do it again each time I upgrade phorum.
What I would like is a plug-in mechanismn at a lower level, that is in include/db/mysql.php directly.
The only assumption is that user_id (and maybe group_id) is handled by a custom module.
For instance,
(1) adding a filter in phorum_db_user_save that tells which fields are to be handled by phorum itself; then calling (if it exists) a custom save procedure that completes the save. Also, if the user does not exist in the phorum database this should be handled properly.
(2) in phorum_db_user_get would be modified to call a custom function to complete the information of phorum tables. Here again, if the user is not found in the phorum database, it has to be handled properly (ie, default values)
This mechanism can be reproduced for the groups.
The advantages are:
- no duplication of information
- it is much easier to plug-in a custom authentification module as only 2/3 simple functions have to be implemented (much easier that modifying the users.php file at least)
- upgrades do not break anything as default values are provided by these function if the field is not handled by the authentification module.
Also, I think there should be some options in phorum that could switch on/off the login/register/modify profile (or modify their URLs).
I would agree to do the modifications and then send a patch if you think this is a good idea.
Benjamin
Edited 1 time(s). Last edit at 07/13/2005 10:26PM by bpiwowar.
I have decided to update the forum website from phorum 3 to phorum 5. However, I had to hack the former in order to plug in my own authentification module. Apparently, I will have to do the same with phorum 5.
I know that on the "modules" forum there is a thread about plugging in one's own authentification system. However, I am not satisfied with these solutions as they also imply that everything has to be duplicated. I am also not satistified by simply modifying the include/users.php as it implies that everything (including user/group privileges on forum itself) has to be handled by the external module.
I eventually modified the users.php and include/db/mysql.php to fit my needs; however, this means also that I will have to do it again each time I upgrade phorum.
What I would like is a plug-in mechanismn at a lower level, that is in include/db/mysql.php directly.
The only assumption is that user_id (and maybe group_id) is handled by a custom module.
For instance,
(1) adding a filter in phorum_db_user_save that tells which fields are to be handled by phorum itself; then calling (if it exists) a custom save procedure that completes the save. Also, if the user does not exist in the phorum database this should be handled properly.
(2) in phorum_db_user_get would be modified to call a custom function to complete the information of phorum tables. Here again, if the user is not found in the phorum database, it has to be handled properly (ie, default values)
This mechanism can be reproduced for the groups.
The advantages are:
- no duplication of information
- it is much easier to plug-in a custom authentification module as only 2/3 simple functions have to be implemented (much easier that modifying the users.php file at least)
- upgrades do not break anything as default values are provided by these function if the field is not handled by the authentification module.
Also, I think there should be some options in phorum that could switch on/off the login/register/modify profile (or modify their URLs).
I would agree to do the modifications and then send a patch if you think this is a good idea.
Benjamin
Edited 1 time(s). Last edit at 07/13/2005 10:26PM by bpiwowar.
Re: Authentification July 15, 2005 12:25PM |
Admin Registered: 23 years ago Posts: 4,495 |
I would have to see the patch. Not sure I followed all of that.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: Authentification December 10, 2005 12:32PM |
Registered: 19 years ago Posts: 9 |
Sorry to have taken so long to answer...
The idea is to have a custom authentification procedure BUT to be able to manage forum permissions + groups from the interface.
I have now created a patch which solves my problems; I modified only two php files:
- include/users.php
- include/db/mysql.php
I updated the default templates: if the variable NOAUTH is set to true, there is no login/logoff options.
In the patch, you can find a custom authentification module (which has a new hook - auth - called by include/users.php)
Please tell me where I can send the patch.
The idea is to have a custom authentification procedure BUT to be able to manage forum permissions + groups from the interface.
I have now created a patch which solves my problems; I modified only two php files:
- include/users.php
- include/db/mysql.php
I updated the default templates: if the variable NOAUTH is set to true, there is no login/logoff options.
In the patch, you can find a custom authentification module (which has a new hook - auth - called by include/users.php)
Please tell me where I can send the patch.
Re: Authentification December 10, 2005 03:21PM |
Admin Registered: 23 years ago Posts: 4,495 |
Re: Authentification December 10, 2005 03:28PM |
Registered: 19 years ago Posts: 9 |
Re: Authentification December 10, 2005 04:26PM |
Admin Registered: 23 years ago Posts: 4,495 |
On the post form there is a big blue link that says "Attach a file ..."
Edited 1 time(s). Last edit at 12/10/2005 04:27PM by brianlmoon.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Edited 1 time(s). Last edit at 12/10/2005 04:27PM by brianlmoon.
Re: Authentification December 10, 2005 06:10PM |
Registered: 20 years ago Posts: 683 |
Re: Authentification December 10, 2005 06:18PM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: Authentification December 10, 2005 06:28PM |
Registered: 19 years ago Posts: 9 |
Re: Authentification December 12, 2005 06:07PM |
Registered: 20 years ago Posts: 123 |
Sorry, only registered users may post in this forum.