Skip to content

Commit

Permalink
Prevent registering via POST if self registration is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ignacionelson committed Jan 5, 2022
1 parent b0a2750 commit 240d20b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions register.php
Expand Up @@ -17,8 +17,9 @@

include_once ADMIN_VIEWS_DIR . DS . 'header-unlogged.php';

/** The form was submitted */
if ($_POST) {
/** The form was submitted */
if ($_POST) {
if (get_option('clients_can_register') == '1') {
/** Validate the information from the posted form. */
/** Create the user if validation is correct. */
$new_client->setType('new_client');
Expand Down Expand Up @@ -70,6 +71,7 @@
exit;
}
}
}
?>

<div class="col-xs-12 col-sm-12 col-lg-4 col-lg-offset-4">
Expand Down Expand Up @@ -165,7 +167,8 @@
<p><a href="<?php echo BASE_URI; ?>" target="_self"><?php _e('Go back to the homepage.','cftp_admin'); ?></a></p>
</div>
</div>
</div> <!-- main -->
</div>
</div>

<?php
include_once ADMIN_VIEWS_DIR . DS . 'footer.php';

0 comments on commit 240d20b

Please sign in to comment.