You are here

public function CasProxyHelper::storePgtSession in CAS 8

Same name and namespace in other branches
  1. 2.x src/Service/CasProxyHelper.php \Drupal\cas\Service\CasProxyHelper::storePgtSession()

Store the PGT in the user session.

Parameters

string $pgt_iou: A pgtIou to identify the PGT.

File

src/Service/CasProxyHelper.php, line 232

Class

CasProxyHelper
Class CasProxyHelper.

Namespace

Drupal\cas\Service

Code

public function storePgtSession($pgt_iou) {
  $pgt = $this->connection
    ->select('cas_pgt_storage', 'c')
    ->fields('c', [
    'pgt',
  ])
    ->condition('pgt_iou', $pgt_iou)
    ->execute()
    ->fetch()->pgt;
  $this->session
    ->set('cas_pgt', $pgt);

  // Now that we have the pgt in the session,
  // we can delete the database mapping.
  $this->connection
    ->delete('cas_pgt_storage')
    ->condition('pgt_iou', $pgt_iou)
    ->execute();
}