From b885fedee17c575207f45eba251c7acd549bca9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Wed, 18 Apr 2012 07:36:48 +0000 Subject: [PATCH] XSRF protection and PHPdoc for mod/admin.php --- mod/admin.php | 17 +++++++++++++---- view/admin_plugins.tpl | 2 +- view/admin_plugins_details.tpl | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index 8cee6ed5b2..cdc45c8e38 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -616,6 +616,8 @@ function admin_page_plugins(&$a){ } if (x($_GET,"a") && $_GET['a']=="t"){ + check_form_security_token_redirectOnErr('/admin/plugins', 'admin_themes', 't'); + // Toggle plugin status $idx = array_search($plugin, $a->plugins); if ($idx !== false){ @@ -673,7 +675,9 @@ function admin_page_plugins(&$a){ '$admin_form' => $admin_form, '$function' => 'plugins', '$screenshot' => '', - '$readme' => $readme + '$readme' => $readme, + + '$form_security_token' => get_form_security_token("admin_themes"), )); } @@ -702,7 +706,8 @@ function admin_page_plugins(&$a){ '$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(true), '$function' => 'plugins', - '$plugins' => $plugins + '$plugins' => $plugins, + '$form_security_token' => get_form_security_token("admin_themes"), )); } @@ -810,6 +815,7 @@ function admin_page_themes(&$a){ } if (x($_GET,"a") && $_GET['a']=="t"){ + check_form_security_token_redirectOnErr('/admin/themes', 'admin_themes', 't'); // Toggle theme status @@ -873,7 +879,9 @@ function admin_page_themes(&$a){ '$str_author' => t('Author: '), '$str_maintainer' => t('Maintainer: '), '$screenshot' => $screenshot, - '$readme' => $readme + '$readme' => $readme, + + '$form_security_token' => get_form_security_token("admin_themes"), )); } @@ -899,7 +907,8 @@ function admin_page_themes(&$a){ '$function' => 'themes', '$plugins' => $xthemes, '$experimental' => t('[Experimental]'), - '$unsupported' => t('[Unsupported]') + '$unsupported' => t('[Unsupported]'), + '$form_security_token' => get_form_security_token("admin_themes"), )); } diff --git a/view/admin_plugins.tpl b/view/admin_plugins.tpl index 8367ff6a1d..74b56bb4e9 100644 --- a/view/admin_plugins.tpl +++ b/view/admin_plugins.tpl @@ -4,7 +4,7 @@