Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Удаление баллов на работы в портфолио при удалении пользователя
  • Loading branch information
devkont committed Apr 27, 2017
1 parent 1a285c4 commit 3a91596
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions plugins/userpoints/userpoints.folio.delete.done.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
*/
defined('COT_CODE') or die('Wrong URL.');

require_once cot_incfile('userpoints', 'plug');
global $db_userpoints;

if($ritem['item_state'] == 0)
{
cot_setuserpoints(-$cfg['plugin']['userpoints']['portfolioaddtocat'], 'portfoliodeltocat', $ritem['item_userid'], $id);
}

?>
$db->delete($db_userpoints, "item_type IN ('portfolioaddtocat', 'portfoliodeltocat') AND item_itemid=".$id);
4 changes: 2 additions & 2 deletions plugins/userpoints/userpoints.setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Code=userpoints
* Name=UserPoints
* Description=Система рейтингов пользователей
* Version=2.1.0
* Version=2.1.1
* Date=21.12.2010
* Author=CMSWorks Team
* Copyright=Copyright (c) CMSWorks.ru, littledev.ru
Expand All @@ -31,7 +31,7 @@
* UserPoints plugin
*
* @package userpoints
* @version 2.1.0
* @version 2.1.1
* @author CMSWorks Team
* @copyright Copyright (c) CMSWorks.ru, littledev.ru
* @license BSD
Expand Down

2 comments on commit 3a91596

@eukraina
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Первое надо еще удалять тогда и из flance_userpoints пункты за auth. Для полной чистоты картины. До reviews и платного ПРО я пока не добрался - тут не скажу. Но 1 пункт за auth остался, а юзера такого уже нет.

@eukraina
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Второе - теперь удалив не всего юзера а только его одно фолио не минусуется за это фолио. У меня в flance_userpoints при подтверждении фолио админом дало юзеру + 10 с portfolioaddtocat полем, при удалении это пропало, но в flance_users в user_userpoints значение осталось 11 (1 за auth и 10 за фолио) - там не вычистилось. И на фронтэнде так же 11 естествтвенно, хотя фолио у него нет добаленных.

Please sign in to comment.