From 9369e521bbe45c5be3e5342d14b0670c85f78a31 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 2 Jul 2015 20:57:06 -0700 Subject: a bit of cleanup and explanatory text on mod/pconfig --- mod/pconfig.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'mod/pconfig.php') diff --git a/mod/pconfig.php b/mod/pconfig.php index d6719792b..e0ceb5d22 100755 --- a/mod/pconfig.php +++ b/mod/pconfig.php @@ -24,7 +24,7 @@ function pconfig_post(&$a) { $v = trim($_POST['v']); if(in_array(argv(2),disallowed_pconfig())) { - notice( t('This setting requires special processing and has been blocked.') . EOL); + notice( t('This setting requires special processing and editing has been blocked.') . EOL); return; } @@ -45,18 +45,27 @@ function pconfig_content(&$a) { return login(); } + $content = '

' . t('Configuration Editor') . '

'; + $content .= '
' . t('Warning: Changing some settings could render your channel inoperable. Please leave this page unless you are comfortable with and knowledgeable about how to correctly use this feature.') . '
' . EOL . EOL; + if(argc() == 3) { - $content = 'pconfig[' . local_channel() . ']' . EOL; + $content .= 'pconfig[' . local_channel() . ']' . EOL; $content .= 'pconfig[' . local_channel() . '][' . escape_tags(argv(1)) . ']' . EOL . EOL; $content .= 'pconfig[' . local_channel() . '][' . escape_tags(argv(1)) . '][' . escape_tags(argv(2)) . '] = ' . get_pconfig(local_channel(),escape_tags(argv(1)),escape_tags(argv(2))) . EOL; - $content .= pconfig_form(escape_tags(argv(1)),escape_tags(argv(2))); + + if(in_array(argv(2),disallowed_pconfig())) { + notice( t('This setting requires special processing and editing has been blocked.') . EOL); + return $content; + } + else + $content .= pconfig_form(escape_tags(argv(1)),escape_tags(argv(2))); } if(argc() == 2) { - $content = 'pconfig[' . local_channel() . ']' . EOL; + $content .= 'pconfig[' . local_channel() . ']' . EOL; load_pconfig(local_channel(),escape_tags(argv(1))); foreach($a->config[local_channel()][escape_tags(argv(1))] as $k => $x) { $content .= 'pconfig[' . local_channel() . '][' . escape_tags(argv(1)) . '][' . $k . '] = ' . escape_tags($x) . EOL; @@ -65,8 +74,6 @@ function pconfig_content(&$a) { if(argc() == 1) { - $content = ''; - $r = q("select * from pconfig where uid = " . local_channel()); if($r) { foreach($r as $rr) { -- cgit v1.2.3