<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Firewall;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
use Symfony\Component\Security\Core\Exception\InvalidCsrfTokenException;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Security\Csrf\CsrfToken;
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
use Symfony\Component\Security\Http\HttpUtils;
use Symfony\Component\Security\Http\ParameterBagUtils;
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
/**
* UsernamePasswordFormAuthenticationListener is the default implementation of
* an authentication via a simple form composed of a username and a password.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class UsernamePasswordFormAuthenticationListener extends AbstractAuthenticationListener
{
private $csrfTokenManager;
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, $providerKey, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, array $options = [], LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, CsrfTokenManagerInterface $csrfTokenManager = null)
{
parent::__construct($tokenStorage, $authenticationManager, $sessionStrategy, $httpUtils, $providerKey, $successHandler, $failureHandler, array_merge([
'username_parameter' => '_username',
'password_parameter' => '_password',
'csrf_parameter' => '_csrf_token',
'csrf_token_id' => 'authenticate',
'post_only' => true,
], $options), $logger, $dispatcher);
$this->csrfTokenManager = $csrfTokenManager;
}
/**
* {@inheritdoc}
*/
protected function requiresAuthentication(Request $request)
{
if ($this->options['post_only'] && !$request->isMethod('POST')) {
return false;
}
return parent::requiresAuthentication($request);
}
/**
* {@inheritdoc}
*/
protected function attemptAuthentication(Request $request)
{
if (null !== $this->csrfTokenManager) {
$csrfToken = ParameterBagUtils::getRequestParameterValue($request, $this->options['csrf_parameter']);
if (false === $this->csrfTokenManager->isTokenValid(new CsrfToken($this->options['csrf_token_id'], $csrfToken))) {
throw new InvalidCsrfTokenException('Invalid CSRF token.');
}
}
if ($this->options['post_only']) {
$username = ParameterBagUtils::getParameterBagValue($request->request, $this->options['username_parameter']);
$password = ParameterBagUtils::getParameterBagValue($request->request, $this->options['password_parameter']);
} else {
$username = ParameterBagUtils::getRequestParameterValue($request, $this->options['username_parameter']);
$password = ParameterBagUtils::getRequestParameterValue($request, $this->options['password_parameter']);
}
if (!\is_string($username) && (!\is_object($username) || !method_exists($username, '__toString'))) {
throw new BadRequestHttpException(sprintf('The key "%s" must be a string, "%s" given.', $this->options['username_parameter'], \gettype($username)));
}
$username = trim($username);
if (\strlen($username) > Security::MAX_USERNAME_LENGTH) {
throw new BadCredentialsException('Invalid username.');
}
$request->getSession()->set(Security::LAST_USERNAME, $username);
/// コスモピア独自カスタマイズ START ////////////////////////////////////////////////////////////////////
// 設定ファイルの読み込み
require_once($_SERVER['DOCUMENT_ROOT'] . "/app/config/cosmopier/config.php");
$mcDebug = 0;
// 管理者用ログインでない場合
if (strpos($_SERVER["REQUEST_URI"], $_SERVER["ECCUBE_ADMIN_ROUTE"]) == false)
{
// .envファイルに記載されているマジック
$authMagic = CPSHOP_AUTH_MAGIC; // "PK9RJcbRpZYKHSSsM1hpCeeATklcwktq";
// パスワードのハッシュアルゴリズム app/config/eccube/packages/eccube.yaml
$passwordHashAlgos = CPSHOP_PASSWORD_HASH_ALGOS; // "SHA256";
// 連携に必要なパラメータ
$estKidsApiUrl = CPSHOP_ESTKIDS_API_URL; // "https://test-e-st.kids-ebc.com/onlineshop/";
$estKidsApiKeyBase64 = CPSHOP_ESTKIDS_API_KEY_BASE64; // "ZmdlQFV2O0dldzM6aWRdYA=="; // "fge@Uv;Gew3:id]`";
$estKidsApiIvBase64 = CPSHOP_ESTKIDS_API_IV_BASE64; // "cGMpLUw4XAl9LYaCcvAuhw==";
$estKidsApiCryptType = CPSHOP_ESTKIDS_API_CRYPT_TYPE; // "AES-128-CBC";
//if ($mcDebug) echo "estkids_api_url=" . $estKidsApiUrl . "<br>";
//if ($mcDebug) echo "key_base64=" . $estKidsApiKeyBase64 . "<br>";
//if ($mcDebug) echo "iv_base64=" . $estKidsApiIvBase64 . "<br>";
//if ($mcDebug) echo "crypt_type=" . $estKidsApiCryptType . "<br>";
$ECCUBE_DBSERVER = CPSHOP_DBSERVER; // "mysql57.cosmopier.sakura.ne.jp"; // "localhost";
$ECCUBE_DBNAME = CPSHOP_DBNAME; // "cosmopier_shop_test_db"; // "cpshop_db";
$ECCUBE_DBUSER = CPSHOP_DBUSER; // "cosmopier"; // "root";
$ECCUBE_DBPASSWORD = CPSHOP_DBPASSWORD; // "FyKDaZ8613"; // "";
$ecCubeDBCn;
$ecCubeDBCn = mysqli_connect($ECCUBE_DBSERVER, $ECCUBE_DBUSER, $ECCUBE_DBPASSWORD, $ECCUBE_DBNAME);
if (!$ecCubeDBCn) die('Connect Error: ' . mysqli_connect_error());
$ecCubeDBCn->set_charset("utf8mb4");
// DBからユーザー情報を取得する(ZENCART移行対象かどうか)
$isMigrateUser = false;
$zenCartCheckSql = "SELECT id, migrate_status, migrate_date, customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address ";
$zenCartCheckSql .= "FROM dtb_customer_zencart WHERE customers_email_address = ?";
$zenCartDBQuery = $ecCubeDBCn->prepare($zenCartCheckSql);
$zenCartDBQuery->bind_param("s", $username);
$zenCartDBQuery->execute();
$zenCartDBQuery->bind_result($zenCartId, $zenCartMigrateStatus, $zenCartMigrateDate, $zenCartCustomerId, $zenCartCustomerFirstname, $zenCartCustomerLastname, $zenCartCustomerPassword, $zenCartCustomerEmailAddress);
while ($zenCartDBQuery->fetch()) {
//printf("%s, %s, %s, %s, %s, %s, %s, %s<br>", $zenCartId,$zenCartMigrateStatus,$zenCartMigrateDate,$zenCartCustomerId,$zenCartCustomerFirstname,$zenCartCustomerLastname,$zenCartCustomerPassword,$zenCartCustomerEmailAddress);
$isMigrateUser = true;
}
$zenCartDBQuery->close();
// DBからユーザー情報を取得する(eステKidsユーザーがいるかどうか)
$isEstKidsUser = false;
if (!$isMigrateUser) //⋰移行対象ユーザーはチェックが不要なので
{
$estKidsCheckSql = "SELECT id, estkids_user_id, estkids_firstname, estkids_lastname, estkids_email, dummy_password, first_login_date, last_login_date ";
$estKidsCheckSql .= "FROM dtb_customer_estkids WHERE estkids_email = ?";
$estKidsDBQuery = $ecCubeDBCn->prepare($estKidsCheckSql);
$estKidsDBQuery->bind_param("s", $username);
$estKidsDBQuery->execute();
$estKidsDBQuery->bind_result($estKidsId, $estKidsUserId, $estKidsFirstName, $estKidsLastName, $estKidsEmail, $estKidsDummyPassword, $estKidsFirstLoginDate, $estKidsLastLoginDate);
while ($estKidsDBQuery->fetch()) {
$isEstKidsUser = true;
}
$estKidsDBQuery->close();
}
// 移行対象のユーザーの場合で初回の場合は入力されたZENCARTのパスワードをEC-CUBEに移行する
if ($isMigrateUser)
{
if ($zenCartMigrateStatus == 0)
{
// 移行する必要がある
log_info('*** ZENCART-ECCUBE 移行処理 開始 ***');
log_info('対象:' . $zenCartCustomerEmailAddress . '(' . $zenCartId . ',' . $zenCartCustomerId . ')');
if ($mcDebug) echo '*** ZENCART-ECCUBE 移行処理 開始 ***<br>';
if ($mcDebug) echo '対象:' . $zenCartCustomerEmailAddress . '(' . $zenCartId . ',' . $zenCartCustomerId . ')<br>';
$zenCartCryptPass = explode(':', $zenCartCustomerPassword);
if ($mcDebug) echo md5($zenCartCryptPass[1]. $password) . " == " . $zenCartCryptPass[0] . "<br>";
if (md5($zenCartCryptPass[1]. $password) == $zenCartCryptPass[0])
{
// 新しいパスワードをセットし移行済みフラグを立てる
// EC-CUBEのパスワードが上書きされるのでこれ以降はZENCARTへのアクセスが不要
// 実装元: src/Eccube/Controller/EntryController.php
// SALTの用意
$salt = bin2hex(openssl_random_pseudo_bytes(5));
// 暗号化パスワードの用意
$cryptPassword = hash_hmac($passwordHashAlgos, $password.':'.$authMagic, $salt);
// シークレットキー(全ユーザーでユニークかどうかを本体ではチェックしている)StringUtilの中で処理
$secretKey = substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 32)), 0, 32);
if ($mcDebug) echo "salt:". $salt . "<br>";
if ($mcDebug) echo "password:". $cryptPassword . "<br>";
if ($mcDebug) echo "secretKey:". $secretKey . "<br>";
$createAndUpdateDate = date("Y-m-d H:i:s");
// EC-CUBEのアカウントを更新する
$ecCubeUserUpdateSql = "UPDATE dtb_customer SET password=?, salt=?, secret_key=? ";
$ecCubeUserUpdateSql .= "WHERE email=? ";
$ecCubeUserUpdateDBQuery = $ecCubeDBCn->prepare($ecCubeUserUpdateSql);
$ecCubeUserUpdateDBQuery->bind_param("ssss", $cryptPassword, $salt, $secretKey, $username);
$ecCubeUserUpdateDBQuery->execute();
$ecCubeUserUpdateDBQuery->close();
$zenCartMigrateSql = "UPDATE dtb_customer_zencart SET migrate_status=1, migrate_date='" .date("Y-m-d H:i:s") . "' ";
$zenCartMigrateSql .= "WHERE id = ? AND customers_email_address = ?";
$zenCartDBQuery = $ecCubeDBCn->prepare($zenCartMigrateSql);
$zenCartDBQuery->bind_param("is", $zenCartId, $username);
$zenCartDBQuery->execute();
$zenCartDBQuery->close();
log_info('移行処理が完了しました。');
if ($mcDebug) echo '移行処理が完了しました。<br>';
}
else
{
log_info('パスワードが一致しないため移行を中止しました。');
if ($mcDebug) echo 'パスワードが一致しないため移行を中止しました。<br>';
}
log_info('*** ZENCART-ECCUBE 移行処理 終了 ***');
if ($mcDebug) echo '*** ZENCART-ECCUBE 移行処理 終了 ***<br>';
//exit;
}
else
{
// 移行完了済みなので何もしない
if ($mcDebug) echo "移行完了済みなので何もしない";
//exit;
}
}
// eステKidsのユーザーの場合はEC-CUBEの認証を使わない
else if ($isEstKidsUser)
{
// eステKidsのアカウントを調べ、アカウントが存在する場合はパスワードをチェック
// パスワードが一致(ハッシュが一致)した場合は、
// EC-CUBEのDBからダミーのパスワード(自動設定のパスワード)を取得しセットする
// 送信するデータを生成
$key = base64_decode($estKidsApiKeyBase64);
$iv_size = openssl_cipher_iv_length($estKidsApiCryptType);
$iv = base64_decode($estKidsApiIvBase64);
$data = openssl_encrypt($username . ":" . $password, $estKidsApiCryptType, $key, OPENSSL_RAW_DATA, $iv);
$data_base64 = base64_encode($data);
if ($mcDebug) echo "key=" . $key . "<br>";
if ($mcDebug) echo "iv_size=" . $iv_size . "<br>";
if ($mcDebug) echo "iv_base64=" . $estKidsApiIvBase64 . "<br>";
if ($mcDebug) echo "data_base64=" . $data_base64 . "<br>";
// cURLを使ってeステKidsからデータを受け取る
$estKidsApi = curl_init();
$estKidsSendData = array("data" => $data_base64, "iv" => $estKidsApiIvBase64);
curl_setopt($estKidsApi, CURLOPT_URL, $estKidsApiUrl);
curl_setopt($estKidsApi, CURLOPT_POST, true);
curl_setopt($estKidsApi, CURLOPT_POSTFIELDS, $estKidsSendData);
curl_setopt($estKidsApi, CURLOPT_RETURNTRANSFER, true);
$estKidsResponse = curl_exec($estKidsApi);
$estKidsResult = json_decode($estKidsResponse);
curl_close($estKidsApi);
if ($mcDebug)
{
echo "estKidsResult<pre>";
var_dump($estKidsResult);
echo "</pre>";
}
// 結果を見て処理をおこなう
if ($estKidsResult->result == "ok")
{
// 入力したパスワードでOKだったのでこの情報でログインできるようにDBを更新する
$estKidsUserId = $estKidsResult->userid;
$estKidsFirstName = $estKidsResult->firstname;
$estKidsLastName = $estKidsResult->lastname;
$estKidsEmail = $username;
$estKidsSesskey = $estKidsResult->sesskey;
if ($mcDebug) echo "estKidsUserId:". $estKidsUserId . "<br>";
if ($mcDebug) echo "estKidsFirstName:". $estKidsFirstName . "<br>";
if ($mcDebug) echo "estKidsLastName:". $estKidsLastName . "<br>";
if ($mcDebug) echo "estKidsEmail:". $estKidsEmail . "<br>";
if ($mcDebug) echo "estKidsSesskey:". $estKidsSesskey . "<br>";
// 実装元: src/Eccube/Controller/EntryController.php
// SALTの用意
$salt = bin2hex(openssl_random_pseudo_bytes(5));
// 暗号化パスワードの用意
$cryptPassword = hash_hmac($passwordHashAlgos, $password.':'.$authMagic, $salt);
// シークレットキー(全ユーザーでユニークかどうかを本体ではチェックしている)StringUtilの中で処理
$secretKey = substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 32)), 0, 32);
if ($mcDebug) echo "salt:". $salt . "<br>";
if ($mcDebug) echo "password:". $cryptPassword . "<br>";
if ($mcDebug) echo "secretKey:". $secretKey . "<br>";
$createAndUpdateDate = date("Y-m-d H:i:s");
// EC-CUBEのアカウントを更新する
$ecCubeUserUpdateSql = "UPDATE dtb_customer SET password=?, salt=?, secret_key=? ";
$ecCubeUserUpdateSql .= "WHERE email=? ";
$ecCubeUserUpdateDBQuery = $ecCubeDBCn->prepare($ecCubeUserUpdateSql);
$ecCubeUserUpdateDBQuery->bind_param("ssss", $cryptPassword, $salt, $secretKey, $username);
$ecCubeUserUpdateDBQuery->execute();
$ecCubeUserUpdateDBQuery->close();
// EC-CUBEのeステKidsテーブルの情報を更新する
$estKidsUserUpdateSql = "UPDATE dtb_customer_estkids SET dummy_password=?, last_login_date=? ";
$estKidsUserUpdateSql .= "WHERE estkids_user_id=? ";
$estKidsUserUpdateDBQuery = $ecCubeDBCn->prepare($estKidsUserUpdateSql);
$estKidsUserUpdateDBQuery->bind_param("ssi", $cryptPassword, $createAndUpdateDate, $estKidsUserId);
$estKidsUserUpdateDBQuery->execute();
}
else // if ($estKidsResult->result == "error")
{
// $estKidsResult->message == "ERROR01" // ユーザーが見つからない
// $estKidsResult->message == "ERROR02" // パスワードが正しくない
// 何もしない
}
}
// 通常のEC-CUBEのユーザーまたはeステKidsの新規ユーザー
else
{
// EC-CUBEにユーザーがいるか調べる
// DBからユーザー情報を取得する(eステKidsユーザーがいるかどうか)
$isUserExist = false;
$ecCubeUserCheckSql = "SELECT id, customer_status_id, name01, name02, email ";
$ecCubeUserCheckSql .= "FROM dtb_customer WHERE email = ?";
$ecCubeUserDBQuery = $ecCubeDBCn->prepare($ecCubeUserCheckSql);
$ecCubeUserDBQuery->bind_param("s", $username);
$ecCubeUserDBQuery->execute();
$ecCubeUserDBQuery->bind_result($ecCubeCustomerId, $ecCubeCustomerStatusId, $ecCubeCustomerName01, $ecCubeCustomerName02, $estKidsEmail);
while ($ecCubeUserDBQuery->fetch()) {
$isUserExist = true;
}
$ecCubeUserDBQuery->close();
if ($mcDebug) echo '通常のEC-CUBEのユーザーまたはeステKidsの新規ユーザーの処理<br>';
if ($mcDebug) echo 'isUserExist:' . $isUserExist . '<br>';
// ユーザーがいないのでeステKidsのアカウントを調べ認証が通ればアカウントを生成する
if (!$isUserExist)
{
// eステKidsのアカウントを調べ、アカウントが存在する場合はパスワードをチェック
// パスワードが一致(ハッシュが一致)した場合は、アカウントを作成する
// 送信するデータを生成
$key = base64_decode($estKidsApiKeyBase64);
$iv_size = openssl_cipher_iv_length($estKidsApiCryptType);
$iv = base64_decode($estKidsApiIvBase64);
$data = openssl_encrypt($username . ":" . $password, $estKidsApiCryptType, $key, OPENSSL_RAW_DATA, $iv);
$data_base64 = base64_encode($data);
if ($mcDebug) echo "key=" . $key . "<br>";
if ($mcDebug) echo "iv_size=" . $iv_size . "<br>";
if ($mcDebug) echo "iv_base64=" . $estKidsApiIvBase64 . "<br>";
if ($mcDebug) echo "data_base64=" . $data_base64 . "<br>";
// cURLを使ってeステKidsからデータを受け取る
$estKidsApi = curl_init();
$estKidsSendData = array("data" => $data_base64, "iv" => $estKidsApiIvBase64);
curl_setopt($estKidsApi, CURLOPT_URL, $estKidsApiUrl);
curl_setopt($estKidsApi, CURLOPT_POST, true);
curl_setopt($estKidsApi, CURLOPT_POSTFIELDS, $estKidsSendData);
curl_setopt($estKidsApi, CURLOPT_RETURNTRANSFER, true);
$estKidsResponse = curl_exec($estKidsApi);
$estKidsResult = json_decode($estKidsResponse);
curl_close($estKidsApi);
if ($mcDebug)
{
echo "estKidsResponse<pre>";
var_dump($estKidsResponse);
echo "</pre>";
echo "estKidsResult<pre>";
var_dump($estKidsResult);
echo "</pre>";
}
/*
object(stdClass)#1461 (5) {
["result"]=>
string(2) "ok"
["message"]=>
string(27) "ログインしました。"
["fullname"]=>
string(31) "みらいこ メンテナンス"
["email"]=>
string(21) "support@miraico.co.jp"
["sesskey"]=>
string(10) "Xb1J1LRSLr"
}
*/
// 結果を見て処理をおこなう
if ($estKidsResult->result == "ok")
{
log_info('*** ESTKIDS-ECCUBE 連携ユーザー作成処理 開始 ***');
log_info('対象:' . $estKidsResult->fullname . '(' . $username . ',' . $estKidsResult->userid . ')');
if ($mcDebug) echo '*** ESTKIDS-ECCUBE 連携ユーザー作成処理 開始 ***<br>';
if ($mcDebug) echo '対象:' . $estKidsResult->fullname . '(' . $username . ',' . $estKidsResult->userid . ')<br>';
$estKidsUserId = $estKidsResult->userid;
$estKidsFirstName = $estKidsResult->firstname;
$estKidsLastName = $estKidsResult->lastname;
$estKidsEmail = $username;
$estKidsSesskey = $estKidsResult->sesskey;
if ($mcDebug) echo "estKidsUserId:". $estKidsUserId . "<br>";
if ($mcDebug) echo "estKidsFirstName:". $estKidsFirstName . "<br>";
if ($mcDebug) echo "estKidsLastName:". $estKidsLastName . "<br>";
if ($mcDebug) echo "estKidsEmail:". $estKidsEmail . "<br>";
if ($mcDebug) echo "estKidsSesskey:". $estKidsSesskey . "<br>";
// 実装元: src/Eccube/Controller/EntryController.php
// SALTの用意
$salt = bin2hex(openssl_random_pseudo_bytes(5));
// 暗号化パスワードの用意
$cryptPassword = hash_hmac($passwordHashAlgos, $password.':'.$authMagic, $salt);
// シークレットキー(全ユーザーでユニークかどうかを本体ではチェックしている)StringUtilの中で処理
$secretKey = substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 32)), 0, 32);
if ($mcDebug) echo "salt:". $salt . "<br>";
if ($mcDebug) echo "password:". $cryptPassword . "<br>";
if ($mcDebug) echo "secretKey:". $secretKey . "<br>";
$createAndUpdateDate = date("Y-m-d H:i:s");
$note = "eステKidsアカウント連携(eステKidsユーザーID:" . $estKidsUserId . "、登録日:" . $createAndUpdateDate . "、登録元:" . $_SERVER["REMOTE_ADDR"] . ", " . $_SERVER["HTTP_USER_AGENT"];
$note2 = $_SERVER["REMOTE_ADDR"] . ", " . $_SERVER["HTTP_USER_AGENT"];
// EC-CUBEにアカウントを生成する
$ecCubeUserCreateSql = "INSERT INTO dtb_customer(customer_status_id, name01, name02, email, password, salt, secret_key, note, create_date, update_date, discriminator_type, customer_rank_id) ";
$ecCubeUserCreateSql .= "VALUES(2, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'customer', 3) ";
if ($mcDebug) echo "ecCubeUserCreateSql:". $ecCubeUserCreateSql . "<br>";
$ecCubeUserCreateDBQuery = $ecCubeDBCn->prepare($ecCubeUserCreateSql);
$ecCubeUserCreateDBQuery->bind_param("sssssssss", $estKidsFirstName, $estKidsLastName, $estKidsEmail, $cryptPassword, $salt, $secretKey, $note, $createAndUpdateDate, $createAndUpdateDate);
$ecCubeUserCreateDBQuery->execute();
$ecCubeUserCreateDBQuery->close();
// EC-CUBEのeステKidsテーブルにアカウントを作成する
$estKidsUserCreateSql = "INSERT INTO dtb_customer_estkids(id, estkids_user_id, estkids_firstname, estkids_lastname, estkids_email, dummy_password, first_login_date, last_login_date, note) ";
$estKidsUserCreateSql .= "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) ";
$estKidsUserCreateDBQuery = $ecCubeDBCn->prepare($estKidsUserCreateSql);
$estKidsUserCreateDBQuery->bind_param("iisssssss", $estKidsUserId, $estKidsUserId, $estKidsFirstName, $estKidsLastName, $estKidsEmail, $cryptPassword, $createAndUpdateDate, $createAndUpdateDate, $note2);
$estKidsUserCreateDBQuery->execute();
$estKidsUserCreateDBQuery->close();
log_info('*** ESTKIDS-ECCUBE 連携ユーザー作成処理 終了 ***');
if ($mcDebug) echo '*** ESTKIDS-ECCUBE 連携ユーザー作成処理 終了 ***<br>';
}
else // if ($estKidsResult->result == "error")
{
// $estKidsResult->message == "ERROR01" // ユーザーが見つからない
// $estKidsResult->message == "ERROR02" // パスワードが正しくない
// 何もしない
}
}
}
$ecCubeDBCn->close();
}
/// コスモピア独自カスタマイズ END ////////////////////////////////////////////////////////////////////
return $this->authenticationManager->authenticate(new UsernamePasswordToken($username, $password, $this->providerKey));
}
}