* @param string $driver
* @param string $app
* @param array $params
+ * @param boolean $full
*
* @return string
*/
- protected function _getUrl($driver, $app = 'horde', $params = array(), $full = false)
+ protected function _getUrl($driver, $app = 'horde', $params = array(),
+ $full = false)
{
$qstring = 'imple=' . $driver;
'password' => true,
'text' => $text,
'type' => $this->_params['type'],
- 'uri' => strval($this->_getUrl('PassphraseDialog', 'imp'))
+ 'uri' => strval($this->_getUrl('PassphraseDialog', 'imp', array('sessionWrite' => 1)))
);
Horde::addScriptFile('effects.js', 'horde');
switch ($vars->type) {
case 'pgpPersonal':
case 'pgpSymmetric':
- if ($this->_vars->dialog_input) {
+ if ($vars->dialog_input) {
$imp_pgp = $GLOBALS['injector']->getInstance('IMP_Crypt_Pgp');
if ((($vars->type == 'pgpPersonal') &&
- $imp_pgp->storePassphrase('personal', $this->_vars->dialog_input)) ||
+ $imp_pgp->storePassphrase('personal', $vars->dialog_input)) ||
(($vars->type == 'pgpSymmeetric') &&
- $imp_pgp->storePassphrase('symmetric', $this->_vars->dialog_input, $this->_vars->symmetricid))) {
+ $imp_pgp->storePassphrase('symmetric', $vars->dialog_input, $vars->symmetricid))) {
$result->success = 1;
} else {
$result->error = _("Invalid passphrase entered.");
break;
case 'smimePersonal':
- if ($this->_vars->dialog_input) {
+ if ($vars->dialog_input) {
$imp_smime = $GLOBALS['injector']->getInstance('IMP_Crypt_Smime');
- if ($imp_smime->storePassphrase($this->_vars->dialog_input)) {
+ if ($imp_smime->storePassphrase($vars->dialog_input)) {
$result->success = 1;
} else {
$result->error = _("Invalid passphrase entered.");
$result->error = $e->getMessage();
}
- return $result;
+ return Horde::prepareResponse($result);
}
/**
*
* @return boolean Returns true if correct passphrase, false if incorrect.
*/
- public function storePassphrase($type, $passphrase, $id)
+ public function storePassphrase($type, $passphrase, $id = null)
{
if ($type == 'personal') {
if ($this->verifyPassphrase($this->getPersonalPublicKey(), $this->getPersonalPrivateKey(), $passphrase) === false) {