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 2669fc2248ad0200887070b0bd545d9d745d9b51..73bd20f2408c222bade1952e2204e68a8a823657 100644 (file)
 global $squirrelmail_plugin_hooks;
 $squirrelmail_plugin_hooks['change_password_dochange']['template'] = 
        'cpw_template_dochange';
 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
 
 /**
  * This is the function that is specific to your backend. It takes
index 3bd0a0f150ddbba9421d9fa9f2fad32e6dd65b2d..e9cf52f48887f3e213dcde0270b034a83e105201 100644 (file)
@@ -90,6 +90,6 @@ function cpw_do_change()
 
     /* make sure we write the session data before we redirect */
     session_write_close();
 
     /* 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;
 }
     exit;
 }
index 3134c306a2d202cccbfaafb7d9d4fcc08fef31d2..c1ee8c7e6c2a1098df7c86d2b9c5d5f2fdcc98fe 100644 (file)
@@ -19,6 +19,7 @@ if(sqgetGlobalVar('cpw_go', $cpw_go, SQ_POST)) {
 
 displayPageHeader($color, 'None');
 
 
 displayPageHeader($color, 'None');
 
+do_hook('change_password_init');
 ?>
 
 <br />
 ?>
 
 <br />