form security token for mod register ported from zap
This commit is contained in:
parent
973d91d120
commit
dc786bd1cc
@ -1,10 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Zotlabs\Module;
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
require_once('include/channel.php');
|
use Zotlabs\Web\Controller;
|
||||||
|
|
||||||
|
require_once('include/security.php');
|
||||||
|
|
||||||
class Register extends \Zotlabs\Web\Controller {
|
class Register extends Controller {
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|
||||||
@ -39,7 +40,9 @@ class Register extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
|
|
||||||
function post() {
|
function post() {
|
||||||
|
|
||||||
|
check_form_security_token_redirectOnErr('/register', 'register');
|
||||||
|
|
||||||
$max_dailies = intval(get_config('system','max_daily_registrations'));
|
$max_dailies = intval(get_config('system','max_daily_registrations'));
|
||||||
if($max_dailies) {
|
if($max_dailies) {
|
||||||
$r = q("select count(account_id) as total from account where account_created > %s - INTERVAL %s",
|
$r = q("select count(account_id) as total from account where account_created > %s - INTERVAL %s",
|
||||||
@ -269,7 +272,8 @@ class Register extends \Zotlabs\Web\Controller {
|
|||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
|
|
||||||
$o = replace_macros(get_markup_template('register.tpl'), array(
|
$o = replace_macros(get_markup_template('register.tpl'), array(
|
||||||
|
|
||||||
|
'$form_security_token' => get_form_security_token("register"),
|
||||||
'$title' => t('Registration'),
|
'$title' => t('Registration'),
|
||||||
'$reg_is' => $registration_is,
|
'$reg_is' => $registration_is,
|
||||||
'$registertext' => bbcode(get_config('system','register_text')),
|
'$registertext' => bbcode(get_config('system','register_text')),
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="section-content-wrapper">
|
<div class="section-content-wrapper">
|
||||||
<form action="register" method="post" id="register-form">
|
<form action="register" method="post" id="register-form">
|
||||||
|
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
|
||||||
{{if $reg_is}}
|
{{if $reg_is}}
|
||||||
<div class="section-content-warning-wrapper">
|
<div class="section-content-warning-wrapper">
|
||||||
<div id="register-desc" class="descriptive-paragraph">{{$reg_is}}</div>
|
<div id="register-desc" class="descriptive-paragraph">{{$reg_is}}</div>
|
||||||
|
Reference in New Issue
Block a user