[geeklog-modules] Plugins and comments
geeklog-modules-admin at lists.geeklog.net
geeklog-modules-admin at lists.geeklog.net
Tue Apr 29 10:49:31 EDT 2003
Well, it seems we still have some problems with plugins and comments.
Take this, for example (from comments.php):
function deletecomment($cid,$sid,$type)
{
global $_TABLES, $_CONF, $_USER, $REMOTE_ADDR;
if (!empty ($sid) && !empty ($cid) && is_numeric ($cid)) {
$result = DB_query ("SELECT o
wner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM
{$_TABLES['stories']} WHERE sid = '{$sid}'");
$P = DB_fetchArray ($result);
if (SEC_hasAccess ($A['owner_id'], $A['group_id'],
$A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon'])
== 3) {
Ignore that stupid typo ("$P = DB_fetchArray" should be "$A = ...") for
the moment. The problem here is that this code prevents deletion of
comments from anything but stories.
So how are plugins handling deletion of comments currently? A bit further
down in comments.php, this function is called:
PLG_handlePluginComment($type,$sid,'delete');
But, of course, as things are now, this will never be called.
Since Geeklog can't really know how the plugin's tables are named and how
(if at all) it handles permissions, I'd suggest that Geeklog should leave
the deletion of comments entirely to plugins, i.e. something like:
if (comment_type == 'article' || comment_type == 'poll')
geeklog_handles_it
else
let_the_plugin_handle_it
Comments?
bye, Dirk
--
http://www.haun-online.de/
http://mypod.de/
More information about the geeklog-modules
mailing list