mirror of
https://github.com/friendica/friendica
synced 2025-04-26 11:10:11 +00:00
Normalize use of form security tokens in Admin modules
# Conflicts: # src/Module/Admin/Logs/Settings.php
This commit is contained in:
parent
2ce15cae1a
commit
9bc2c5a52e
12 changed files with 43 additions and 39 deletions
|
@ -42,6 +42,8 @@ class Details extends BaseAdmin
|
|||
include_once 'addon/' . $addon . '/' . $addon . '.php';
|
||||
|
||||
if (function_exists($addon . '_addon_admin_post')) {
|
||||
self::checkFormSecurityTokenRedirectOnError($redirect, 'admin_addons_details');
|
||||
|
||||
$func = $addon . '_addon_admin_post';
|
||||
$func(DI::app());
|
||||
}
|
||||
|
@ -66,7 +68,7 @@ class Details extends BaseAdmin
|
|||
}
|
||||
|
||||
if (($_GET['action'] ?? '') == 'toggle') {
|
||||
self::checkFormSecurityTokenRedirectOnError('/admin/addons', 'admin_addons', 't');
|
||||
self::checkFormSecurityTokenRedirectOnError('/admin/addons', 'admin_addons_details', 't');
|
||||
|
||||
// Toggle addon status
|
||||
if (Addon::isEnabled($addon)) {
|
||||
|
@ -124,7 +126,7 @@ class Details extends BaseAdmin
|
|||
'$screenshot' => '',
|
||||
'$readme' => $readme,
|
||||
|
||||
'$form_security_token' => self::getFormSecurityToken('admin_addons'),
|
||||
'$form_security_token' => self::getFormSecurityToken('admin_addons_details'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ class Index extends BaseAdmin
|
|||
|
||||
// reload active themes
|
||||
if (!empty($_GET['action'])) {
|
||||
parent::checkFormSecurityTokenRedirectOnError('/admin/addons', 'admin_addons', 't');
|
||||
self::checkFormSecurityTokenRedirectOnError('/admin/addons', 'admin_addons', 't');
|
||||
|
||||
switch ($_GET['action']) {
|
||||
case 'reload':
|
||||
|
@ -73,7 +73,7 @@ class Index extends BaseAdmin
|
|||
'$addons' => $addons,
|
||||
'$pcount' => count($addons),
|
||||
'$noplugshint' => DI::l10n()->t('There are currently no addons available on your node. You can find the official addon repository at %1$s and might find other interesting addons in the open addon registry at %2$s', 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
|
||||
'$form_security_token' => parent::getFormSecurityToken('admin_addons'),
|
||||
'$form_security_token' => self::getFormSecurityToken('admin_addons'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue