From: kink Date: Mon, 17 Nov 2003 22:04:31 +0000 (+0000) Subject: Add a new hook to the plugin to enable backends to perform any X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5c34b0bbf0fc464baa22d6ae069d4b7bd305d2cf;p=squirrelmail.git Add a new hook to the plugin to enable backends to perform any 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 --- diff --git a/plugins/change_password/backend/template.php b/plugins/change_password/backend/template.php index 2669fc22..73bd20f2 100644 --- a/plugins/change_password/backend/template.php +++ b/plugins/change_password/backend/template.php @@ -19,6 +19,20 @@ 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 diff --git a/plugins/change_password/functions.php b/plugins/change_password/functions.php index 3bd0a0f1..e9cf52f4 100644 --- a/plugins/change_password/functions.php +++ b/plugins/change_password/functions.php @@ -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; } diff --git a/plugins/change_password/options.php b/plugins/change_password/options.php index 3134c306..c1ee8c7e 100644 --- a/plugins/change_password/options.php +++ b/plugins/change_password/options.php @@ -19,6 +19,7 @@ if(sqgetGlobalVar('cpw_go', $cpw_go, SQ_POST)) { displayPageHeader($color, 'None'); +do_hook('change_password_init'); ?>