Skip to content

Commit

Permalink
Fixed bug with link to controller in protected tags public forms
Browse files Browse the repository at this point in the history
  • Loading branch information
jbogdani committed Jun 4, 2021
1 parent 3c2081e commit 205f9a8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
14 changes: 9 additions & 5 deletions modules/protectedtags/protectedtags.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class protectedtags_ctrl extends Controller
public function sendemail_form()
{
$this->render('protectedtags', 'email_form', array(
'all_tags' => protectedTags::getData('tags')
'all_tags' => protectedTags::getData('tags'),
"link2home" => link::format('home')
));
}

Expand Down Expand Up @@ -275,11 +276,12 @@ public function loginForm($css)
if (!$_SESSION['token']) {
$_SESSION['token'] = md5(uniqid(rand(), true));
}

$this->render('protectedtags', 'login_form', array(
'token' => $_SESSION['token'],
'grc_sitekey' => protectedTags::isCaptchaEnabled() ? cfg::get('grc_sitekey') : false,
'css' => $css
'css' => $css,
"link2home" => link::format('home')
));
}

Expand All @@ -296,7 +298,8 @@ public function registerForm($tag, $css)
'grc_sitekey' => protectedTags::isCaptchaEnabled() ? cfg::get('grc_sitekey') : false,
'tag' => $tag,
'css' => $css,
'mode' => is_array($ar) ? $ar[$tag]['mode'] : false
'mode' => is_array($ar) ? $ar[$tag]['mode'] : false,
"link2home" => link::format('home')
));
}

Expand All @@ -311,7 +314,8 @@ public function logoutButton($css)
{
if ($_SESSION['user_email']) {
$this->render('protectedtags', 'logout_button', array(
'css' => $css
'css' => $css,
"link2home" => link::format('home')
));
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/protectedtags/tmpl/email_form.twig
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ form.on('submit', function(){
$('#{{ uid }} .loading').show();
$.post(
'controller.php?obj=protectedtags_ctrl&method=send_email',
'{{ link2home }}controller.php?obj=protectedtags_ctrl&method=send_email',
form.serialize(), function(data){
$('#{{ uid }} .loading').hide();
$('#{{ uid }} .results').html(
Expand Down
2 changes: 1 addition & 1 deletion modules/protectedtags/tmpl/login_form.twig
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ $('#loginform').on('submit', function(){
form.find('.form_err').text('{{ tr.get('password_required') }}');
return false;
}
$.post('controller.php?obj=protectedtags_ctrl&method=login', form.serialize(), function(data){
$.post('{{ link2home }}controller.php?obj=protectedtags_ctrl&method=login', form.serialize(), function(data){
if (data.status === 'success'){
window.location.reload(false);
window.scrollTo(0,0);
Expand Down
2 changes: 1 addition & 1 deletion modules/protectedtags/tmpl/logout_button.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (!window.jQuery){
return;
}
$('#logoutbutton').on('click', function(){
$.get('controller.php?obj=protectedtags_ctrl&method=logout', function(data){
$.get('{{ link2home }}controller.php?obj=protectedtags_ctrl&method=logout', function(data){
if (data.status === 'success'){
location.reload();
}
Expand Down
2 changes: 1 addition & 1 deletion modules/protectedtags/tmpl/register.twig
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ if (typeof recaptchaCallback !== 'function') {
} else {
return false;
}
$.post('controller.php?obj=protectedtags_ctrl&method=login', $(this).serialize(), function(data){
$.post('{{ link2home }}controller.php?obj=protectedtags_ctrl&method=login', $(this).serialize(), function(data){
if (data.status === 'success'){
{% if mode == 'dont_confirm' %}
window.location.reload();
Expand Down
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
5.5.13[] = "Fixed bug with link to controller in protected tags public forms"
5.5.12[] = "Fixed issue with serach string not being url_decoded"
5.5.11[] = "Fixed issue with tr.sget in templates"
5.5.10[] = "Intellisense suggestions fixed"
Expand Down

0 comments on commit 205f9a8

Please sign in to comment.