mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 05:18:52 +00:00
Merge pull request #2087 from marc1706/ticket/12239
[ticket/12239] Move deprecated passwords functions to compatibility file
This commit is contained in:
commit
c40b15ae19
3 changed files with 36 additions and 36 deletions
|
@ -367,41 +367,6 @@ function still_on_time($extra_time = 15)
|
|||
return (ceil($current_time - $start_time) < $max_execution_time) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hash the password
|
||||
*
|
||||
* @deprecated 3.1.0-a2 (To be removed: 3.3.0)
|
||||
*
|
||||
* @param string $password Password to be hashed
|
||||
*
|
||||
* @return string|bool Password hash or false if something went wrong during hashing
|
||||
*/
|
||||
function phpbb_hash($password)
|
||||
{
|
||||
global $phpbb_container;
|
||||
|
||||
$passwords_manager = $phpbb_container->get('passwords.manager');
|
||||
return $passwords_manager->hash($password);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for correct password
|
||||
*
|
||||
* @deprecated 3.1.0-a2 (To be removed: 3.3.0)
|
||||
*
|
||||
* @param string $password The password in plain text
|
||||
* @param string $hash The stored password hash
|
||||
*
|
||||
* @return bool Returns true if the password is correct, false if not.
|
||||
*/
|
||||
function phpbb_check_hash($password, $hash)
|
||||
{
|
||||
global $phpbb_container;
|
||||
|
||||
$passwords_manager = $phpbb_container->get('passwords.manager');
|
||||
return $passwords_manager->check($password, $hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hashes an email address to a big integer
|
||||
*
|
||||
|
|
|
@ -48,3 +48,38 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $
|
|||
|
||||
return phpbb_get_avatar($row, $alt, $ignore_config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hash the password
|
||||
*
|
||||
* @deprecated 3.1.0-a2 (To be removed: 3.3.0)
|
||||
*
|
||||
* @param string $password Password to be hashed
|
||||
*
|
||||
* @return string|bool Password hash or false if something went wrong during hashing
|
||||
*/
|
||||
function phpbb_hash($password)
|
||||
{
|
||||
global $phpbb_container;
|
||||
|
||||
$passwords_manager = $phpbb_container->get('passwords.manager');
|
||||
return $passwords_manager->hash($password);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for correct password
|
||||
*
|
||||
* @deprecated 3.1.0-a2 (To be removed: 3.3.0)
|
||||
*
|
||||
* @param string $password The password in plain text
|
||||
* @param string $hash The stored password hash
|
||||
*
|
||||
* @return bool Returns true if the password is correct, false if not.
|
||||
*/
|
||||
function phpbb_check_hash($password, $hash)
|
||||
{
|
||||
global $phpbb_container;
|
||||
|
||||
$passwords_manager = $phpbb_container->get('passwords.manager');
|
||||
return $passwords_manager->check($password, $hash);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compatibility.php';
|
||||
|
||||
class phpbb_security_hash_test extends phpbb_test_case
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue