Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

System User Awarded Massive Points

meshugymeshugy Musician/Hacker ✭✭
edited December 2013 in Vanilla 2.0 - 2.8

I have been very happy with the Reactions plugin so far. The only issue I've had is that it awards a huge number of points to the System user (blog posts imported into Vanilla get posted with the System User account.) I tried manually removing the points from the database, but they get awarded again hours later. Is there any way to prevent the System User from receiving Reactions points?

I'm running 2.1b2

Thanks....

Comments

  • Options
    AviramAviram
    edited December 2013

    Hi! I'm not using this plugin but you can try this, edit peregrinereactionsmodel.php
    Go to line 39, right after it defines $UserID then add:

    if ($UserID = 2)
    return;

    Change 2 to System's ID!
    Tell me if it works.

  • Options
    peregrineperegrine MVP
    edited December 2013

    if the solution provided by Aviram works for you - great - problem solved.

    if it doesn't work @meshugy - you can pm me. I've got some other ideas.

    another question - are you referring to badges also?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    meshugymeshugy Musician/Hacker ✭✭

    I tried this, but it doesn't seem to make a difference:

    public function GetBadge($UserId) {  
             $BadgesModel = new Gdn_Model('User');
             if ($UserID = 4697) return;
             $ResultArray  = $BadgesModel->SQL
                            ->Select('*')
                            ->From('PeregrineBadges')
                            ->Where('UserId', $UserId)
                            ->Get()
                            ->ResultArray();
             return $ResultArray;
        }
    
    

    The System's user ID is 4697

    Any other ideas?

  • Options
    hgtonighthgtonight ∞ · New Moderator

    @meshugy said:
    I tried this, but it doesn't seem to make a difference:

    public function GetBadge($UserId) {  
             $BadgesModel = new Gdn_Model('User');
           if ($UserID = 4697) return;
             $ResultArray  = $BadgesModel->SQL
                            ->Select('*')
                            ->From('PeregrineBadges')
                            ->Where('UserId', $UserId)
                            ->Get()
                            ->ResultArray();
             return $ResultArray;
        }
    
    

    The System's user ID is 4697

    Any other ideas?

    You have a logic error. You are testing if the assignment of $UserID to 4697, not checking if they are equal. Use if ($UserID == 4697) return; instead.

    Stil this is just returning badges, so I don't think has anything to do with points.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    peregrineperegrine MVP
    edited December 2013

    Stil this is just returning badges, so I don't think has anything to do with points.

    if it has to do with badges - you are posting in the wrong plugin.

    that's why I told him to pm me personal message. I have a solution, but i want to test it on his site.

    I don't see how it relates to reactions anyway. but if it does I also have a solution for reaction points.

    I'll be back in a few hours.

    Instead of posting snippets of code. just pm me @meshugy, with a time you want to test. I'll be available about 4 or 5 hours. your choice to take up offer, or I'll assume you don't want me to help.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited December 2013

    As it turns out System User was not awarded massive points by the peregrine reactions plugin.

    But if anyone should get massive points - my vote would be for System - system is one heck of a workaholic.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited December 2013

    You may be familiar with these Laws

    Isaac Asimov's "Three Laws of Robotics"

    1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.

    2. A robot must obey orders given it by human beings except where such orders would conflict with the First Law.

    3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.

    You may not be familiar with the 4th law.

    • 4) A robot (System) may attempt to gain Massive amounts of points.

    the title of this discussion "System User Awarded Massive Points" sounds like the perfect lead for an article in the onion .... http://www.theonion.com/

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.