Skip to content

Commit

Permalink
Can't use expiring tokens for contents information
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Nov 3, 2013
1 parent 5757693 commit 12e6bdc
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions imp/lib/Contents/View.php
Expand Up @@ -22,7 +22,6 @@
*/
class IMP_Contents_View
{
const VIEW_TOKEN = 'imp.view';
const VIEW_TOKEN_PARAM = 'view_token';

/**
Expand Down Expand Up @@ -323,16 +322,11 @@ public function printAttach($id)
*
* @param Horde_Variables $vars Form variables.
*
* @throws Horde_Token_Exception Exception on incorrect token.
* @throws Horde_Exception Exception on incorrect token.
*/
public function checkToken(Horde_Variables $vars)
{
global $injector;

$injector->getInstance('Horde_Token')->validate(
$vars->get(self::VIEW_TOKEN_PARAM),
self::VIEW_TOKEN
);
$GLOBALS['session']->checkToken($vars->get(self::VIEW_TOKEN_PARAM));
}

/* Static methods. */
Expand Down Expand Up @@ -365,10 +359,9 @@ static public function downloadUrl($filename, array $params = array())
*/
static public function addToken(array $params = array())
{
global $injector;
global $session;

$params[self::VIEW_TOKEN_PARAM] =
$injector->getInstance('Horde_Token')->get(self::VIEW_TOKEN);
$params[self::VIEW_TOKEN_PARAM] = $session->getToken();

return $params;
}
Expand Down

0 comments on commit 12e6bdc

Please sign in to comment.