<p>You can write a <a href="http://buildwithcraft.com/docs/plugins/introduction" rel="nofollow">plugin</a> that has a <a href="http://buildwithcraft.com/docs/plugins/variables" rel="nofollow">Template Variable</a> that exposes Craft's <a href="http://buildwithcraft.com/classreference/services/SystemSettingsService#getSetting-detail" rel="nofollow">SystemSettingsService->getSettings()</a> method like so:</p>

<pre><code>public function isPublicRegistrationEnabled()
{
    return craft()-&gt;systemSettings-&gt;getSetting('users', 'allowPublicRegistration');
}
</code></pre>

<p>You'd call it from the template via:</p>

<pre><code>{% if craft.myAwesomePlugin.isPublicRegistrationEnabled() %}
    Enabled!
{% endif %}
</code></pre>

CC BY-SA 3.0
2014-10-03T00:48:17.733Z
2014-10-03T00:48:17.733Z
Brad Bell
<p>I'm trying to make a rather bullet proof front-end template that can toggle a sign up link based on if <a href="http://buildwithcraft.com/docs/users#public-registration" rel="nofollow">public registration</a> is enabled or not.</p>

<p>Is there a way I can query to see if the system currently has <a href="http://buildwithcraft.com/docs/users#public-registration" rel="nofollow">public registration</a> turned <code>on</code> from the front-end?</p>

<users><user-profile><registration>
How can you check if "public user registration" is turned on or off on the front-end?
# How can you check if "public user registration" is turned on or off on the front-end?

(Asked by: username_0 on 2014-10-03)

I'm trying to make a rather bullet proof front-end template that can toggle a sign up link based on if [public registration](http://buildwithcraft.com/docs/users#public-registration) is enabled or not.

Is there a way I can query to see if the system currently has [public registration](http://buildwithcraft.com/docs/users#public-registration) turned `on` from the front-end?

**Tags:** users, user-profile, registration


---

## 1 answers

### Answer by username_1 on 2014-10-03. Score: 3 | Accepted answer

You can write a plugin that has a Template Variable that exposes Craft's SystemSettingsService->getSettings() method like so:
public function isPublicRegistrationEnabled()
{
    return craft()->systemSettings->getSetting('users', 'allowPublicRegistration');
}

You'd call it from the template via:
{% if craft.myAwesomePlugin.isPublicRegistrationEnabled() %}
    Enabled!
{% endif %}


---

