Source for file LC_Page_Forgot.php
Documentation is available at LC_Page_Forgot.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php';
* @author LOCKON CO.,LTD.
* @version $Id: LC_Page_Forgot.php 20970 2011-06-10 10:27:24Z Seasoft $
$this->tpl_title = "パスワードを忘れた方";
$this->tpl_mainpage = 'forgot/index.tpl';
$masterData = new SC_DB_MasterData_Ex();
$this->arrReminder = $masterData->getMasterData("mtb_reminder");
$this->device_type = SC_Display_Ex::detectDevice();
$this->httpCacheControl('nocache');
$objCookie = new SC_Cookie_Ex(COOKIE_EXPIRE);
$this->tpl_login_email = $objCookie->getCookie('login_email');
$objFormParam = new SC_FormParam_Ex();
switch($this->getMode()) {
$objFormParam->setParam($_POST);
$objFormParam->convParam();
$objFormParam->toLower('email');
$this->arrForm = $objFormParam->getHashArray();
$this->arrErr = $objFormParam->checkError();
if (SC_Utils_Ex::isBlank($this->arrErr)) {
if(SC_Utils_Ex::isBlank($this->errmsg)) {
$this->tpl_mainpage = 'forgot/secret.tpl';
$objFormParam->setParam($_POST);
$objFormParam->convParam();
$objFormParam->toLower('email');
$this->arrForm = $objFormParam->getHashArray();
$this->arrErr = $objFormParam->checkError();
if (SC_Utils_Ex::isBlank($this->arrErr)) {
if(SC_Utils_Ex::isBlank($this->errmsg)) {
$this->tpl_mainpage = 'forgot/complete.tpl';
// transactionidを更新させたいので呼び出し元(ログインフォーム側)をリロード。
$this->tpl_onload .= 'opener.location.reload(true);';
$this->tpl_mainpage = 'forgot/secret.tpl';
$this->tpl_mainpage = 'forgot/secret.tpl';
if($this->device_type == DEVICE_TYPE_PC) {
$this->setTemplate($this->tpl_mainpage);
* @param array $arrForm フォーム入力値
* @param array $arrReminder リマインダー質問リスト
* @return string エラー文字列 問題が無ければNULL
$objQuery = & SC_Query_Ex::getSingletonInstance();
$where = "(email Like ? OR email_mobile Like ?) AND name01 Like ? AND name02 Like ? AND del_flg = 0";
$arrVal = array($arrForm['email'], $arrForm['email'], $arrForm['name01'], $arrForm['name02']);
$result = $objQuery->select("reminder, status", "dtb_customer", $where, $arrVal);
if (isset ($result[0]['reminder']) and isset ($arrReminder[$result[0]['reminder']])) {
if($result[0]['status'] == '2') {
$arrForm['reminder'] = $result[0]['reminder'];
} else if ($result[0]['status'] == '1') {
$errmsg = 'ご入力のemailアドレスは現在仮登録中です。<br/>登録の際にお送りしたメールのURLにアクセスし、<br/>本会員登録をお願いします。';
$errmsg = 'お名前に間違いがあるか、このメールアドレスは登録されていません。';
* メールアドレス確認におけるパラメーター情報の初期化
* @param array $objFormParam フォームパラメータークラス
* @param array $device_type デバイスタイプ
$objFormParam->addParam("お名前(姓)", 'name01', STEXT_LEN, 'aKV', array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
$objFormParam->addParam("お名前(名)", 'name02', STEXT_LEN, 'aKV', array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
if ($device_type === DEVICE_TYPE_MOBILE){
$objFormParam->addParam('メールアドレス', 'email', null, 'a', array("EXIST_CHECK", "EMAIL_CHECK", "NO_SPTAB" ,"EMAIL_CHAR_CHECK", "MOBILE_EMAIL_CHECK"));
$objFormParam->addParam('メールアドレス', 'email', null, 'a', array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK"));
* @param array $arrForm フォーム入力値
* @param array $arrReminder リマインダー質問リスト
* @return string エラー文字列 問題が無ければNULL
$objQuery = & SC_Query_Ex::getSingletonInstance();
$cols = "customer_id, reminder, reminder_answer, salt";
$where = "(email Like ? OR email_mobile Like ?)"
. " AND name01 Like ? AND name02 Like ?"
. " AND status = 2 AND del_flg = 0";
$arrVal = array($arrForm['email'], $arrForm['email'],
$arrForm['name01'], $arrForm['name02']);
$result = $objQuery->select($cols, $table, $where, $arrVal);
if (isset ($result[0]['reminder']) and isset ($arrReminder[$result[0]['reminder']])
and $result[0]['reminder'] == $arrForm['reminder']) {
if (empty($result[0]['salt'])) {
// 旧バージョン(2.11未満)からの移行を考慮
if ($result[0]['reminder_answer'] == $arrForm['reminder_answer']) {
elseif (SC_Utils_Ex::sfIsMatchHashPassword($arrForm['reminder_answer'],
$result[0]['reminder_answer'], $result[0]['salt'])) {
$new_password = GC_Utils_Ex::gfMakePassword(8);
$objDb = new SC_Helper_DB_Ex();
$CONF = $objDb->sfGetBasisData();
$this->lfSendMail($CONF, $arrForm['email'], $arrForm['name01'], $new_password);
$sqlval['password'] = $new_password;
SC_Helper_Customer_Ex::sfEditCustomerData($sqlval, $result[0]['customer_id']);
$arrForm['new_password'] = $new_password;
$errmsg = '秘密の質問が一致しませんでした。';
//不正なアクセス リマインダー値が前画面と異なる。
// 新リファクタリング基準ではここで遷移は不許可なのでエラー表示
//SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true);
$errmsg = '秘密の質問が一致しませんでした。';
* 秘密の質問確認におけるパラメーター情報の初期化
* @param array $objFormParam フォームパラメータークラス
* @param array $device_type デバイスタイプ
$objFormParam->addParam("パスワード確認用の質問", 'reminder', STEXT_LEN, 'n', array("EXIST_CHECK", "NUM_CHECK"));
$objFormParam->addParam("パスワード確認用の質問の答え", "reminder_answer", STEXT_LEN, 'aKV', array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
* @param array $CONF 店舗基本情報の配列
* @param string $email 送信先メールアドレス
* @param string $customer_name 送信先氏名
* @param string $new_password 変更後の新パスワード
* FIXME: メールテンプレート編集の方に足すのが望ましい
function lfSendMail(&$CONF, $email, $customer_name, $new_password){
$objMailText = new SC_SiteView_Ex(false);
$objMailText->assign('customer_name', $customer_name);
$objMailText->assign('new_password', $new_password);
$toCustomerMail = $objMailText->fetch("mail_templates/forgot_mail.tpl");
$objHelperMail = new SC_Helper_Mail_Ex();
, $objHelperMail->sfMakeSubject('パスワードを変更いたしました。')
, $CONF['email03'] //配送元アドレス
, $CONF['shop_name'] // 配送元名
, $CONF['email03'] // reply to
, $CONF['email04'] //return_path
, $CONF['email04'] // errors_to
$objMail->setTo($email, $customer_name . " 様");
Documentation generated on Fri, 24 Feb 2012 14:01:58 +0900 by Seasoft
|