Skip to content

Commit

Permalink
Use session token instead of Horde_Token
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Nov 5, 2013
1 parent a155547 commit a3fc983
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions ingo/lib/Basic/Base.php
Expand Up @@ -22,7 +22,7 @@
*/
abstract class Ingo_Basic_Base
{
const INGO_TOKEN = 'ingo.token';
const INGO_TOKEN = 'ingo_token';

/**
* @var string
Expand Down Expand Up @@ -77,14 +77,9 @@ public function status()
*/
protected function _addToken(Horde_Url $url)
{
global $injector;
global $session;

$url->add(
'ingo_token',
$injector->getInstance('Horde_Token')->get(self::INGO_TOKEN)
);

return $url;
return $url->add(self::INGO_TOKEN, $session->getToken());
}

/**
Expand All @@ -96,7 +91,7 @@ protected function _addToken(Horde_Url $url)
*/
protected function _checkToken($actions)
{
global $injector, $notification;
global $notification, $session;

$actionID = $this->vars->actionID;

Expand All @@ -105,11 +100,8 @@ protected function _checkToken($actions)
strlen($actionID) &&
in_array($actionID, $actions)) {
try {
$injector->getInstance('Horde_Token')->validate(
$this->vars->ingo_token,
self::INGO_TOKEN
);
} catch (Horde_Token_Exception $e) {
$session->checkToken($this->vars->get(self::INGO_TOKEN));
} catch (Horde_Exception $e) {
$notification->push($e);
$actionID = null;
}
Expand Down

0 comments on commit a3fc983

Please sign in to comment.