- Timestamp:
- 2011/01/19 19:47:07 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/helper/SC_Helper_Customer.php
r19892 r19986 46 46 47 47 foreach ($arrRegistColumn as $data) { 48 if ($data["column"] != "password" ) {48 if ($data["column"] != "password" && $data["column"] != "reminder_answer" ) { 49 49 if($array[ $data['column'] ] != "") { 50 50 $arrRegist[ $data["column"] ] = $array[ $data["column"] ]; … … 61 61 62 62 //-- パスワードの更新がある場合は暗号化。(更新がない場合は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 64 76 $arrRegist["update_date"] = "NOW()"; 65 77 … … 82 94 83 95 //-- パスワードの更新がある場合は暗号化 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); 86 101 } else { 87 102 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); 88 109 } 89 110
Note: See TracChangeset
for help on using the changeset viewer.
