Ignore:
Timestamp:
2011/01/19 19:47:07 (15 years ago)
Author:
AMUAMU
Message:

#818 (パスワードリマインダの答えのハッシュ暗号化) の解決
#819 (パスワードのハッシュ暗号化の強化) の解決
#335 (パスワードリマインダの改修) の準備修正
#895 (会員登録完了ページのタイトル異常) の解決
#899 (会員登録時にパスワードが正しく登録されない) の解決
#744 (PHP4 互換用途ソースを将来的に切り捨てやすい仕組みづくり) 関連の修正も含む

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/helper/SC_Helper_Customer.php

    r19892 r19986  
    4646 
    4747        foreach ($arrRegistColumn as $data) { 
    48             if ($data["column"] != "password") { 
     48            if ($data["column"] != "password" && $data["column"] != "reminder_answer" ) { 
    4949                if($array[ $data['column'] ] != "") { 
    5050                    $arrRegist[ $data["column"] ] = $array[ $data["column"] ]; 
     
    6161 
    6262        //-- パスワードの更新がある場合は暗号化。(更新がない場合はUPDATE文を構成しない) 
    63         if ($array["password"] != DEFAULT_PASSWORD) $arrRegist["password"] = sha1($array["password"] . ":" . AUTH_MAGIC); 
     63        $salt = ""; 
     64        if ($array["password"] != DEFAULT_PASSWORD) { 
     65            $salt = SC_Utils_Ex::sfGetRandomString(10); 
     66            $arrRegist["salt"] = $salt; 
     67            $arrRegist["password"] = SC_Utils_Ex::sfGetHashString($array["password"], $salt); 
     68        } 
     69        if ($array["reminder_answer"] != DEFAULT_PASSWORD) { 
     70            if($salt == "") { 
     71                $salt = $objQuery->get("salt", "dtb_customer", "customer_id = ? ", array($array['customer_id'])); 
     72            } 
     73            $arrRegist["reminder_answer"] = SC_Utils_Ex::sfGetHashString($array["reminder_answer"], $salt); 
     74        } 
     75         
    6476        $arrRegist["update_date"] = "NOW()"; 
    6577         
     
    8294         
    8395        //-- パスワードの更新がある場合は暗号化 
    84         if ($array["password"] != DEFAULT_PASSWORD){ 
    85             $array["password"] = sha1($array["password"] . ":" . AUTH_MAGIC); 
     96        $salt = ""; 
     97        if ($array["password"] != DEFAULT_PASSWORD) { 
     98            $salt = SC_Utils_Ex::sfGetRandomString(10); 
     99            $array["salt"] = $salt; 
     100            $array["password"] = SC_Utils_Ex::sfGetHashString($array["password"], $salt); 
    86101        } else { 
    87102            unset($array["password"]); 
     103        } 
     104        if ($array["reminder_answer"] != DEFAULT_PASSWORD) { 
     105            if(is_numeric($customer_id) and $salt == "") { 
     106                $salt = $objQuery->get("salt", "dtb_customer", "customer_id = ? ", array($array['customer_id'])); 
     107            } 
     108            $array["reminder_answer"] = SC_Utils_Ex::sfGetHashString($array["reminder_answer"], $salt); 
    88109        } 
    89110        
Note: See TracChangeset for help on using the changeset viewer.