Hello. I moved to beta2 today and noticed that the message "Sorry, new user registration by invitation only." is now appearing on the password reset form at /user/password. I believe this changed because in the previous release this was handled via invite_form_alter() which had a switch on the $form_id. In the new beta2 version, the error is returned in the function invite_user_register_access(), which has no checks on the path or form ID.

I haven't thought through a solution yet.

CommentFileSizeAuthor
#4 871090-message.patch833 bytessmk-ka

Comments

robby.smith’s picture

subscribing

rjbrown99’s picture

This is strange to me as to why this is happening. I added some debug statements inside of invite_menu_alter and it's not being called from there. Something else is calling invite_user_register_access() but I have yet to determine what it is. I also checked the form_id values just to be sure and it is not user_admin_settings so it's not coming from there either.

They seem to be the only two places where that function is called. Yet I add a debug statement to invite_user_register_access() and I do see it firing. So something, somewhere, is calling that function.

My page has two forms. user_pass, and requestinvitation_form (from the Request Invitation module). Neither one of them has any relationship to invite_user_register_access(). I'm still looking but it's strange as to what's calling that function.

rjbrown99’s picture

Looks like it comes from the default Drupal menu.inc based on a debug_backtrace():


    [0] => Array
        (
            [function] => invite_user_register_access
            [args] => Array
                (
                )

        )

    [1] => Array
        (
            [file] => /mnt/web/www/html/mysite.com/includes/menu.inc
            [line] => 452
            [function] => call_user_func_array
            [args] => Array
                (
                    [0] => invite_user_register_access
                    [1] => Array
                        (
                        )

                )

        )

    [2] => Array
        (
            [file] => /mnt/web/www/html/mysite.com/includes/menu.inc
            [line] => 581
            [function] => _menu_check_access
            [args] => Array
                (
                    [0] => Array
                        (
                            [path] => user/register
                            [load_functions] => 
                            [to_arg_functions] => 
                            [access_callback] => invite_user_register_access
                            [access_arguments] => a:0:{}
                            [page_callback] => drupal_get_form
                            [page_arguments] => a:1:{i:0;s:13:"user_register";}
                            [fit] => 3
                            [number_parts] => 2
                            [tab_parent] => user
                            [tab_root] => user
                            [title] => Create new account
                            [title_callback] => t
                            [title_arguments] => 
                            [type] => 128
                            [block_callback] => 
                            [description] => 
                            [position] => 
                            [weight] => 0
                            [file] => modules/user/user.pages.inc
                            [href] => user/register
                            [options] => Array
                                (
                                )

                        )

                    [1] => Array
                        (
                            [0] => user
                            [1] => password
                        )

                )

        )


    [3] => Array
        (
            [file] => /mnt/web/www/html/mysite.com/sites/all/modules/ctools/includes/menu.inc
            [line] => 300
            [function] => _menu_translate
            [args] => Array
                (
                    [0] => Array
                        (
                            [path] => user/register
                            [load_functions] => 
                            [to_arg_functions] => 
                            [access_callback] => invite_user_register_access
                            [access_arguments] => a:0:{}
                            [page_callback] => drupal_get_form
                            [page_arguments] => a:1:{i:0;s:13:"user_register";}
                            [fit] => 3
                            [number_parts] => 2
                            [tab_parent] => user
                            [tab_root] => user
                            [title] => Create new account
                            [title_callback] => t
                            [title_arguments] => 
                            [type] => 128
                            [block_callback] => 
                            [description] => 
                            [position] => 
                            [weight] => 0
                            [file] => modules/user/user.pages.inc
                            [href] => user/register
                            [options] => Array
                                (
                                )

                        )

                    [1] => Array
                        (
                            [0] => user
                            [1] => password
                        )

                    [2] => 1
                )

        )

This seems to originate from this issue: #374869: Invite's registration access control conflicts with LDAP Provisioning module.

smk-ka’s picture

Status: Active » Needs review
StatusFileSize
new833 bytes

This happens because the menu system checks access for all displayed tabs. So we need to make sure the message is only output when on the user/register tab, and not for any other.

smk-ka’s picture

Status: Needs review » Fixed

The fix has been committed to CVS.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.