From: tokul Date: Tue, 4 May 2004 11:01:03 +0000 (+0000) Subject: added index.php in order to prevent indexing of directory. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b11fe0462e9ecdb480ffa02d0ba9cd546140ab6f;p=squirrelmail.git added index.php in order to prevent indexing of directory. added functions that prevent use of plugin when it is not enabled fixed html formating errors and converted tags to lowercase. added some phpdoc blocks. converted strings to gettext git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7358 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/plugins/info/functions.php b/plugins/info/functions.php index 412a2d89..3a20afb8 100644 --- a/plugins/info/functions.php +++ b/plugins/info/functions.php @@ -1,25 +1,27 @@ -$value) { @@ -50,5 +59,18 @@ function print_response($response) { } } } - -?> + +/** + * Check if plugin is enabled + * @param string $plugin_name plugin name + * @return boolean + */ +function is_plugin_enabled($plugin_name) { + global $plugins; + if ( in_array($plugin_name,$plugins) ) { + return true; + } else { + return false; + } +} +?> \ No newline at end of file diff --git a/plugins/info/index.php b/plugins/info/index.php new file mode 100644 index 00000000..71c851b5 --- /dev/null +++ b/plugins/info/index.php @@ -0,0 +1,17 @@ + diff --git a/plugins/info/options.php b/plugins/info/options.php index fc78d8d0..e18ea2ff 100644 --- a/plugins/info/options.php +++ b/plugins/info/options.php @@ -1,16 +1,13 @@ "; + echo _("Plugin is disabled."); + echo "

"; + exit; +} + /* GLOBALS */ -sqgetGlobalVar('username', $username, SQ_SESSION); -sqgetGlobalVar('key', $key, SQ_COOKIE); -sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); +sqgetGlobalVar('username', $username, SQ_SESSION); +sqgetGlobalVar('key', $key, SQ_COOKIE); +sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); sqgetGlobalVar('submit', $submit, SQ_POST); @@ -60,25 +69,29 @@ $list = array ( 'TEST_8', 'TEST_9'); -print "
IMAP server information

\n"; -print "

\n"; -print "
\n"; -print "
Server Capability response:
\n"; +print "
"; +echo _("IMAP server information"); +print "

\n"; +print "
"; +print "

\n"; +print "
\n"; +print "
"; +echo _("Server Capability response:"); +print "
\n"; foreach($caps_array[0] as $value) { print htmlspecialchars($value); } -print "
\n"; +print "
\n"; if (!isset($submit) || $submit == 'default') { - print "
Select the IMAP commands you would like to run. - Most commands require a selected mailbox so the select command is already setup. - You can clear all the commands and test your own IMAP command strings. The commands are - executed in order. The default values are simple IMAP commands using your default_charset - and folder_prefix from SquirrelMail when needed.

-
NOTE: These commands are live, any changes made will effect your current - email account.

\n"; + print "

"; + echo _("Select the IMAP commands you would like to run. Most commands require a selected mailbox so the select command is already setup. You can clear all the commands and test your own IMAP command strings. The commands are executed in order. The default values are simple IMAP commands using your default_charset and folder_prefix from SquirrelMail when needed."); + echo "

\n"; + echo "

"; + echo _("NOTE: These commands are live, any changes made will effect your current email account."); + echo "


\n"; if (!isset($submit)) { $submit = ''; } @@ -118,21 +131,23 @@ elseif (!$submit || $submit == 'default') { 'TEST_9' => ""); } -print "
\n"; -print "
\n"; -print "\n"; -print "
SelectTest NameIMAP command string
\n"; +print "\n"; +print "
\n"; +echo "\n"; +print "\n
" . _("Select") . + "" . _("Test Name") . + "" . _("IMAP command string") . "
"; foreach($type as $index=>$value) { - print "
\n$index\n"; + print ">$index\n"; print addInput($index, $value, 60); } @@ -141,7 +156,7 @@ print "
". addSubmit('submit','submit'). addSubmit('clear','submit'). addSubmit('default','submit'). - "

\n"; + "
\n"; $tests = array(); @@ -154,19 +169,26 @@ if ($submit == 'submit') { } } for ($i=0;$i\n"; - print ""; - print "\n"; + print "
".$tests[$i]."
Request:
\n"; + print "\n"; + print "\n"; $response = imap_test($imap_stream, $type[$tests[$i]]); - print "\n"; - print "\n"; + print "
".$tests[$i]."
"; + echo _("Request:") . "
Response:
"; + print "
"; + echo _("Response:") . "
"; print_response($response); - print "

\n"; + print "

\n"; } } - print "
"; + print "
"; sqimap_logout($imap_stream); - do_hook('info_bottom'); + +/** + * Optional hook in info plugin + * + * Hook allows attaching plugin to bottom of info plugin + */ +do_hook('info_bottom'); ?> + \ No newline at end of file diff --git a/plugins/info/setup.php b/plugins/info/setup.php index 35919878..5340c0af 100644 --- a/plugins/info/setup.php +++ b/plugins/info/setup.php @@ -1,12 +1,11 @@ +?> \ No newline at end of file