#270 비밀번호 보안수준 설정 기능 추가

This commit is contained in:
khongchi 2014-01-08 18:52:15 +09:00
parent 5cfc8c7c4c
commit 4c2def5ea1
10 changed files with 114 additions and 4 deletions

View file

@ -1036,6 +1036,34 @@ class memberModel extends member
return false;
}
function checkPasswordStrength($password, $stength)
{
if($stength == NULL)
{
$config = $this->getMemberConfig();
$stength = $config->password_strength?$config->password_strength:'normal';
}
$length = strlen($password);
switch ($stength) {
case 'high':
if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
/* no break */
case 'normal':
if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
break;
case 'low':
if($length < 4) return false;
break;
}
return true;
}
function getAdminGroupSrl($site_srl = 0)
{
$groupSrl = 0;