Update copyright
[squirrelmail.git] / plugins / change_password / backend / vmailmgrd.php
index b691a373d2c84774e3e738be41063e197ac5550d..1b30de4e0f7bcd254c0dd083226ac361356d1d9f 100644 (file)
@@ -22,7 +22,7 @@
  * v.1.5.1 and v.1.4.4.
  *
  * @author Tomas Kuliavas <tokul at users.sourceforge.net>
- * @copyright &copy; 2005 The SquirrelMail Project Team
+ * @copyright 2005-2013 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @link http://www.vmailmgr.org vmailmgr site
@@ -104,24 +104,13 @@ $squirrelmail_plugin_hooks['change_password_init']['vmailmgrd'] =
  * is displayed to the user.
  */
 function cpw_vmailmgrd_init(){
-    global $vmail_inc_path, $color, $username;
-
-    /**
-     * 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');
+    global $vmail_inc_path, $username, $oTemplate;
 
     if ($vmail_inc_path=='' || ! file_exists($vmail_inc_path)) {
         // $vmail_inc_path is not set or file does not exist
-        error_box(_("Incorrent path to vmail.inc file."),$color);
+        error_box(_("Incorrent path to vmail.inc file."));
         // close html and stop script execution
-        echo "</body></html>\n";
+        $oTemplate->display('footer.tpl');
         exit();
     }
 
@@ -129,17 +118,17 @@ function cpw_vmailmgrd_init(){
 
     if (! function_exists('vchpass')) {
         // included vmail.inc does not have required functions.
-        error_box(_("Invalid or corrupted vmail.inc file."),$color);
+        error_box(_("Invalid or corrupted vmail.inc file."));
         // close html and stop script execution
-        echo "</body></html>\n";
+        $oTemplate->display('footer.tpl');
         exit();
     }
 
     if (! preg_match("/(.*)\@(.*)/", $username)) {
         // username does not match vmailmgr syntax
-        error_box(_("Invalid user."),$color);
+        error_box(_("Invalid user."));
         // close html and stop script execution
-        echo "</body></html>\n";
+        $oTemplate->display('footer.tpl');
         exit();
     }
 }
@@ -297,4 +286,3 @@ function cpw_i18n_vmail_response($string) {
     }
     return $ret;
 }
-?>
\ No newline at end of file