Topic: Integrating PunBB into a generic CMS
I am currently writing an extension that will let me integrate PunBB to a content management system I use - basically, I want to use _my_ table of users, not PunBB's. Most of the stuff is easily done using hooks, but there are several changes that need to be done to the PunBB itself:
1) Database abstraction layer classes need to have a more detailed query_build parameters. Specifically, it is important to be able to use different prefixes for different tables, even within the same SELECT. As of now, there is only choice between all prefixes or no prefixes. I propose a change from:
if (isset($query['SELECT']))
{
$sql = 'SELECT '.$query['SELECT'].' FROM '.((isset($query['PARAMS']['NO_PREFIX'])||(isset($query['PARAMS']['FROM_NO_PREFIX'])) ? '' : $this->prefix).$query['FROM'];
if (isset($query['JOINS']))
{
foreach ($query['JOINS'] as $cur_join)
$sql .= ' '.key($cur_join).' '.((isset($query['PARAMS']['NO_PREFIX'])||isset($cur_join['PARAMS']['NO_PREFIX'])) ? '' : $this->prefix).current($cur_join).' ON '.$cur_join['ON'];
}
to
if (isset($query['SELECT']))
{
$sql = 'SELECT '.$query['SELECT'].' FROM '.(isset($query['PARAMS']['NO_PREFIX']) ? '' : $this->prefix).$query['FROM'];
if (isset($query['JOINS']))
{
foreach ($query['JOINS'] as $cur_join)
$sql .= ' '.key($cur_join).' '.(isset($query['PARAMS']['NO_PREFIX']) ? '' : $this->prefix).current($cur_join).' ON '.$cur_join['ON'];
}
2) User authentication functions in include/functions.php need a lot more hooks than they have now. The following parts should be optional, based on a hook response:
- Cookie expiration
- Cookie hash validation
E.g. something like:
$check_expiration = TRUE;
$validate_expiration_hash = TRUE;
($hook = get_hook('fn_cookie_login_validations')) ? eval($hook) : null;
if ($check_expiration) ...
I will post more if (when) I find them.