/** * Return the desctructured token or part thereof. * * @param string $which - optional single item to return, otherwise returns all * @param string $accessKey - to decrypt token, must be supplied first time around or force by resupplying * * @throws Exception * @return array|null */ public function getTokenInfo($which = null, $accessKey = null) { $request = $this->owner->getRequest(); if ($token = $request->param(self::TokenParam)) { $detokenised = CheckfrontModule::decrypt_token($accessKey, $token); if (!is_null($which)) { if (!array_key_exists($which, $detokenised)) { return null; } return $detokenised[$which]; } return $detokenised; } else { throw new CheckfrontException("No token", CheckfrontException::TypeError); } }