Skip to content

Commit

Permalink
Remove Horde_Token dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Nov 4, 2013
1 parent 305185f commit 96ae8a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
21 changes: 8 additions & 13 deletions imp/lib/Basic/Compose.php
Expand Up @@ -66,8 +66,6 @@ protected function _init()
$identity->setDefault($this->vars->identity);
}

$horde_token = $injector->getInstance('Horde_Token');

if ($this->vars->actionID) {
switch ($this->vars->actionID) {
case 'draft':
Expand Down Expand Up @@ -104,12 +102,9 @@ protected function _init()
/* Check for duplicate submits. */
if ($reload = $this->vars->compose_formToken) {
try {
if (!$horde_token->verify($reload)) {
$notification->push(_("You have already submitted this page."), 'horde.error');
$this->vars->actionID = null;
}
} catch (Horde_Token_Exception $e) {
$notification->push($e->getMessage());
$session->checkNonce($reload);
} catch (Horde_Exception $e) {
$notification->push(_("You have already submitted this page."), 'horde.error');
$this->vars->actionID = null;
}
}
Expand Down Expand Up @@ -508,7 +503,7 @@ protected function _init()
if ($this->vars->actionID == 'auto_save_draft') {
$r = new stdClass;
$r->requestToken = $session->getToken();
$r->formToken = Horde_Token::generateId('compose');
$r->formToken = $session->getNonce();

$response = new Horde_Core_Ajax_Response_HordeCore($r);
$response->sendAndExit();
Expand Down Expand Up @@ -629,7 +624,7 @@ protected function _init()
if ($resume || count($imp_compose)) {
$cancel_url = self::url()->setRaw(true)->add(array(
'actionID' => 'cancel_compose',
'compose_requestToken' => $horde_token->get('imp.compose'),
'compose_requestToken' => $session->getToken(),
'composeCache' => $composeCacheID,
'popup' => 1
));
Expand All @@ -641,7 +636,7 @@ protected function _init()
} elseif ($resume || count($imp_compose)) {
$cancel_url = $this->_mailboxReturnUrl(self::url()->setRaw(true))->setRaw(true)->add(array(
'actionID' => 'cancel_compose',
'compose_requestToken' => $horde_token->get('imp.compose'),
'compose_requestToken' => $session->getToken(),
'composeCache' => $composeCacheID
));
$discard_url = clone $cancel_url;
Expand Down Expand Up @@ -759,7 +754,7 @@ protected function _init()
/* Prepare the redirect template. */
$view->cacheid = $composeCacheID;
$view->title = $this->title;
$view->token = $horde_token->get('imp.compose');
$view->token = $session->getToken();

if ($registry->hasMethod('contacts/search')) {
$view->abook = $blank_url->copy()->link(array(
Expand All @@ -780,7 +775,7 @@ protected function _init()
$hidden = array(
'actionID' => '',
'attachmentAction' => '',
'compose_formToken' => Horde_Token::generateId('compose'),
'compose_formToken' => $session->getNonce(),
'compose_requestToken' => $session->getToken(),
'composeCache' => $composeCacheID,
'oldrtemode' => $rtemode,
Expand Down
7 changes: 0 additions & 7 deletions imp/package.xml
Expand Up @@ -1382,13 +1382,6 @@
<max>3.0.0alpha1</max>
<exclude>3.0.0alpha1</exclude>
</package>
<package>
<name>Horde_Token</name>
<channel>pear.horde.org</channel>
<min>2.0.0</min>
<max>3.0.0alpha1</max>
<exclude>3.0.0alpha1</exclude>
</package>
<package>
<name>Horde_Tree</name>
<channel>pear.horde.org</channel>
Expand Down

0 comments on commit 96ae8a6

Please sign in to comment.