missing statement in functions_config.inc.php

Found a bug? Tell us!!
Post Reply
mrw02536
Regular
Posts: 31
Joined: Sat Nov 02, 2013 9:25 pm

missing statement in functions_config.inc.php

Post by mrw02536 »

I noticed when an author is deleted the entry in table 'serendipity_authorgroups' was not deleted. To fix this I added the following line to the appropriate function 'functions_config.inc.php' file:

/**
* Delete an author account
*
* (Note, this function does not delete entries by an author)
*
* @access public
* @param int The author ID to delete
* @return boolean True on success, false on error or unsufficient privileges
*/
function serendipity_deleteAuthor($authorid) {
global $serendipity;

if (!serendipity_checkPermission('adminUsersDelete')) {
return false;
}

if (serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}authors WHERE authorid=" . (int)$authorid)) {
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}permalinks WHERE entry_id=" . (int)$authorid ." and type='author'");
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}authorgroups WHERE authorid=" . (int)$authorid);
}
return true;
}
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: missing statement in functions_config.inc.php

Post by Timbalu »

Are you still working on your member login thing?

I think we do have that already in serendipity_updateGroups() exactly and laterly by member/groupid in serendipity_updateGroupConfig().
You have to see the whole figure, since entries and category sql fetch rely on joining *_authorgroups and will check if a given authorid is (still) valid.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
mrw02536
Regular
Posts: 31
Joined: Sat Nov 02, 2013 9:25 pm

Re: missing statement in functions_config.inc.php

Post by mrw02536 »

Ian, i've made some real progress on the integration. I've integrated the database user table from my website with the serendipity_authors table and can now log in to both applications with one login procedure.
I was not happy with the lack of password protection in Serendipity so I modified several Serendipity files to include some conditions on password length. There some other issues about allowing duplicate email addresses that I fixed as well.
All in all the integration has worked out very well.

As far as the issue with deleting users, my experience was that on deleting a user the entry in 'serendipity_authorgroups remained but it wasn't a big deal to fix it.

Rich
Post Reply