fsf changes, meant to be rebased on upstream
[squirrelmail.git] / plugins / change_password / backend / template.php
index 7d818be6d757c9644079515f70f626149d9466c9..f79fc3e49980dd12500bfac162310d66ed0a2e67 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * Change password backend template
  *
@@ -9,6 +10,8 @@
  *
  * Replace the word template everywhere with a name for your backend.
  *
+ * @copyright 2003-2022 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
  * @subpackage change_password
  * Define here the name of your password changing function.
  */
 global $squirrelmail_plugin_hooks;
-$squirrelmail_plugin_hooks['change_password_dochange']['template'] = 
-       'cpw_template_dochange';
-$squirrelmail_plugin_hooks['change_password_init']['template'] = 
-       'cpw_template_init';
+$squirrelmail_plugin_hooks['change_password_dochange']['template'] =
+        'cpw_template_dochange';
+$squirrelmail_plugin_hooks['change_password_init']['template'] =
+        'cpw_template_init';
 
 
 /**
@@ -36,7 +39,13 @@ $squirrelmail_plugin_hooks['change_password_init']['template'] =
  */
 function cpw_template_init()
 {
+    global $oTemplate;
 
+    // plugin is not configured. Handle error gracefully.
+    error_box(_("No valid backend defined."));
+    // close html and stop script execution
+    $oTemplate->display('footer.tpl');
+    exit();
 }
 
 
@@ -50,7 +59,7 @@ function cpw_template_init()
  * CPW_CURRENT_NOMATCH -> "Your current password is not correct."
  * CPW_INVALID_PW -> "Your new password contains invalid characters."
  *
- * @param array data The username/currentpw/newpw data. 
+ * @param array data The username/currentpw/newpw data.
  * @return array Array of error messages.
  */
 function cpw_template_dochange($data)
@@ -68,4 +77,4 @@ function cpw_template_dochange($data)
     user_error('No valid backend defined: this is just a template', E_USER_ERROR);
 
     return $msgs;
-}
+}
\ No newline at end of file