X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fchange_password%2Fbackend%2Fvmailmgrd.php;h=2d3e2cf58efc7a8f516a312c2ecb10ce7ee59a87;hp=c22d076d0fff54ff6899a357b3e5adc16b06e4e1;hb=701e7beed3baca980039f978c6d536dd91cae775;hpb=c683d87f10ef8febd3a5228e80d5ebc7b46343d8 diff --git a/plugins/change_password/backend/vmailmgrd.php b/plugins/change_password/backend/vmailmgrd.php index c22d076d..2d3e2cf5 100644 --- a/plugins/change_password/backend/vmailmgrd.php +++ b/plugins/change_password/backend/vmailmgrd.php @@ -1,4 +1,5 @@ + * @author Tomas Kuliavas + * @copyright 2005-2014 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @link http://www.vmailmgr.org vmailmgr site * @package plugins @@ -101,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 "\n"; + $oTemplate->display('footer.tpl'); exit(); } @@ -126,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 "\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 "\n"; + $oTemplate->display('footer.tpl'); exit(); } } @@ -294,4 +286,3 @@ function cpw_i18n_vmail_response($string) { } return $ret; } -?> \ No newline at end of file