| | |
| | | $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'); |
| | |
| | | $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'); |
| | |
| | | $curpwd = get_input_value('_curpasswd', RCUBE_INPUT_POST); |
| | | $newpwd = get_input_value('_newpasswd', RCUBE_INPUT_POST); |
| | | |
| | | if ($_SESSION['password'] != $rcmail->encrypt_passwd($curpwd)) { |
| | | if ($rcmail->decrypt($_SESSION['password']) != $curpwd) { |
| | | $rcmail->output->command('display_message', $this->gettext('passwordincorrect'), 'error'); |
| | | } |
| | | else if ($this->_save($newpwd)) { |
| | | $rcmail->output->command('display_message', $this->gettext('successfullysaved'), 'confirmation'); |
| | | $_SESSION['password'] = $rcmail->encrypt_passwd($newpwd); |
| | | $_SESSION['password'] = $rcmail->encrypt($newpwd); |
| | | } |
| | | else { |
| | | $rcmail->output->command('display_message', $this->gettext('errorsaving'), 'error'); |