From d257c4064f68d3c43ca3330b466eb4d7eaaa1165 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sun, 31 May 2009 07:40:07 -0400
Subject: [PATCH] - don't register body handler on plugin init (#1485888)
---
plugins/sasl_password/sasl_password.php | 4 +++-
plugins/password/password.php | 7 +++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/plugins/password/password.php b/plugins/password/password.php
index 0763e91..767ddab 100644
--- a/plugins/password/password.php
+++ b/plugins/password/password.php
@@ -90,13 +90,14 @@
$rcmail->output->add_label('password');
$this->register_action('plugin.password', array($this, 'password_init'));
$this->register_action('plugin.password-save', array($this, 'password_save'));
- $this->register_handler('plugin.body', array($this, 'password_form'));
$this->include_script('password.js');
}
function password_init()
{
$this->add_texts('localization/');
+ $this->register_handler('plugin.body', array($this, 'password_form'));
+
$rcmail = rcmail::get_instance();
$rcmail->output->set_pagetitle($this->gettext('changepasswd'));
$rcmail->output->send('plugin');
@@ -107,9 +108,11 @@
$rcmail = rcmail::get_instance();
$this->add_texts('localization/');
- $confirm = $rcmail->config->get('password_confirm_current');
+ $this->register_handler('plugin.body', array($this, 'password_form'));
$rcmail->output->set_pagetitle($this->gettext('changepasswd'));
+ $confirm = $rcmail->config->get('password_confirm_current');
+
if (($confirm && !isset($_POST['_curpasswd'])) || !isset($_POST['_newpasswd']))
$rcmail->output->command('display_message', $this->gettext('nopassword'), 'error');
else {
diff --git a/plugins/sasl_password/sasl_password.php b/plugins/sasl_password/sasl_password.php
index ed1624e..0152ec2 100644
--- a/plugins/sasl_password/sasl_password.php
+++ b/plugins/sasl_password/sasl_password.php
@@ -26,13 +26,14 @@
$rcmail->output->add_label('password');
$this->register_action('plugin.saslpassword', array($this, 'password_init'));
$this->register_action('plugin.saslpassword-save', array($this, 'password_save'));
- $this->register_handler('plugin.body', array($this, 'password_form'));
$this->include_script('sasl_password.js');
}
function password_init()
{
$this->add_texts('locale/');
+ $this->register_handler('plugin.body', array($this, 'password_form'));
+
$rcmail = rcmail::get_instance();
$rcmail->output->set_pagetitle($this->gettext('changepasswd'));
$rcmail->output->send('plugin');
@@ -43,6 +44,7 @@
$rcmail = rcmail::get_instance();
$this->add_texts('locale/');
+ $this->register_handler('plugin.body', array($this, 'password_form'));
if (!isset($_POST['_curpasswd']) || !isset($_POST['_newpasswd'])) {
$rcmail->output->command('display_message', $this->gettext('nopassword'), 'error');
--
Gitblit v1.9.1