Unvalided Users Error With Flexreg

With Elgg 1.7.6, when Flexreg is enabled I get an error "Your email address could not be verified..." when trying to view Unvalidated users in Administration. If I disable Flexreg, it works. I've got Registration moderation set, so need to be able to see Unvalidated users to be able to delete them, or resend the validation e-mail.

Is this a problem with the software, or with me?

  • You see this message when you are already logged in?

    What do you mean by "it works"? I'm a little unclear what behaviour you are seeing.

  • When I'm logged in as Admin.

    With Flexreg disabled, when I click on Unvalidated users in the Administration menu, the list of Unvalidated users displays properly.

    With Flexreg enabled, when I click on Unvalidated users in the Administration menu, a red bar appears with the error message "Your email address could not be verified...". Then I'm redirected to the Dashboard.

  • I've never seen this behaviour, but then my version of Elgg doesn't have an "Unvalidated users" link in the administration menu. Is this a new Elgg feature or is it supplied by a plugin?

  • It seems to be part of the "uservalidationbyemail" plugin that comes with Elgg, and was enabled. I've disabled it, and "Unvalidated users" has disappeared. I've just tried to register as a new user, and haven't received a validation e-mail, so it looks like it won't work without it.

    I had to disable "flexreg" and enable "uservalidationbyemail" so I could use "Unvalidated users" to resend the validation e-mail!

  • I haven't tested flexreg with Elgg 1.7.4 yet, so I'm not sure what the problem is at this point. I'll try to look into it this week.

  • Ok, thanks. 1.7.6 is the current version. Flexreg, Flexprofile and Form all seem to work fine with it, apart from this problem. I haven't tested your other mods yet.

    I think the Unvalidated users feature is important, as it allows you to see who hasn't validated their account, and you can delete people who never validate. As a new Elgg user, I can't see how I could run my site without it.

  • Have you had any luck with this yet Kevin? It's a conflict between the page handler uservalidationbyemail in Flexreg and in the User Validation by E-mail plugin, but I'm not clever enough to fix it! My site is about to go live, and I think this may cause me problems.

  • Yes, the fix will be in the next release.

    To fix it before that, replace the flexreg_uservalidationbyemail_page_handler function in flexreg/start.php with this one:

    function flexreg_uservalidationbyemail_page_handler($page) {
        if (isset($page[0]) && $page[0] == 'confirm') {
            include(dirname(__FILE__) . "/pages/confirm.php");
        } else if (isset($page[0]) && $page[0] == 'admin') {
            set_context('admin');
            $content = elgg_view('uservalidationbyemail/admin/users/unvalidated');
            $title = elgg_echo('uservalidationbyemail:admin:unvalidated');

            $body = elgg_view_layout('two_column_left_sidebar', '', elgg_view_title($title) . $content);

            page_draw($title, $body);
            return TRUE;
        } else {
            register_error(elgg_echo('email:confirm:fail'));
        }

        forward();
    }

  • Oops, actually I see that there is an admin_gatekeeper(); call missing there. I think that this bug was fixed in Elgg 1.7.7.

    So use this code:

    function flexreg_uservalidationbyemail_page_handler($page) {
        if (isset($page[0]) && $page[0] == 'confirm') {
            include(dirname(__FILE__) . "/pages/confirm.php");
        } else if (isset($page[0]) && $page[0] == 'admin') {
            set_context('admin');
            admin_gatekeeper();
            $content = elgg_view('uservalidationbyemail/admin/users/unvalidated');
            $title = elgg_echo('uservalidationbyemail:admin:unvalidated');

            $body = elgg_view_layout('two_column_left_sidebar', '', elgg_view_title($title) . $content);

            page_draw($title, $body);
            return TRUE;
        } else {
            register_error(elgg_echo('email:confirm:fail'));
        }

        forward();
    }

Form and related plugins

Form and related plugins

User-generated content, flexible user and group profiles, registration forms, custom file forms