From: pdontthink Date: Wed, 5 Sep 2007 23:44:27 +0000 (+0000) Subject: Added configtest hook X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6b5eb340a4231b7925456d47ca9b852ddd018c24;p=squirrelmail.git Added configtest hook git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12678 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/plugins/demo/functions.php b/plugins/demo/functions.php index 230df743..04bacc28 100644 --- a/plugins/demo/functions.php +++ b/plugins/demo/functions.php @@ -57,3 +57,28 @@ function demo_option_link_do() +/** + * Validate that this plugin is configured correctly + * + * @return boolean Whether or not there was a + * configuration error for this plugin. + * + */ +function demo_check_configuration_do() +{ + + // test for something that this plugin requires, print error if + // misconfigured or requirements are missing + // + if (FALSE) // put something meaningful here + { + do_err('Demo plugin is missing something important', FALSE); + return TRUE; // return FALSE if you only want to display a non-critical error + } + + return FALSE; + +} + + + diff --git a/plugins/demo/setup.php b/plugins/demo/setup.php index 0d92dc0e..14db1594 100644 --- a/plugins/demo/setup.php +++ b/plugins/demo/setup.php @@ -43,6 +43,8 @@ function squirrelmail_plugin_init_demo() $squirrelmail_plugin_hooks['optpage_register_block']['demo'] = 'demo_option_link'; + $squirrelmail_plugin_hooks['configtest']['demo'] + = 'demo_check_configuration'; } @@ -109,3 +111,18 @@ function demo_option_link() +/** + * Validate that this plugin is configured correctly + * + * @return boolean Whether or not there was a + * configuration error for this plugin. + * + */ +function demo_check_configuration() +{ + include_once(SM_PATH . 'plugins/demo/functions.php'); + return demo_check_configuration_do(); +} + + +