mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-29 14:13:15 +00:00
Merge pull request #108 from unary/defaultfeaturesfix
default features - actually handle the security token in the addon code
This commit is contained in:
commit
876edda97f
1 changed files with 4 additions and 2 deletions
|
@ -27,7 +27,7 @@ function defaultfeatures_register($a, $newuid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function defaultfeatures_plugin_admin_post (&$a) {
|
function defaultfeatures_plugin_admin_post (&$a) {
|
||||||
check_form_security_token_redirectOnErr('/admin/plugins/defaultfeatures', 'admin_themes');
|
check_form_security_token_redirectOnErr('/admin/plugins/defaultfeatures', 'defaultfeaturessave');
|
||||||
foreach($_POST as $k => $v) {
|
foreach($_POST as $k => $v) {
|
||||||
if(strpos($k,'feature_') === 0) {
|
if(strpos($k,'feature_') === 0) {
|
||||||
set_config('defaultfeatures',substr($k,8),((intval($v)) ? 1 : 0));
|
set_config('defaultfeatures',substr($k,8),((intval($v)) ? 1 : 0));
|
||||||
|
@ -38,6 +38,7 @@ function defaultfeatures_plugin_admin_post (&$a) {
|
||||||
|
|
||||||
function defaultfeatures_plugin_admin (&$a, &$o) {
|
function defaultfeatures_plugin_admin (&$a, &$o) {
|
||||||
$t = get_markup_template( "admin.tpl", "addon/defaultfeatures/" );
|
$t = get_markup_template( "admin.tpl", "addon/defaultfeatures/" );
|
||||||
|
$token = get_form_security_token("defaultfeaturessave");
|
||||||
$arr = array();
|
$arr = array();
|
||||||
$features = get_features();
|
$features = get_features();
|
||||||
foreach($features as $fname => $fdata) {
|
foreach($features as $fname => $fdata) {
|
||||||
|
@ -52,6 +53,7 @@ function defaultfeatures_plugin_admin (&$a, &$o) {
|
||||||
|
|
||||||
$o = replace_macros($t, array(
|
$o = replace_macros($t, array(
|
||||||
'$submit' => t('Submit'),
|
'$submit' => t('Submit'),
|
||||||
'$features' => $arr
|
'$features' => $arr,
|
||||||
|
'$form_security_token' => $token
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue