Plugins like listcommands should not close their own pages without displaying errors...
[squirrelmail.git] / plugins / change_password / backend / peardb.php
index e3d10413d9061b600d01f46f4e7827843a54a453..26af70d67ec90e6f4e6cddfecaf4685e7376e26f 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * Change password PearDB backend
  *
- * @copyright © 2005-2006 The SquirrelMail Project Team
+ * @copyright © 2005-2007 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -106,19 +106,19 @@ $squirrelmail_plugin_hooks['change_password_init']['peardb'] =
  * Checks if configuration is correct
  */
 function cpw_peardb_init() {
-    global $color, $cpw_peardb_detect, $cpw_peardb_dsn, $cpw_peardb_table;
+    global $oTemplate, $cpw_peardb_detect, $cpw_peardb_dsn, $cpw_peardb_table;
 
     if (! $cpw_peardb_detect) {
-        error_box(_("Plugin is unable to use PHP Pear DB libraries. PHP Pear includes must be available in your PHP include_path setting."),$color);
-        echo "</body></html>\n";
+        error_box(_("Plugin is unable to use PHP Pear DB libraries. PHP Pear includes must be available in your PHP include_path setting."));
+        $oTemplate->display('footer.tpl');
         exit();
     }
 
     // Test required settings
     if ((is_string($cpw_peardb_dsn) && trim($cpw_peardb_dsn)=='')
         || trim($cpw_peardb_table)=='' ) {
-        error_box(_("Required change password backend configuration options are missing."),$color);
-        echo "</body></html>\n";
+        error_box(_("Required change password backend configuration options are missing."));
+        $oTemplate->display('footer.tpl');
         exit();
     }
 }
@@ -431,4 +431,3 @@ function cpw_peardb_passwd_hash($password,$crypto,&$msgs,$forced_salt='') {
     }
     return $ret;
 }
-?>
\ No newline at end of file