ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PDO.php
Go to the documentation of this file.
1<?php
2
4
12class PDO extends AbstractDigest {
13
19 protected $pdo;
20
26 public $tableName = 'users';
27
28
36 function __construct(\PDO $pdo) {
37
38 $this->pdo = $pdo;
39
40 }
41
49 function getDigestHash($realm, $username) {
50
51 $stmt = $this->pdo->prepare('SELECT digesta1 FROM ' . $this->tableName . ' WHERE username = ?');
52 $stmt->execute([$username]);
53 return $stmt->fetchColumn() ?: null;
54
55 }
56
57}
An exception for terminatinating execution or to throw for unit testing.
HTTP Digest authentication backend class.
This is an authentication backend that uses a database to manage passwords.
Definition: PDO.php:12
__construct(\PDO $pdo)
Creates the backend object.
Definition: PDO.php:36
getDigestHash($realm, $username)
Returns the digest hash for a user.
Definition: PDO.php:49
$stmt