Announcement

Collapse
No announcement yet.

Moderate new members and email verification

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • tubedogg
    replied
    np and thanks

    Leave a comment:


  • Jet
    replied
    NP. Thanks a lot for your answer...

    Best wishes for Christmas and your recovery !

    P.S.: there's only a little bug about 'usertitle's in Registered users (grp 2) because I should apply the two or three lines of code for 'Members' and number of posts...
    I'll do better.
    Thnx

    Leave a comment:


  • tubedogg
    replied
    Sorry, my hard drive crashed.

    Anyway that code should work fine.

    Leave a comment:


  • Jet
    replied
    6-on-6 !!! Am I alone, here ???

    Well, the (final) bugfix / workaround should be here !
    Thanks.

    Leave a comment:


  • Jet
    replied
    Not at all... Something's still missing about group 4 -> group 2 update... I'll work better...

    Nobody could check my issue ?

    Thnx

    Leave a comment:


  • Jet
    replied
    Wow!!!
    Four mine on four posts!!!
    It should be better than a 4-table one-on-one relationships in a DB !! :LOL:

    Well. I tried to solve myself the problem with a modification to code.
    Hack, bugfix or the worst solution ever !!! Call it as you prefer....

    As I'm a dummy php coder, could you or other expert people validate it and tell if addresses right the problem without side effects ?

    Simply, changed the lines:
    PHP Code:
        if ($userinfo[coppauser] or ($moderatenewmembers and !$bbuserinfo['posts'])) {

                
    // put user in moderated group
                
    $DB_site->query("UPDATE user SET usergroupid=4 WHERE userid='$u'");

                eval(
    "standarderror(\"".gettemplate("error_moderateuser")."\");");
            } else {
                
    // activate account
                
    $DB_site->query("UPDATE user SET usergroupid=2 WHERE userid='$u'");

                
    $username=$userinfo[username];
                eval(
    "standarderror(\"".gettemplate("error_activatedthanks")."\");");
            } 
    with:
    PHP Code:
        if ($userinfo[coppauser] or ($moderatenewmembers and !$bbuserinfo['posts'])) {

                
    // put user in moderated group
                
    $nextugid=4;
                
    $nextugrp=$DB_site->query_first("SELECT usertitle FROM usergroup WHERE usergroupid='$nextugid'");
                
    $DB_site->query("UPDATE user SET usergroupid='$nextugid', usertitle='$nextugrp[usertitle]' WHERE userid='$u'");

                eval(
    "standarderror(\"".gettemplate("error_moderateuser")."\");");
            } else {
                
    // activate account
                
    $nextugid=2;
                
    $nextugrp=$DB_site->query_first("SELECT usertitle FROM usergroup WHERE usergroupid='$nextugid'");
                
    $DB_site->query("UPDATE user SET usergroupid='$nextugid', usertitle='$nextugrp[usertitle]' WHERE userid='$u'");

                
    $username=$userinfo[username];
                eval(
    "standarderror(\"".gettemplate("error_activatedthanks")."\");");
            } 
    Should it work ?
    Last edited by Jet; Fri 14 Dec '01, 9:24am.

    Leave a comment:


  • Jet
    replied
    Sorry, tubedogg. Could you evaluate if my urgent problem ?

    I know well I made you messing time with a cookie mistake
    , but as you could see I have worked a lot... about.

    Well, just about the users changing usergroupid in register.php, I found the above problem, better explained here :
    http://www.vbulletin.com/forum/showt...threadid=35311
    (which still has only FOUR views !!! )

    Could I enforce somewhere in register.php updating the usergroup title of a changin-group-user ? Is it a bug ?

    Thank you very very much.
    Bye


    Note: this is URGENT because I'm trying to educate our users to this new login flow, and can't obtain a clean behavior if the different flow-states aren't suddendly updated to the users' view ! <grin>
    Last edited by Jet; Fri 14 Dec '01, 6:05am.

    Leave a comment:


  • Jet
    replied
    Well. After THE FIRST DAY of correct job of the above solution, I'm back with a new problem or bug ??

    When the user is moved from group 3 to 4 and later to 2, HIS TITLE DOESN'T CHANGE; actually the custom title flag is set to NO, but however the title (status) displayed near the username, is always 'user awaiting email confirmation', i.e. of group 3 ....
    Even the users has passed thorugh group 4 and group 2, where the title SHOULD BE 'Member' and custom title flag set to 'no'....



    Should I modify something by now ?
    Thanks

    Leave a comment:


  • Jet
    replied
    Yep!
    Sorry but could check just now.

    Yes! With the cookies off, it makes what should do.... :
    the user in group 3 is moved first in group 4 when he answers the email, later in group 2 when the admin validates him from the AdminCP.

    Ok. That's right. Thanks a lot and sorry for messing your time.
    Hopefully will be useful to somebody.
    Bye

    Leave a comment:


  • tubedogg
    replied
    What you said is how it should work...but I'm confused - is it not working?

    Leave a comment:


  • Jet
    replied
    > echoing $bbuserinfo will always show your info

    Of course. But if 'me' is the new user - without cookies - accessing the page register.php?action=act, that number SHOULD BE ZERO (not?), and this verified condition should lead the user in the first branch of the if sentence, to the group 4...

    At least, it's the solution, I think.

    I'll try as soon as I can reopen the board to new subscription to make this test.
    What do you think about ?
    Thnx

    Leave a comment:


  • tubedogg
    replied
    Just as an FYI - echoing $bbuserinfo will always show your info, no matter where on the board you are.

    Now to your question:
    Better, if it's the number of posts that user made - as I can guess -, what's its meaning here and what reasons it could be > 0 ?
    That action is also used if a member is reverifying their email address after changing it. So it checks to see if posts > 0. If yes, then the user is already an active member that is just changing their email address and should not be put in the COPPA/moderation group. If no, then the user is *not* an active member and should be put in the COPPA group.

    Now, why this is not working is another issue.

    Leave a comment:


  • Jet
    replied
    Hi. I'm here again...
    Just realize something with a small debugging code: when the user make a new registration, the $newusergroupid variable is first blank, then - according to the above if-clause, set to 3 or 4 or 2 immediately if is active email-verify, coppa or direct registration.
    Till now, it's ok.

    The problem raises only when the user receives the activation code via email, which link leads him to register.php action=act :

    PHP Code:
      if ($userinfo[usergroupid]==3) {
        if (
    $userinfo[coppauser] or ($moderatenewmembers and !$bbuserinfo['posts'])) {

                
    // put user in moderated group
                
    $DB_site->query("UPDATE user SET usergroupid=4 WHERE userid='$u'");

                eval(
    "standarderror(\"".gettemplate("error_moderateuser")."\");");
            } else {
                
    // activate account
                
    $DB_site->query("UPDATE user SET usergroupid=2 WHERE userid='$u'");

                
    $username=$userinfo[username];
                eval(
    "standardredirect(\"".gettemplate("redirect_registerthanks")
    .
    "\",\"index.php?s=$session[sessionhash]\");");
            }
      } 
    (code you quoted)

    Now, the question I asked myself was: what's $bbuserinfo['posts'] variable that could
    be the UNIQUE reason why - if moderatenewmembers=1 and usergroupid=3
    - the flow doesn't enter the first block of 'if', which sets the usergroupid
    to 4 ????
    Better, if it's the number of posts that user made - as I can guess -, what's its meaning here and what reasons it could be > 0 ?

    The answer ??? Ehhhmmmm!!! I found it with a couple of echos in register.php code: the number of post of the new users I was trying with was MINE !!!!!
    I made all new registration with Netscape deleting cookies each time, while with IE was managing the AdminCP (coppa, moderate new, etc.) , never logged out !!!
    Well, when answering to the email (mine), I followed the link with IE, so cookies said that the number of posts was not zero; this reason, entering the above if, the group of the 'under-moderation' user was set to 2 and not to 4 !!!!

    Almost, I HOPE this could be the scientific reason.... I'll try better !!!
    I absolutely apologize !



    Thanks a lot, as usual.

    P.S.: this mind-storming was very useful, don't you agree ?
    Last edited by Jet; Mon 10 Dec '01, 9:00am.

    Leave a comment:


  • Jet
    replied
    The code not correctly working seems to be here:

    PHP Code:
      if ($verifyemail) {
        
    $newusergroupid=3;
      } else {
        if (
    $moderatenewmembers or $coppauser) {
          
    $newusergroupid=4;
        } else {
          
    $newusergroupid=2;
        }
      } 
    Any reason (how can I debug?), the flow seems not entering the second if clause...

    Leave a comment:


  • Jet
    replied
    Sorry... but ...
    I dupechecked again and again.
    I actually got that piece of code in register.php.

    // delete activationid
    $DB_site->query("DELETE FROM useractivation WHERE userid='$userinfo[userid]' AND type=0");

    if ($userinfo[usergroupid]==3) {
    if ($userinfo[coppauser] or ($moderatenewmembers and !$bbuserinfo['posts'])) {

    // put user in moderated group
    $DB_site->query("UPDATE user SET usergroupid=4 WHERE userid='$u'");


    These are my options:
    Require unique email addresses Yes
    Allow new user registrations Yes
    Allow multiple registrations per user No
    Verify Email address in registration Yes
    Moderate New Members Yes
    Use COPPA Registration system No
    Enable Access Masks? Yes


    .... I verified the flow checking the user table in DB:

    Initially, the user is in group 3. When it answers the email following link, he is switched directly to group 2, NOT 4 !!!

    Note: of course, all the time AdminCP has : There are currently 0 user(s) awaiting moderation.



    I vene tried to switch on and off the COPPA feature to 'solve the bug' as suggested here by TommyBALL, but ....

    I can't get out of this cycle....

    Thanks
    Last edited by Jet; Mon 10 Dec '01, 5:37am.

    Leave a comment:

widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X