Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
base_native.php
01 <?php
02 /**
03 *
04 * This file is part of the phpBB Forum Software package.
05 *
06 * @copyright (c) phpBB Limited <https://www.phpbb.com>
07 * @license GNU General Public License, version 2 (GPL-2.0)
08 *
09 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13
14 namespace phpbb\passwords\driver;
15
16 abstract class base_native extends base
17 {
18 /**
19 * Return the constant name for this driver's algorithm
20 *
21 * @link https://www.php.net/manual/en/password.constants.php
22 *
23 * @return string
24 */
25 abstract public function get_algo_name();
26
27 /**
28 * Return the options set for this driver instance
29 *
30 * @return array
31 */
32 abstract public function get_options();
33
34 /**
35 * {@inheritdoc}
36 */
37 public function check($password, $hash, $user_row = [])
38 {
39 return password_verify($password, $hash);
40 }
41
42 /**
43 * Return the value for this driver's algorithm
44 *
45 * @return integer
46 */
47 public function get_algo_value()
48 {
49 return constant($this->get_algo_name());
50 }
51
52 /**
53 * {@inheritdoc}
54 */
55 public function hash($password)
56 {
57 return password_hash($password, $this->get_algo_value(), $this->get_options());
58 }
59
60 /**
61 * {@inheritdoc}
62 */
63 public function is_supported()
64 {
65 return defined($this->get_algo_name()) && function_exists('password_hash') && function_exists('password_needs_rehash') && function_exists('password_verify');
66 }
67
68 /**
69 * {@inheritdoc}
70 */
71 public function needs_rehash($hash)
72 {
73 return password_needs_rehash($hash, $this->get_algo_value(), $this->get_options());
74 }
75 }
76