handle configuration error without displaying paths in error message.
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 29 Mar 2005 16:16:53 +0000 (16:16 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 29 Mar 2005 16:16:53 +0000 (16:16 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9158 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/change_password/backend/template.php

index 0417683388e53423d101f311df9f4e099d623546..ed4d94518ad91c3e306236f88f1bbe3f6a102a84 100644 (file)
@@ -36,7 +36,24 @@ $squirrelmail_plugin_hooks['change_password_init']['template'] =
  */
 function cpw_template_init()
 {
+    global $color;
 
+    /**
+     * If SM_PATH isn't defined, define it.  Required to include files.
+     * @ignore
+     */
+    if (!defined('SM_PATH'))  {
+        define('SM_PATH','../../../');
+    }
+
+    // load error_box() function
+    include_once(SM_PATH . 'functions/display_messages.php');
+
+    // plugin is not configured. Handle error gracefully.
+    error_box(_("No valid backend defined."),$color);
+    // close html and stop script execution
+    echo "</body></html>\n";
+    exit();
 }