/** * Start the account deletion (ajax) */ function delete_account() { $this->rcmail->output->add_label('fetchmail_rc.delete_success', 'fetchmail_rc.delete_error', 'fetchmail_rc.noaccounts'); try { require_once dirname(__FILE__) . '/includes/fetchMailRc.php'; $id = get_input_value('_fetchmail_rc_id', RCUBE_INPUT_POST); $fetchmailRc = new fetchMailRc($id); $deleted = $fetchmailRc->delete(); } catch (Exception $e) { $this->rcmail->output->command('plugin.delete_error', array("error" => $e->getMessage())); $this->rcmail->output->send('plugin'); } if ($deleted) { $this->rcmail->output->command('plugin.delete_success', array("id" => $fetchmailRc->get_id())); $this->rcmail->output->send('plugin'); } else { $this->rcmail->output->command('plugin.delete_error', array()); $this->rcmail->output->send('plugin'); } }