mirror of
https://github.com/friendica/friendica
synced 2024-12-22 16:40:16 +00:00
Merge pull request #14347 from annando/contact-redirect
Improved redirect for contact actions
This commit is contained in:
commit
5ea3f9e6b7
3 changed files with 12 additions and 3 deletions
|
@ -58,7 +58,13 @@ class Contact extends BaseModule
|
|||
return;
|
||||
}
|
||||
|
||||
$redirectUrl = $_POST['redirect_url'] ?? 'contact';
|
||||
$redirectUrl = $_POST['command'] ?? '';
|
||||
if (substr($redirectUrl, 0, 7) != 'contact') {
|
||||
$redirectUrl = 'contact';
|
||||
}
|
||||
if (!empty($_POST['parameter'])) {
|
||||
$redirectUrl .= '?' . $_POST['parameter'];
|
||||
}
|
||||
|
||||
self::checkFormSecurityTokenRedirectOnError($redirectUrl, 'contact_batch_actions');
|
||||
|
||||
|
@ -459,6 +465,7 @@ class Contact extends BaseModule
|
|||
'$finding' => $searching ? DI::l10n()->t('Results for: %s', $search) : '',
|
||||
'$submit' => DI::l10n()->t('Find'),
|
||||
'$cmd' => DI::args()->getCommand(),
|
||||
'$parameter' => http_build_query($request),
|
||||
'$contacts' => $contacts,
|
||||
'$form_security_token' => BaseModule::getFormSecurityToken('contact_batch_actions'),
|
||||
'multiselect' => 1,
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
{{$tabs nofilter}}
|
||||
|
||||
<form action="{{$baseurl}}/contact/batch/" method="POST">
|
||||
<input type="hidden" name="redirect_url" value="{{$cmd}}" />
|
||||
<input type="hidden" name="command" value="{{$cmd}}" />
|
||||
<input type="hidden" name="parameter" value="{{$parameter}}" />
|
||||
<input type="hidden" name="form_security_token" value="{{$form_security_token}}" />
|
||||
{{foreach $contacts as $contact}}
|
||||
{{include file="contact/entry.tpl"}}
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
|
||||
{{* we need the form container to make batch actions work *}}
|
||||
<form name="batch_actions_submit" action="{{$baseurl}}/contact/batch/" method="POST">
|
||||
<input type="hidden" name="redirect_url" value="{{$cmd}}" />
|
||||
<input type="hidden" name="command" value="{{$cmd}}" />
|
||||
<input type="hidden" name="parameter" value="{{$parameter}}" />
|
||||
<input type="hidden" name="form_security_token" value="{{$form_security_token}}" />
|
||||
|
||||
{{* we put here a hidden input element. This is needed to transmit the batch actions with javascript*}}
|
||||
|
|
Loading…
Reference in a new issue