Esempio n. 1
0
 /**
  * Lookup Session ID by CAS service ticket.
  *
  * @param string $ticket
  *   A service ticket value from CAS to lookup in the database.
  *
  * @return string
  *   The session ID corresponding to the session ticket.
  *
  * @codeCoverageIgnore
  */
 private function lookupSessionIdByServiceTicket($ticket)
 {
     $result = $this->connection->select('cas_login_data', 'c')->fields('c', array('plainsid'))->condition('ticket', $ticket)->execute()->fetch();
     if (!empty($result)) {
         return $result->plainsid;
     }
 }
Esempio n. 2
0
 /**
  * Trigger an exception to test the PDO exception handler.
  */
 public function triggerPDOException()
 {
     define('SIMPLETEST_COLLECT_ERRORS', FALSE);
     $this->database->query('SELECT * FROM bananas_are_awesome');
 }
 /**
  * Displays a list of nodes.
  */
 public function index()
 {
     // query the database
     $result = $this->database->query('SELECT * from {node} WHERE nid = 1')->fetchAll();
     return ['#type' => 'markup', '#markup' => json_encode($result)];
 }