Bug fix: allow deleting links between tags when deleting a user.
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@339 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
parent
ab7d79e4c0
commit
12fdaddf6a
2 changed files with 18 additions and 1 deletions
|
@ -56,7 +56,7 @@ if ( $action
|
|||
$uId = $userinfo['uId'];
|
||||
|
||||
$tagcacheservice->deleteByUser($uId);
|
||||
$tag2tagservice->removeLinkedTags('','','',$uId);
|
||||
$tag2tagservice->removeLinkedTagsForUser($uId);
|
||||
$userservice->deleteUser($uId);
|
||||
$bookmark2tagservice->deleteTagsForUser($uId);
|
||||
$commondescriptionservice->deleteDescriptionsForUser($uId);
|
||||
|
|
|
@ -310,6 +310,23 @@ class Tag2TagService {
|
|||
return true;
|
||||
}
|
||||
|
||||
function removeLinkedTagsForUser($uId) {
|
||||
$query = 'DELETE FROM '. $this->getTableName();
|
||||
$query.= ' WHERE uId = "'. $uId .'"';
|
||||
|
||||
if (!($dbresult =& $this->db->sql_query($query))) {
|
||||
message_die(GENERAL_ERROR, 'Could not remove tag relation', '', __LINE__, __FILE__, $query, $this->db);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Update stats and cache
|
||||
$this->update('', '', '', $uId);
|
||||
|
||||
$this->db->sql_freeresult($dbresult);
|
||||
return true;
|
||||
}
|
||||
|
||||
function renameTag($uId, $oldName, $newName) {
|
||||
$tagservice =& ServiceFactory::getServiceInstance('TagService');
|
||||
$newName = $tagservice->normalize($newName);
|
||||
|
|
Loading…
Reference in a new issue