Add a new hook to the plugin to enable backends to perform any
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 17 Nov 2003 22:04:31 +0000 (22:04 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 17 Nov 2003 22:04:31 +0000 (22:04 +0000)
specific checks before starting. Fix a bug in the Location:
redirect which redirected the user back to the plugin, which
should have been the general options page.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6175 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/change_password/backend/template.php
plugins/change_password/functions.php
plugins/change_password/options.php

index 2669fc2..73bd20f 100644 (file)
 global $squirrelmail_plugin_hooks;
 $squirrelmail_plugin_hooks['change_password_dochange']['template'] = 
        'cpw_template_dochange';
+$squirrelmail_plugin_hooks['change_password_init']['template'] = 
+       'cpw_template_init';
+
+
+/**
+ * Use this function to do any backend-specific initialization,
+ * e.g. checking requirements, before the password change form
+ * is displayed to the user.
+ */
+function cpw_template_init()
+{
+
+}
+
 
 /**
  * This is the function that is specific to your backend. It takes
index 3bd0a0f..e9cf52f 100644 (file)
@@ -90,6 +90,6 @@ function cpw_do_change()
 
     /* make sure we write the session data before we redirect */
     session_write_close();
-    header('Location: '.get_location(). '/options.php?optmode=submit&plugin_change_password=1');
+    header('Location: '.SM_PATH. 'src/options.php?optmode=submit&plugin_change_password=1');
     exit;
 }
index 3134c30..c1ee8c7 100644 (file)
@@ -19,6 +19,7 @@ if(sqgetGlobalVar('cpw_go', $cpw_go, SQ_POST)) {
 
 displayPageHeader($color, 'None');
 
+do_hook('change_password_init');
 ?>
 
 <br />