Login  Register

Re: Close the registration of new users

Posted by jsmoraes on Mar 17, 2015; 12:57am
URL: https://support.nabble.com/Close-the-registration-of-new-users-tp7594230p7594241.html

forocrash wrote
Hiding the option of registering, for example?
I didn't find how to hide the Register link in main page, up to now. But you can change the page of registration to don't permit registration of new user.

You must change the macro start_registration_page as I did:

<override_macro name="start_registration_page" requires="servlet">
    <n.if.is_submitted_form>
        <then.process_registration/>
    </n.if.is_submitted_form>

    <n.html>
        <head>
            <n.title.><t>Register to <t.app.root_node.subject/></t></n.title.>
            <n.registration_stylesheet/>
        </head>
        <body>

We don't accept new registration or Registration is Closed or Any other text you want to show and with the HTML format you desire.
For example:  <h2>We will open for register later</h2>

 <!--
           <div class="center-content">
                <h1 class="weak-color"><t>Register</t></h1>
                <span class="second-font shaded-bg-color rounded big-title" style="padding:.2em .7em">
                    <n.root_node.subject/>
                </span>

                <n.handle_registration_errors/>

                <n.form.>
                    <n.nextUrl_field.hidden/>
                    <div style="text-align:left;margin:0 auto">
                        <n.registration_fields/>
                        <div class="weak-color" style="margin-top:1em;text-align:center;">
                            <input type="submit" class="toolbar action-button" value="[t]Register Now[/t]"/>
                        </div>
                    </div>
                </n.form.>
            </div>
-->

        </body>
    </n.html>

</override_macro>

the tags
<!--
 and
-->
 trasform the code lines in text comments lines. They don't work as HTML code. So you will not have the form to register.

But, as forum, why you want to cancel the option for registration ? You can create groups and change permissions, as Greg told, to organize who can do or can not do this or that.
Observatório de Astronomia de Vilatur - W. Herschel
Saquarema - RJ - Brasil
http://www.astronomia.pousadavilatur.com.br