Exemplo n.º 1
0
 /**
  *  getInstanceメソッド
  *
  *  このクラスのオブジェクトを生成する。
  *  既に生成されていたら、前回と同じものを返す。
  *
  *  @return object  $instance
  */
 public static function getInstance()
 {
     if (!self::$instance) {
         $className = __CLASS__;
         self::$instance = new $className();
     }
     return self::$instance;
 }
Exemplo n.º 2
0
 /**
  * sendMagicで送信する。
  *
  * @param  array $mailElemnts メールデータ配列
  *
  * @return boolean
  */
 public function sendMagicDelivery($mailElemnts)
 {
     if (!is_array($mailElemnts)) {
         return false;
     }
     // 整形
     $mailElemnts['sec'] = (int) $this->plasticStrings($mailElemnts['sec']);
     $mailElemnts['ts'] = (int) $this->plasticStrings($mailElemnts['ts']);
     $mailElemnts['from'] = $this->plasticStrings($mailElemnts['from']);
     $mailElemnts['from_nm'] = $this->plasticStrings($mailElemnts['from_nm']);
     $mailElemnts['rtn_path'] = $this->plasticStrings($mailElemnts['rtn_path']);
     $mailElemnts['rep_to'] = $this->plasticStrings($mailElemnts['rep_to']);
     $mailElemnts['to'] = $this->plasticStrings($mailElemnts['to']);
     //$mailElemnts['to_nm']     = $this->plasticStrings($mailElemnts['to_nm']);
     $mailElemnts['sbj'] = $this->plasticStrings($mailElemnts['sbj']);
     $mailElemnts['body'] = $this->plasticStrings($mailElemnts['body']);
     $mailElemnts['html'] = $this->plasticStrings($mailElemnts['html']);
     if (!$mailElemnts['from']) {
         return false;
     }
     // First, clear all vars
     $this->mail_subject = "";
     $this->mail_from = "";
     $this->mail_to = "";
     $this->mail_cc = "";
     $this->mail_bcc = "";
     $this->mail_text = "";
     $this->mail_html = "";
     $this->mail_header = "";
     $this->mail_body = "";
     $this->mail_reply_to = "";
     $this->mail_return_path = "";
     $this->attachments_index = 0;
     $this->sended_index = 0;
     // Clear Array Vars
     $this->attachments = array();
     $this->attachments_img = array();
     // 配信時間指定
     if ($mailElemnts['ts']) {
         $sendStart = $mailElemnts['ts'];
     } elseif ($this->_mailSendStartDate) {
         $sendStart = $this->_mailSendStartDate;
     } else {
         $sendStart = $this->makeSendStart($mailElemnts['sec']);
     }
     $this->setSendStart($sendStart);
     $ComUtilityOBJ = ComUtility::getInstance();
     $deviceCd = $ComUtilityOBJ->getDeviceFromMailAddress($mailElemnts['to']);
     if ($deviceCd == $this->_configOBJ->define->DEVICE_OTHER) {
         // PCはJIS
         $this->setCharset("ISO-2022-JP");
     } else {
         // モバイルは絵文字対応のためShift_JIS
         $this->setCharset("Shift_JIS");
     }
     $this->setFrom($mailElemnts['from'], $mailElemnts['from_nm']);
     $this->setTo($mailElemnts['to'], $mailElemnts['to_nm']);
     $this->setReturnPath($mailElemnts['rtn_path']);
     if ($mailElemnts['rep_to']) {
         $this->setReplyTo($mailElemnts['rep_to']);
     }
     $this->setSubject($mailElemnts['sbj']);
     $this->setText($mailElemnts['body']);
     $this->setHtml($mailElemnts['html']);
     if ($mailElemnts['image'] && $mailElemnts['image_type']) {
         $count = count($mailElemnts['image']);
         for ($i = 0; $i < $count; $i++) {
             $image = $mailElemnts['image'][$i];
             // imageデータ
             $type = $mailElemnts['image_type'][$i];
             // imageタイプ
             $cid = str_pad($i + 1, 3, "0", STR_PAD_LEFT);
             // Content-ID : 00*形式
             if (preg_match("/\\//", $type)) {
                 $type = substr(strrchr($type, "/"), 1);
             }
             $ext = str_replace("jpeg", "jpg", $type);
             // 拡張子(jpegのみjpgへ変換)
             $name = $cid . "." . $ext;
             $this->addContentAttachment($image, $name);
         }
     }
     // smtpHost指定(デフォルトは通常=>SendMagic)
     if (empty($this->smtp_host) && empty($this->smtp_port)) {
         //if (empty($this->openSmtpConnect())) {
         $mailServerIp = $this->_configOBJ->common_config->smtp_mail_server_ip->sendMagic;
         // IPセット
         $this->setSendMailServerIp($mailServerIp);
         // 接続
         if (!$this->openSmtpConnect()) {
             return false;
         }
     }
     // 送信
     if ($this->send()) {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 3
0
        // 個体識別重複登録メール送信
        $mailElements = $AutoMailOBJ->convertMailElements($mailElementsData["elements"], $quitBlackUserData["user_id"]);
        // メール送信
        //$AutoMailOBJ->mailTo($mailElements, "", $mailElementsData["image_data"], $mailElementsData["image_type"]);
        $AutoMailOBJ->smtpMailTo($mailElements, "", $mailElementsData["image_data"], $mailElementsData["image_type"]);
        exit;
    }
}
// トランザクション開始
$UserOBJ->beginTransaction();
$ComUtilityOBJ = ComUtility::getInstance();
// userデータを仮登録で挿入
$currentDateTime = date("Y-m-d H:i:s");
$accessKey = $UserOBJ->getNewAccessKey($currentDateTime);
$remailKey = $UserOBJ->getNewRemailKey($currentDateTime);
$password = ComUtility::getRamdomNumber(4);
$userAry = array("login_id" => $mailAddress, "password" => $UserOBJ->createPasswordKey($password), "access_key" => $accessKey, "remail_key" => $remailKey, "regist_status" => $registStatus, "media_cd" => $aryAffiliateValue["advcd"], "pre_regist_datetime" => $currentDateTime, "update_datetime" => $currentDateTime);
if ($adCdRule16Flag) {
    $userAry["affiliate_first_cd"] = substr($aryAffiliateValue["advcd"], 0, 4);
    $userAry["affiliate_last_cd"] = substr($aryAffiliateValue["advcd"], 4, 4);
    $userAry["affiliate_ym_cd"] = substr($aryAffiliateValue["advcd"], 8, 2);
    $userAry["affiliate_media_cd"] = substr($aryAffiliateValue["advcd"], 10, 6);
}
if ($registStatus == $_config["define"]["USER_REGIST_STATUS_MEMBER"]) {
    $userAry["regist_datetime"] = $currentDateTime;
}
if ($preRegistData) {
    $userAry["regist_page_id"] = $preRegistData["regist_page_id"];
    $userAry["affiliate_value"] = $preRegistData["affiliate_value"];
} else {
    if ($directRegistData) {
Exemplo n.º 4
0
 /**
  * _convertEmojiメソッド
  *
  * 絵文字を変換する
  *
  * @param  string $string 文字列
  * @return string $string
  */
 protected function _convertEmoji($string)
 {
     $utilityOBJ = ComUtility::getInstance();
     $configOBJ = ComConfig::getInstance();
     $carrier = $utilityOBJ->getDeviceFromMailAddress($this->getTo());
     $comEmojiOBJ = ComEmoji::getInstance($configOBJ->admin_config->device->{$carrier});
     $string = $comEmojiOBJ->mailConvertCarrier($string);
     return $string;
 }
 * userMailAddressChangeExec.php
 *
 * Copyright (c) 2009 Fraise, Inc.
 * All rights reserved.
 */
/**
 * PCメールアドレス変更ページ処理ファイル。
 *
 * @copyright   2010 Fraise, Inc.
 * @author      mitsuhiro nakamura
 */
require_once D_BASE_DIR . "/common/post_common.php";
$MailAddressChangeOBJ = MailAddressChange::getInstance();
$UserOBJ = User::getInstance();
$AutoMailOBJ = AutoMail::getInstance();
$ComUtilityOBJ = ComUtility::getInstance();
$errSessOBJ = new ComSessionNamespace("err_msg");
$mailAddressChangeData = $MailAddressChangeOBJ->getMailAddressChangeData($comUserData["user_id"]);
if (!$mailAddressChangeData) {
    $errSessOBJ->errMsg[] = "更新申請がありません。";
    header("Location: ./?action_Update=1" . ($comURLparam ? "&" . $comURLparam : ""));
    exit;
}
// メアドの重複チェック
if (!($duplicateUserData = $UserOBJ->getUserDataFromMailAddress($mailAddressChangeData["mail_address"]))) {
    $duplicateUserData = $UserOBJ->chkUserDataFromLoginId($mailAddressChangeData["mail_address"]);
}
// 重複メアドがあった場合
if ($duplicateUserData) {
    $errSessOBJ->errMsg[] = "メールアドレスが重複しています。";
    header("Location: ./?action_Update=1" . ($comURLparam ? "&" . $comURLparam : ""));
Exemplo n.º 6
0
/**
 * モバイルインデックスプレビューページ処理ファイル。
 *
 * @copyright   2009 Fraise, Inc.
 * @author      mitsuhiro nakamura
 */
require_once D_BASE_DIR . "/common/user_common.php";
$param = $requestOBJ->getParameterExcept($exceptArray);
if ($param[RegistPage::PAGE_CD_NAME]) {
    $userSessOBJ->psd = $param[RegistPage::PAGE_CD_NAME];
}
if (!$userSessOBJ->psd or $userSessOBJ->psd == "index" or $userSessOBJ->psd == "PR") {
    // maito文言
    $SiteContentsOBJ = SiteContents::getInstance();
    $mailToBodyData = $SiteContentsOBJ->getSiteContentsData(SiteContents::DISPLAY_CD_INDEX_MAILBODY);
    // デフォルトページの空メール文言を変える 改行コードは\r\nでないと、docomoが対応しません
    $mailToBody = ComUtility::mailtoEncode(str_replace("\n", "\r\n", $isURIMobile ? $mailToBodyData["html_contents_mb"] : $mailToBodyData["html_contents_pc"]), $isSmartPhone);
} else {
    $mailToBody = ComUtility::mailtoEncode("このまま送信してください", $isSmartPhone);
}
$mailToSubject = ComUtility::mailtoEncode($_config["define"]["SITE_NAME"], $isSmartPhone);
$mailto = RegistPage::MAILTO_TOADDRESS_FIRST . "@" . $_config["define"]["MAIL_DOMAIN"];
$mailToConvertArray["-%mailto-"] = $mailto . "?subject=" . $mailToSubject . "&body=" . $mailToBody;
// 登録ページの取得
$RegistPageOBJ = RegistPage::getInstance();
$registPageData = $RegistPageOBJ->getRegistPagePreviewDataForRegistCd($userSessOBJ->psd, $mailToConvertArray);
if (!$registPageData) {
    $registPageData = $RegistPageOBJ->getRegistPagePreviewDataForRegistCd("index", $mailToConvertArray);
}
$smartyOBJ->assign("registPageData", $registPageData);
require_once $controllerOBJ->getIncludeBusinessLogic("include");
 if ($param["clientip"] == SettlementCredit::CREDIT_CLIENT_IP_PC) {
     $param["credit_certify_phone_number"] = "00000000000";
 } else {
     $param["credit_certify_phone_number_mb"] = "00000000000";
 }
 if (!is_dir(D_BASE_DIR . "/log/settlement/" . date("Ym"))) {
     if (!is_dir(D_BASE_DIR . "/log/settlement")) {
         mkdir(D_BASE_DIR . "/log/settlement");
     }
     mkdir(D_BASE_DIR . "/log/settlement/" . date("Ym"));
 }
 // 書き込み
 $fileName = D_BASE_DIR . "/log/settlement/" . date("Ym") . "/settlement-" . date("Ymd") . "-" . mb_convert_encoding(Settlement::$_payTypeArray[Ordering::PAY_TYPE_CREDIT] . ".txt", "SJIS");
 $queryString = "&clientip=" . $clientIP . "&money=" . $itemPayTotal . "&telno=00000000000" . "&sendid=" . $userData["user_id"] . "&sendpoint=" . $orderingId . "&result=ok";
 // 決済戻り結果
 ComUtility::writeLog(urldecode($queryString), $fileName);
 // メール送信文言作成
 $mailElements["text_body"][] = "注文ID:" . $orderingId;
 $mailElements["text_body"][] = "入金額:" . $param["money"] . "円";
 $result = strtoupper($result);
 if ($result == "OK") {
     // 正常決済処理
     if (!is_numeric($param["money"]) or $param["money"] <= 0) {
         $mailElements["subject"] = "[テスト]クレジット金額のエラー";
         $mailElements["text_body"][] = "ユーザーID:" . $userData["user_id"];
         $mailElements["text_body"][] = "手動で対応して下さい。";
         $mailElements["text_body"] = implode("\n", $mailElements["text_body"]);
         // システムにエラーメール
         $SendMailOBJ->debugMailTo($mailElements);
         continue;
     }
Exemplo n.º 8
0
 */
// プロジェクトディレクトリの絶対パス
define("D_BASE_DIR", dirname(dirname(dirname(dirname(__FILE__)))));
// Web側・管理側共通処理ファイルの読み込み
require_once D_BASE_DIR . "/common/common.php";
// 決済共通ログ登録
// ディレクトリ確認
if (!is_dir(D_BASE_DIR . "/log/settlement/" . date("Ym"))) {
    if (!is_dir(D_BASE_DIR . "/log/settlement")) {
        mkdir(D_BASE_DIR . "/log/settlement");
    }
    mkdir(D_BASE_DIR . "/log/settlement/" . date("Ym"));
}
// 書き込み
$fileName = D_BASE_DIR . "/log/settlement/" . date("Ym") . "/settlement-" . date("Ymd") . "-" . mb_convert_encoding(Settlement::$_payTypeArray[Ordering::PAY_TYPE_CVD] . ".txt", "SJIS");
ComUtility::writeLog(urldecode($_SERVER["QUERY_STRING"]), $fileName);
/*
// メンテナンスフラグのチェック
if (Maintenance::checkMaintenance()) {
    exit;
}
*/
$SendMailOBJ = SendMail::getInstance();
$OrderingOBJ = Ordering::getInstance();
$UserOBJ = User::getInstance();
$SettlementCvdOBJ = SettlementCvd::getInstance();
// パラメーター受け取り
$param["sid"] = $requestOBJ->getParameter("SID");
$param["money"] = $requestOBJ->getParameter("KINGAKU");
// メール送信文言作成
$mailElements["text_body"][] = "sid:" . $param["sid"];
Exemplo n.º 9
0
<?php

/**
 * update.php
 *
 * Copyright (c) 2009 Fraise, Inc.
 * All rights reserved.
 */
/**
 * MBログイン後登録情報変更ページ処理ファイル。
 *
 * @copyright   2009 Fraise, Inc.
 * @author      mitsuhiro nakamura
 */
require_once D_BASE_DIR . "/common/post_common.php";
require_once $controllerOBJ->getIncludeBusinessLogic("postInclude");
// エラーメッセージの取得
$errSessOBJ = new ComSessionNamespace("err_msg");
if ($errSessOBJ->errMsg) {
    $errMsg = implode("<br>", $errSessOBJ->errMsg);
    $smartyOBJ->assign("errMsg", $errMsg);
    // セッション変数の破棄
    $errSessOBJ->unsetAll();
}
// maito文言
$mailToSubject = ComUtility::mailtoEncode($_config["define"]["SITE_NAME"], $isSmartPhone);
$mailToBody = ComUtility::mailtoEncode("このまま送信してください", $isSmartPhone);
$mailto = "adch-" . $comUserData["remail_key"] . "@" . $_config["define"]["MAIL_DOMAIN"] . "?subject=" . $mailToSubject . "&body=" . $mailToBody;
$smartyOBJ->assign("mailto", $mailto);
// 振込先口座番号
// エラー文言
$param["errMsg"] = $mailElements["text_body"];
// トランザクション開始
$SettlementOBJ->beginTransaction();
// 決済処理
if (!$SettlementOBJ->execSettlement($orderingData, $userData, Ordering::PAY_TYPE_BANK_AUTOMATIONBAS, $param)) {
    // ロールバック
    $SettlementOBJ->rollbackTransaction();
    $execMsgSessOBJ->exec_msg = array("手動一括完済処理エラー", "個別手動で対応して下さい。");
    header("location: ./?action_ordering_OrderingData=1&" . $URLparam);
    exit;
}
// コミット
$SettlementOBJ->commitTransaction();
// 決済共通ログ登録(決済処理がOKでもNGでもこのログは作成)
// ディレクトリ確認
if (!is_dir(D_BASE_DIR . "/log/settlement/" . date("Ym"))) {
    if (!is_dir(D_BASE_DIR . "/log/settlement")) {
        mkdir(D_BASE_DIR . "/log/settlement");
    }
    mkdir(D_BASE_DIR . "/log/settlement/" . date("Ym"));
}
// 書き込み
$fileName = D_BASE_DIR . "/log/settlement/" . date("Ym") . "/settlement-" . date("Ymd") . "-" . mb_convert_encoding(Settlement::$_payTypeArray[Ordering::PAY_TYPE_BANK_AUTOMATIONBAS] . ".txt", "SJIS");
$writeString = "admin_id=" . $loginAdminData["id"] . "&telno=" . $param["telno"] . "&money=" . $param["money"] . "&bankname=" . $param["bank_name"] . "&sitenname=" . $param["branch_name"] . "&fkoza=" . $param["fkoza"];
// 振込口座番号(手動なので「0137526」で固定)
ComUtility::writeLog($writeString, $fileName);
$execMsgSessOBJ->exec_msg = array("手動一括完済処理が完了しました");
header("location: ./?action_ordering_OrderingData=1&" . $URLparam);
exit;
Exemplo n.º 11
0
 /**
  *
  * remail_keyの重複が無い様にremail_keyを返す。
  *
  *
  * @param datetime $preRegistDatetime キー生成に使用する仮登録日付
  * @return string remailKeyを返す
  */
 public function getNewRemailKey($preRegistDatetime)
 {
     if (!$preRegistDatetime) {
         return false;
     }
     $i = 0;
     // access_keyがユニークになるまで繰り返す
     do {
         $securityKey = ComUtility::getRamdomNumber(6);
         //6桁のランダム数値
         $remailKey = md5($preRegistDatetime . "__" . $securityKey);
         $remailKey = substr($remailKey, 0, 16);
         $columnArray[] = "*";
         $whereArray[] = "remail_key = '" . $remailKey . "'";
         $i++;
         if ($i > 100) {
             return FALSE;
         }
         $sql = $this->makeSelectQuery("pre_regist", $columnArray, $whereArray);
     } while ($data = $this->executeQuery($sql, "fetchRow"));
     return $remailKey;
 }
Exemplo n.º 12
0
 $columnArray[] = "*";
 $sql = "";
 $sql = $UserOBJ->makeSelectQuery("kohaito.user", $columnArray, "", array("LIMIT " . $cnt . ", 10000"));
 $dbResultOBJ = "";
 if (!($dbResultOBJ = $UserOBJ->executeQuery($sql))) {
     exit("userデータ取得エラー");
 }
 // データリスト取得
 $dataList = "";
 $dataList = $dbResultOBJ->fetchAll();
 $currentDateTime = date("Y-m-d H:i:s");
 foreach ($dataList as $val) {
     $i = 0;
     // access_keyがユニークになるまで繰り返す
     do {
         $securityKey = ComUtility::getRamdomNumber(6);
         //6桁のランダム数値
         $remailKey = md5($currentDateTime . "__" . $securityKey);
         $remailKey = substr($remailKey, 0, 16);
         $columnArray = "";
         $columnArray[] = "*";
         $whereArray = "";
         $whereArray[] = "remail_key = '" . $remailKey . "'";
         $i++;
         if ($i > 100) {
             exit("リメールキー作成エラー");
         }
         $sql = "";
         $sql = $UserOBJ->makeSelectQuery("user", $columnArray, $whereArray);
     } while ($data = $UserOBJ->executeQuery($sql, "fetchRow"));
     $insertData = "";
Exemplo n.º 13
0
 if (!$address or !ComValidation::isMailAddress($address)) {
     continue;
 }
 //アドレスから重複チェック
 $duplicateUserData = FALSE;
 if (!($duplicateUserData = $UserOBJ->getUserDataFromMailAddressDuplication($address))) {
     $duplicateUserData = $UserOBJ->chkUserDataFromLoginIdDuplication($address);
 }
 //重複がないなら
 if ($duplicateUserData == FALSE) {
     $UserOBJ->beginTransaction();
     //現在時刻のみだと重複が発生しやすいので値を足してユニークになり易い様に仕向けます
     $currentDateTime = date("Y-m-d H:i:s");
     $accessKey = $UserOBJ->getNewAccessKey($currentDateTime . $key);
     $remailKey = $UserOBJ->getNewRemailKey($currentDateTime . $key);
     $password = $UserOBJ->createPasswordKey(ComUtility::getRamdomNumber(4));
     $addressColumn = "";
     $deviceColumn = "";
     $mbFlag = FALSE;
     // 携帯メールアドレス?
     if (ComValidation::isMobileAddress($address)) {
         $deviceCd = $ComUtilityOBJ->getDeviceFromMailAddress($address);
         $addressColumn = "mb_address";
         $deviceColumn = "mb_device_cd";
         $mbFlag = TRUE;
     } else {
         $deviceCd = $_config["define"]["DEVICE_PC"];
         $addressColumn = "pc_address";
         $deviceColumn = "pc_device_cd";
     }
     $userAry = array("login_id" => $address, "password" => $password, "access_key" => $accessKey, "remail_key" => $remailKey, $addressColumn => $address, $deviceColumn => $deviceCd, "regist_status" => $_config["define"]["USER_REGIST_STATUS_MEMBER"], "regist_page_id" => $param["registPageId"], "media_cd" => $param["advcd"], "affiliate_tag_url" => "NO_TAG", "pre_regist_datetime" => $currentDateTime, "regist_datetime" => $currentDateTime, "update_datetime" => $currentDateTime, "description" => "tc20177_VOL13_7");
Exemplo n.º 14
0
// PCメール強行
if (!ComValidation::isNumeric($param["is_pc_reverse"])) {
    $errMsg[] = "PCメール強行フラグを選択してください";
}
// MBメール強行
if (!ComValidation::isNumeric($param["is_mb_reverse"])) {
    $errMsg[] = "MBメール強行フラグを選択してください";
}
if ($errMsg) {
    $errSessOBJ->errMsg = $errMsg;
    $returnSessOBJ->return = $param;
    header("Location: ./?action_user_Create=1");
    exit;
}
$setUserParam["login_id"] = $param["pc_address"] ? $param["pc_address"] : $param["mb_address"];
$setUserParam["password"] = $UserOBJ->createPasswordKey(ComUtility::getRamdomNumber(4));
$setUserParam["admin_id"] = $loginAdminData["id"];
$setUserParam["access_key"] = $UserOBJ->getNewAccessKey(date("YmdHis"));
$setUserParam["remail_key"] = $UserOBJ->getNewRemailKey(date("YmdHis"));
$setUserParam["pc_address"] = $param["pc_address"];
$setUserParam["pc_address_status"] = $param["pc_address_status"];
$setUserParam["pc_send_status"] = $param["pc_send_status"];
$setUserParam["pc_user_agent"] = $_SERVER["HTTP_USER_AGENT"];
$setUserParam["pc_ip_address"] = $_SERVER["REMOTE_ADDR"];
$setUserParam["mb_address"] = $param["mb_address"];
$setUserParam["mb_address_status"] = $param["mb_address_status"];
$setUserParam["mb_send_status"] = $param["mb_send_status"];
$setUserParam["regist_status"] = $param["regist_status"];
$setUserParam["regist_page_id"] = $param["regist_page_id"];
$setUserParam["description"] = $param["description"];
$setUserParam["is_pc_reverse"] = $param["is_pc_reverse"];