Current time: 03-22-2010, 01:23 AM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
member.php modification for better plugins support.
07-03-2009, 02:05 PM
Post: #1
member.php modification for better plugins support.
Hi, I'm glad i can post on this forum.
I use MyBB since 1.4.4. However, the forum is integrated with my game server in some way and I had to write a special plugin for it.

Unfortunately, I had to modify 2 files to get it done. For a better illustration of what i wanted to do, I'll just post a link to the registration page: http://h-rp.pl/member.php?action=register
As you can see, I'm forcing members to write answers for few questions. When they register, they get an "waiting for activation" group - but they're unable to activate it themselves. Only administration team can do it. We read the answers and if they won't pass the test, their accounts are getting automatically blocked.
There is however one way then can get registered without administrator's activation (by giving us some data from the time before we used MyBB) and then i want to set their group just to 5 - Registered.

But to do this, I couldn't find another way than modifying the member.php file. Plugins can't set the variable of group, due to this:
Code:
    if($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "admin" || $mybb->input['coppa'] == 1)
    {
        $usergroup = 5;
    }
    else
    {
        $usergroup = 2;
    }
The only thing that has to be changed is adding a simple if statement:
Code:
    //hrp mod
    if(!isset($usergroup))
    {
        if($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "admin" || $mybb->input['coppa'] == 1)
        {
            $usergroup = 5;
        }
        else
        {
            $usergroup = 2;
        }
    }
So in my plugin i can do:
Code:
            //set usergroup so he registers accepted
            $usergroup = 2;

Very, very simple modification, but gives us more freedom in what plugins can do during the registration process. I think so, at least.
Maybe I omitted some other way to do it - if so, please help me getting it done properly. Thanks!
Find all posts by this user
Quote this message in a reply
07-03-2009, 02:07 PM (This post was last modified: 07-03-2009 02:07 PM by MattRogowski.)
Post: #2
RE: member.php modification for better plugins support.
Isn't related to this but I have to say that you should really upgrade, you're 4 versions behind the current release, and you're open to a high security issue.

My Personal Site - Twitter
MyBB Support Team
[Image: lqscs]
Visit this user's website Find all posts by this user
Quote this message in a reply
07-03-2009, 02:10 PM (This post was last modified: 07-03-2009 02:11 PM by Wicko.)
Post: #3
RE: member.php modification for better plugins support.
No, I'm on 1.4.7 currently and I was preparing for upgrade to 1.4.8 - that made me post this thread Wink
I just mentioned, that i was starting on 1.4.4 and i forgot to add the rest. I'm sorry.
Find all posts by this user
Quote this message in a reply
07-03-2009, 02:16 PM
Post: #4
RE: member.php modification for better plugins support.
Can't you do that in the datahandler_user_validate hook?
Visit this user's website Find all posts by this user
Quote this message in a reply
07-03-2009, 02:30 PM
Post: #5
RE: member.php modification for better plugins support.
(07-03-2009 02:10 PM)Wicko Wrote:  No, I'm on 1.4.7 currently and I was preparing for upgrade to 1.4.8

Ah, I missed the 'since' in your post, nevermind then Angel

My Personal Site - Twitter
MyBB Support Team
[Image: lqscs]
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: