Added configtest hook
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 5 Sep 2007 23:44:27 +0000 (23:44 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 5 Sep 2007 23:44:27 +0000 (23:44 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12678 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/demo/functions.php
plugins/demo/setup.php

index 230df743c1f71f4579a6ff6b63c755744b45b7c7..04bacc282e805d5625e9abf213620e2a99ffa9f2 100644 (file)
@@ -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;
+
+}
+
+
+
index 0d92dc0ec59cbb6486caf051e79d2c5286a32dbd..14db1594150ae01894ad362ae8c4b9fc9e79e93e 100644 (file)
@@ -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();
+}
+
+
+