mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-03 09:14:48 +09:00
Disable password algorithms that are too large for the password field
This commit is contained in:
parent
03d456c674
commit
46136660a8
2 changed files with 17 additions and 2 deletions
|
|
@ -164,7 +164,20 @@ class memberAdminView extends member
|
|||
*/
|
||||
public function dispMemberAdminConfig()
|
||||
{
|
||||
Context::set('password_hashing_algos', Rhymix\Framework\Password::getSupportedAlgorithms());
|
||||
// Get supported password algorithms.
|
||||
$oDB = DB::getInstance();
|
||||
$column_info = $oDB->getColumnInfo('member', 'password');
|
||||
$password_maxlength = intval($column_info->size);
|
||||
$password_algos = Rhymix\Framework\Password::getSupportedAlgorithms();
|
||||
if ($password_maxlength < 128 && isset($password_algos['sha512']))
|
||||
{
|
||||
$password_algos['sha512'] = false;
|
||||
}
|
||||
if ($password_maxlength < 64 && isset($password_algos['sha256']))
|
||||
{
|
||||
$password_algos['sha256'] = false;
|
||||
}
|
||||
Context::set('password_hashing_algos', $password_algos);
|
||||
|
||||
$this->setTemplateFile('default_config');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue