예제 #1
0
 function execute($requests)
 {
     $tail = $GLOBALS['KTAI_URL_TAIL'];
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     // --- リクエスト変数
     $ktai_address = $requests['ktai_address'];
     // ----------
     $ktai_address = str_replace('"', '', $ktai_address);
     //--- 権限チェック
     //必要なし?
     //---
     if (!db_common_is_mailaddress($ktai_address)) {
         // メールアドレスを入力してください
         $p = array('msg' => 12);
         openpne_redirect('ktai', 'page_h_regist_address', $p);
     }
     if (!is_ktai_mail_address($ktai_address)) {
         // 携帯メールアドレス以外は指定できません
         $p = array('msg' => 16);
         openpne_redirect('ktai', 'page_h_regist_address', $p);
     }
     if (db_member_is_sns_join4mail_address($ktai_address)) {
         // このメールアドレスはすでに登録されています
         $p = array('msg' => 17);
         openpne_redirect('ktai', 'page_h_regist_address', $p);
     }
     db_member_delete_c_member_ktai_pre4id($ktai_address);
     db_member_delete_c_ktai_address_pre4ktai_address($ktai_address);
     $session = create_hash();
     db_member_insert_c_ktai_address_pre($u, $session, $ktai_address);
     //function cache削除
     cache_drop_c_member_profile($u);
     do_mail_sns_change_ktai_mail_send($u, $session, $ktai_address);
     openpne_redirect('ktai', 'page_o_send_mail_end');
 }
 function execute($requests)
 {
     //<PCKTAI
     if (OPENPNE_AUTH_MODE == 'slavepne' || !(OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_PC)) {
         client_redirect_login();
     }
     //>
     $sid = $requests['sid'];
     $ktai_address = $requests['ktai_address'];
     $ktai_address = str_replace('"', '', $ktai_address);
     if (!db_member_is_active_sid($sid)) {
         $p = array('msg_code' => 'invalid_url');
         openpne_redirect('pc', 'page_o_tologin', $p);
     }
     //携帯メールアドレスチェック
     if (!db_common_is_mailaddress($ktai_address)) {
         $msg = "メールアドレスを正しく入力してください";
     } elseif (db_member_is_sns_join4mail_address($ktai_address)) {
         $msg = "そのメールアドレスは既に登録済みです";
     } elseif (!is_ktai_mail_address($ktai_address)) {
         $msg = "携帯メールアドレスを入力してください";
     }
     if (!empty($msg)) {
         $p = array('msg' => $msg, 'sid' => $sid, 'ktai_address' => $ktai_address);
         openpne_redirect('pc', 'page_o_regist_ktai_address', $p);
     }
     $pre = db_member_c_member_pre4sid($sid);
     $ktai_session = create_hash();
     // c_member_pre にデータ挿入
     $c_member_pre_secure = array('ktai_session' => $ktai_session, 'ktai_address' => $ktai_address);
     db_member_update_c_member_pre_secure($pre['c_member_pre_id'], array_merge($pre, $c_member_pre_secure), true);
     do_mail_sns_regist_ktai_id_mail_send_pre($ktai_session, $ktai_address);
     openpne_redirect('pc', 'page_o_regist_ktai_address_end', array('c_member_pre_id' => $pre['c_member_pre_id']));
 }
 function execute($requests)
 {
     //<PCKTAI
     if (OPENPNE_AUTH_MODE == 'slavepne' || !(OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_PC)) {
         client_redirect_login();
     }
     //>
     $sid = $requests['sid'];
     $ktai_address = $requests['ktai_address'];
     $ktai_address = str_replace('"', '', $ktai_address);
     if (!db_member_is_active_sid($sid)) {
         $p = array('msg_code' => 'invalid_url');
         openpne_redirect('pc', 'page_o_tologin', $p);
     }
     //携帯メールアドレスチェック
     if (!db_common_is_mailaddress($ktai_address)) {
         $msg = "メールアドレスを正しく入力してください";
     } elseif (db_member_is_sns_join4mail_address($ktai_address, 0, true)) {
         $msg = "そのメールアドレスは既に登録済みです";
     } elseif (!is_ktai_mail_address($ktai_address)) {
         $msg = "携帯メールアドレスを入力してください";
     }
     if (!empty($msg)) {
         $p = array('msg' => $msg, 'sid' => $sid, 'ktai_address' => $ktai_address);
         openpne_redirect('pc', 'page_o_regist_ktai_address', $p);
     }
     $pre = db_member_c_member_pre4sid($sid);
     //---- inc_ テンプレート用 変数 ----//
     $this->set('inc_page_header', fetch_inc_page_header('regist'));
     $this->set('ktai_address', $ktai_address);
     $this->set('sid', $sid);
     return 'success';
 }
 function execute($requests)
 {
     //<PCKTAI
     if (!OPENPNE_ENABLE_PC) {
         openpne_redirect('ktai', 'page_h_home');
     }
     //>
     $tail = $GLOBALS['KTAI_URL_TAIL'];
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     // --- リクエスト変数
     $pc_address = $requests['pc_address'];
     // ----------
     $errors = array();
     if (!db_common_is_mailaddress($pc_address)) {
         $errors[] = 'メールアドレスを正しく入力してください';
     } elseif (is_ktai_mail_address($pc_address)) {
         $errors[] = '携帯メールアドレスは入力できません';
     } elseif (db_member_c_member4pc_address($pc_address)) {
         $errors[] = '入力したメールアドレスは既に登録されています';
     } elseif (!db_member_is_limit_domain4mail_address($pc_address)) {
         $errors[] = '入力したメールアドレスでは登録できません';
     }
     if ($errors) {
         ktai_display_error($errors);
     }
     db_member_h_config_1($u, $pc_address);
     openpne_redirect('ktai', 'page_h_pc_send_confirm');
 }
예제 #5
0
 function execute($requests)
 {
     //外部認証の場合はリダイレクト
     check_action4pne_slave(false);
     // --- リクエスト変数
     $pc_address = $requests['pc_address'];
     $q_id = $requests['c_password_query_id'];
     $q_answer = $requests['c_password_query_answer'];
     // ----------
     if (OPENPNE_USE_CAPTCHA) {
         @session_start();
         if (empty($_SESSION['captcha_keystring']) || $_SESSION['captcha_keystring'] !== $requests['captcha']) {
             unset($_SESSION['captcha_keystring']);
             $p = array('msg' => "確認キーワードが誤っています");
             openpne_redirect('pc', 'page_o_password_query', $p);
         }
         unset($_SESSION['captcha_keystring']);
     }
     if (!$pc_address) {
         $p = array('msg' => 'メールアドレスを入力してください');
         openpne_redirect('pc', 'page_o_password_query', $p);
     }
     if (!db_common_is_mailaddress($pc_address)) {
         $p = array('msg' => 'メールアドレスの形式が正しくありません');
         openpne_redirect('pc', 'page_o_password_query', $p);
     }
     if (IS_PASSWORD_QUERY_ANSWER) {
         if (!$q_id) {
             $p = array('msg' => '秘密の質問を選択してください');
             openpne_redirect('pc', 'page_o_password_query', $p);
         }
         if (!$q_answer) {
             $p = array('msg' => '秘密の質問の答えを入力してください');
             openpne_redirect('pc', 'page_o_password_query', $p);
         }
     }
     //--- 権限チェック
     if (IS_PASSWORD_QUERY_ANSWER) {
         $c_member_id = db_member_is_password_query_complete($pc_address, $q_id, $q_answer);
         $msg = '正しい値を入力してください';
         if (!$c_member_id) {
             $p = array('msg' => $msg);
             openpne_redirect('pc', 'page_o_password_query', $p);
         }
     } else {
         $c_member_id = db_member_c_member_id4pc_address($pc_address);
         if (!$c_member_id) {
             openpne_redirect('pc', 'page_o_password_query_end');
         }
     }
     //---
     // パスワード再発行用のハッシュをDBに登録し再設定用のメールを送信
     $session = create_hash();
     db_member_update_c_member_config($c_member_id, 'password_reset_sid', $session);
     db_member_update_c_member_config($c_member_id, 'password_reset_sid_time', time());
     do_password_reset_query_mail_send($c_member_id, $pc_address, $session);
     openpne_redirect('pc', 'page_o_password_query_end');
 }
예제 #6
0
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     if (!IS_USER_INVITE) {
         openpne_forward('pc', 'page', 'h_err_invite');
         exit;
     }
     // --- リクエスト変数
     $form_val = $requests;
     // ----------
     if (is_ktai_mail_address($form_val['mail'])) {
         $form_val['mail'] = str_replace('"', '', $form_val['mail']);
     }
     $msg = "";
     if (OPENPNE_USE_CAPTCHA && (empty($_SESSION['captcha_keystring']) || $_SESSION['captcha_keystring'] != $requests['captcha'])) {
         unset($_SESSION['captcha_keystring']);
         $msg = "確認キーワードが誤っています";
     } else {
         unset($_SESSION['captcha_keystring']);
         if (!db_common_is_mailaddress($form_val['mail'])) {
             $msg = "メールアドレスを正しく入力してください";
         } elseif (db_member_is_sns_join4mail_address($form_val['mail'])) {
             $msg = "そのメールアドレスは既に登録済みです";
         } elseif (!db_member_is_limit_domain4mail_address($form_val['mail'])) {
             $msg = "そのメールアドレスは登録できません";
         } else {
             if (is_ktai_mail_address($form_val['mail'])) {
                 //<PCKTAI
                 if (!((OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_KTAI) >> 1)) {
                     $msg = "携帯メールアドレスには招待を送ることができません";
                 }
                 //>
             } else {
                 //<PCKTAI
                 if (!(OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_PC)) {
                     $msg = "PCメールアドレスには招待を送ることができません";
                 }
                 //>
             }
         }
     }
     if ($msg) {
         $_REQUEST['msg'] = $msg;
         openpne_forward('pc', 'page', "h_invite");
         exit;
     }
     $this->set('inc_navi', fetch_inc_navi("h"));
     $this->set('form_val', $form_val);
     $this->set('SNS_NAME', SNS_NAME);
     $random_string = do_common_create_password();
     $_SESSION['captcha_confirm'] = $random_string;
     $this->set('captcha_confirm', md5($random_string));
     return 'success';
 }
예제 #7
0
 function execute($requests)
 {
     $errors = array();
     if (!db_common_is_mailaddress($requests['pc_address']) || is_ktai_mail_address($requests['pc_address'])) {
         $errors[] = 'PCメールアドレスを正しく入力してください';
     }
     if (OPENPNE_AUTH_MODE == 'email') {
         if ($requests['password'] !== $requests['password2']) {
             $errors[] = 'パスワードが一致していません';
         }
     }
     if ($requests['admin_password'] !== $requests['admin_password2']) {
         $errors[] = '管理用パスワードが一致していません';
     }
     if (OPENPNE_AUTH_MODE == 'slavepne') {
         $auth_config = get_auth_config(false);
         $storage = Auth::_factory($auth_config['storage'], $auth_config['options']);
         $result = $storage->fetchData($requests['username'], $requests['password'], false);
         if ($result !== true) {
             $errors[] = 'ログインIDまたはパスワードが一致しません';
         }
     }
     if (OPENPNE_AUTH_MODE == 'pneid') {
         if (is_null($requests['username']) || $requests['username'] === '') {
             $errors[] = 'ログインIDを入力してください';
         } elseif (!preg_match('/^[a-zA-Z0-9][a-zA-Z0-9\\-_]+[a-zA-Z0-9]$/i', $requests['username'])) {
             $errors[] = 'ログインIDは4~30文字の半角英数字、記号(アンダーバー「_」、ハイフン「-」)で入力してください';
         } elseif (mb_strwidth($requests['username'], 'UTF-8') < 4) {
             $errors[] = "ログインIDは半角4文字以上で入力してください";
         } elseif (mb_strwidth($requests['username'], 'UTF-8') > 30) {
             $errors[] = "ログインIDは半角30文字以内で入力してください";
         }
     }
     if ($errors) {
         $this->handleError($errors);
     }
     // c_admin_config: SNS_NAME
     $data = array('name' => 'SNS_NAME', 'value' => $requests['SNS_NAME']);
     db_insert('c_admin_config', $data);
     // c_member_secure
     $data = array('c_member_id' => 1, 'hashed_password' => md5($requests['password']), 'hashed_password_query_answer' => '', 'pc_address' => t_encrypt($requests['pc_address']), 'ktai_address' => '', 'regist_address' => t_encrypt($requests['pc_address']), 'easy_access_id' => '');
     if (OPENPNE_AUTH_MODE == 'slavepne' && !IS_SLAVEPNE_EMAIL_REGIST) {
         $data['ktai_address'] = t_encrypt('*****@*****.**');
     }
     db_insert('c_member_secure', $data);
     // c_admin_user
     $data = array('username' => $requests['admin_username'], 'password' => md5($requests['admin_password']), 'auth_type' => 'all');
     db_insert('c_admin_user', $data);
     if (OPENPNE_AUTH_MODE != 'email') {
         db_member_insert_username(1, $requests['username']);
     }
     openpne_redirect('setup', 'page_setup_done');
 }
예제 #8
0
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $pc_address = $requests['pc_address'];
     $pc_address2 = $requests['pc_address2'];
     // ----------
     $msg_list = array();
     if (!$pc_address) {
         $msg_list[] = "メールアドレスを入力してください";
     }
     if (!$pc_address2) {
         $msg_list[] = "メールアドレス(確認)を入力してください";
     }
     if ($pc_address != $pc_address2) {
         $msg_list[] = "メールアドレスが一致しません";
     }
     if (!db_common_is_mailaddress($pc_address)) {
         $msg_list[] = "メールアドレスを正しく入力してください";
     }
     if ($msg_list) {
         $msg = array_shift($msg_list);
         $p = array('msg' => $msg);
         openpne_redirect('pc', 'page_h_regist_address', $p);
     }
     $c_member_id = db_member_c_member_id4pc_address($pc_address);
     if ($c_member_id == $u) {
         //自分のメールアドレス
         $p = array('msg' => "入力されたメールアドレスは既に登録されています");
         openpne_redirect('pc', 'page_h_regist_address', $p);
     } elseif ($c_member_id) {
         //既に使われている
         $p = array('msg' => "入力されたメールアドレスは既に登録されています");
         openpne_redirect('pc', 'page_h_regist_address', $p);
     }
     if (!db_member_is_limit_domain4mail_address($pc_address)) {
         $msg = "そのメールアドレスでは登録できません";
         $p = array('msg' => $msg);
         openpne_redirect('pc', 'page_h_regist_address', $p);
     }
     if (is_ktai_mail_address($pc_address)) {
         $p = array('msg' => '携帯メールアドレスは記入できません');
         openpne_redirect('pc', 'page_h_regist_address', $p);
     }
     db_member_h_regist_mail($u, $pc_address);
     $GLOBALS['AUTH']->logout();
     openpne_redirect('pc', 'page_o_h_regist_mail');
 }
예제 #9
0
/**
 * メール処理
 */
function m_process_mail($raw_mail)
{
    $options['from_encoding'] = MAIL_FROM_ENCODING;
    $options['to_encoding'] = 'UTF-8';
    $options['img_tmp_dir'] = OPENPNE_VAR_DIR . '/tmp';
    $options['img_max_filesize'] = IMAGE_MAX_FILESIZE * 1024;
    $options['trim_doublebyte_space'] = OPENPNE_TRIM_DOUBLEBYTE_SPACE;
    $decoder =& new OpenPNE_KtaiMail($options);
    $decoder->decode($raw_mail);
    $from = $decoder->get_from();
    $to = $decoder->get_to();
    if (!db_common_is_mailaddress($from) || !db_common_is_mailaddress($to)) {
        m_debug_log('mail.php::m_process_mail() ERROR code 3');
        return false;
    }
    list($to_user, $to_host) = explode("@", $to, 2);
    // check prefix
    if (MAIL_ADDRESS_PREFIX) {
        if (strpos($to_user, MAIL_ADDRESS_PREFIX) !== 0) {
            m_debug_log('mail.php::m_process_mail() missing prefix');
            return false;
        }
        $to_user = substr($to_user, strlen(MAIL_ADDRESS_PREFIX));
    }
    if ($to_host === MAIL_SERVER_DOMAIN) {
        $mail_sns =& new mail_sns($decoder);
        if (!$mail_sns->main()) {
            m_debug_log('mail.php::m_process_mail() ERROR code 1');
            return false;
        }
    } else {
        m_debug_log('mail.php::m_process_mail() ERROR code 2');
        return false;
    }
    return true;
}
 function execute($requests)
 {
     $tail = $GLOBALS['KTAI_URL_TAIL'];
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     if (!IS_USER_INVITE) {
         ktai_display_error(SNS_NAME . 'では、メンバーによる招待は行えません');
     }
     // --- リクエスト変数
     $mail = $requests['mail_address'];
     $body = $requests['body'];
     // ----------
     if (is_ktai_mail_address($mail)) {
         $mail = str_replace('"', '', $mail);
     }
     if (!$mail) {
         $p = array('msg' => 12);
         openpne_redirect('ktai', 'page_h_invite', $p);
     }
     if (!db_common_is_mailaddress($mail)) {
         $p = array('msg' => 31);
         openpne_redirect('ktai', 'page_h_invite', $p);
     }
     if (db_member_is_sns_join4mail_address($mail)) {
         $p = array('msg' => 9);
         openpne_redirect('ktai', 'page_h_invite', $p);
     }
     if (!db_member_is_limit_domain4mail_address($mail)) {
         $p = array('msg' => 37);
         openpne_redirect('ktai', 'page_h_invite', $p);
     }
     $session = create_hash();
     if (is_ktai_mail_address($mail)) {
         //<PCKTAI
         if (!((OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_KTAI) >> 1)) {
             $p = array('msg' => 13);
             openpne_redirect('ktai', 'page_h_invite', $p);
         }
         //>
         if (OPENPNE_AUTH_MODE != 'slavepne') {
             // c_member_ktai_pre に追加
             if (db_member_c_member_ktai_pre4ktai_address($mail)) {
                 db_member_update_c_member_ktai_pre($session, $mail, $u);
             } else {
                 db_member_insert_c_member_ktai_pre($session, $mail, $u);
             }
         }
         h_invite_insert_c_invite_mail_send($session, $u, $mail, $body);
     } else {
         //<PCKTAI
         if (!(OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_PC)) {
             $p = array('msg' => 16);
             openpne_redirect('ktai', 'page_h_invite', $p);
         }
         //>
         if (OPENPNE_AUTH_MODE != 'slavepne') {
             // c_member_pre に追加
             if (db_member_c_member_pre4pc_address($mail)) {
                 db_member_update_c_invite($u, $mail, $body, $session);
             } else {
                 db_member_insert_c_invite($u, $mail, $body, $session);
             }
         }
         do_h_invite_insert_c_invite_mail_send($u, $session, $body, $mail);
     }
     $p = array('msg' => 30);
     openpne_redirect('ktai', 'page_h_invite', $p);
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     if (!IS_USER_INVITE) {
         openpne_forward('pc', 'page', 'h_err_invite');
         exit;
     }
     // --- リクエスト変数
     $mail = $requests['mail'];
     $message = $requests['message'];
     // ----------
     if (is_ktai_mail_address($mail)) {
         $mail = str_replace('"', '', $mail);
     }
     if (OPENPNE_USE_CAPTCHA) {
         if (empty($_SESSION['captcha_confirm']) || $requests['captcha_confirm'] != md5($_SESSION['captcha_confirm'])) {
             unset($_SESSION['captcha_confirm']);
             $msg = "確認キーワードが誤っています";
             $p = array('msg' => $msg);
             openpne_redirect('pc', 'page_h_invite', $p);
         }
         unset($_SESSION['captcha_confirm']);
     }
     if (!db_common_is_mailaddress($mail)) {
         $msg = "メールアドレスを入力してください";
         $p = array('msg' => $msg);
         openpne_redirect('pc', 'page_h_invite', $p);
     }
     if (db_member_is_sns_join4mail_address($mail)) {
         $msg = "そのメールアドレスは既に登録済みです";
         $p = array('msg' => $msg);
         openpne_redirect('pc', 'page_h_invite', $p);
     }
     if (!db_member_is_limit_domain4mail_address($mail)) {
         $msg = "そのメールアドレスでは登録できません";
         $p = array('msg' => $msg);
         openpne_redirect('pc', 'page_h_invite', $p);
     }
     $session = create_hash();
     $c_member_id_invite = $u;
     if (is_ktai_mail_address($mail)) {
         //<PCKTAI
         if (!((OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_KTAI) >> 1)) {
             $msg = '携帯メールアドレスには招待を送ることができません';
             $p = array('msg' => $msg);
             openpne_redirect('pc', 'page_h_invite', $p);
         }
         //>
         if (OPENPNE_AUTH_MODE != 'slavepne') {
             // c_member_ktai_pre に追加
             if (db_member_c_member_ktai_pre4ktai_address($mail)) {
                 db_member_update_c_member_ktai_pre($session, $mail, $c_member_id_invite);
             } else {
                 db_member_insert_c_member_ktai_pre($session, $mail, $c_member_id_invite);
             }
         }
         h_invite_insert_c_invite_mail_send($session, $c_member_id_invite, $mail, $message);
     } else {
         //<PCKTAI
         if (!(OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_PC)) {
             $msg = 'PCメールアドレスには招待を送ることができません';
             $p = array('msg' => $msg);
             openpne_redirect('pc', 'page_h_invite', $p);
         }
         //>
         if (OPENPNE_AUTH_MODE != 'slavepne') {
             // c_member_pre に追加
             if (db_member_c_member_pre4pc_address($mail)) {
                 db_member_update_c_invite($c_member_id_invite, $mail, $message, $session);
             } else {
                 db_member_insert_c_invite($c_member_id_invite, $mail, $message, $session);
             }
         }
         do_h_invite_insert_c_invite_mail_send($c_member_id_invite, $session, $message, $mail);
     }
     openpne_redirect('pc', 'page_h_invite_end');
 }
예제 #12
0
/**
 * 登録してもよいメールアドレスかどうか
 */
function util_is_regist_mail_address($mail_address, $c_member_id = 0)
{
    if (!db_common_is_mailaddress($mail_address)) {
        return false;
    }
    if (!db_member_is_limit_domain4mail_address($mail_address)) {
        return false;
    }
    if (db_member_is_sns_join4mail_address($mail_address, $c_member_id)) {
        return false;
    }
    return true;
}
예제 #13
0
function db_member_is_limit_domain4mail_address($mail_address)
{
    // メールアドレスとして正しくない
    if (!db_common_is_mailaddress($mail_address)) {
        return false;
    }
    // 携帯メールアドレスは制限しない
    if (is_ktai_mail_address($mail_address)) {
        return true;
    }
    //ドメイン未設定なら無条件でOK
    if (LIMIT_DOMAIN1 == '' && LIMIT_DOMAIN2 == '' && LIMIT_DOMAIN3 == '' && LIMIT_DOMAIN4 == '' && LIMIT_DOMAIN5 == '') {
        return true;
    }
    $arr = explode('@', $mail_address);
    $mail_domain = $arr[1];
    $domains = array(LIMIT_DOMAIN1, LIMIT_DOMAIN2, LIMIT_DOMAIN3, LIMIT_DOMAIN4, LIMIT_DOMAIN5);
    foreach ($domains as $domain) {
        if ($domain) {
            $regexp = str_replace('\\*', '.*', preg_quote($domain, '/'));
            if (preg_match(sprintf('/%s/', $regexp), $mail_domain)) {
                return true;
            }
        }
    }
    return false;
}
예제 #14
0
 function execute($requests)
 {
     $module_name = ADMIN_MODULE_NAME;
     if ($requests['input'] || empty($requests['mails'])) {
         openpne_forward($module_name, 'page', 'send_invites');
         exit;
     }
     $mails = $requests['mails'];
     $mails = str_replace("\r\n", "\n", $mails);
     $mails = str_replace("\r", "\n", $mails);
     $mail_list = explode("\n", $mails);
     $is_disable_regist_easy_access_id = $requests['is_disable_regist_easy_access_id'];
     // filtering
     $errors = array();
     $pcs = array();
     $ktais = array();
     $limits = array();
     foreach ($mail_list as $mail) {
         if (is_ktai_mail_address($mail)) {
             $mail = str_replace('"', '', $mail);
         }
         if (!db_common_is_mailaddress($mail)) {
             // メールアドレスとして正しくない
             $errors[] = $mail;
         } elseif (db_member_is_sns_join4mail_address($mail)) {
             // 登録済み
             $registered[] = $mail;
         } elseif (!db_member_is_limit_domain4mail_address($mail)) {
             // ドメイン制限
             $limits[] = $mail;
         } elseif (is_ktai_mail_address($mail)) {
             $ktais[] = $mail;
         } else {
             $pcs[] = $mail;
         }
     }
     if (isset($requests['complete'])) {
         // 送信者はとりあえず1番で固定
         $c_member_id_invite = 1;
         // 送信完了メール数確認用
         $send_complete = array();
         //<PCKTAI
         if ((OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_KTAI) >> 1) {
             // 携帯へ招待メール
             foreach ($ktais as $mail) {
                 $session = create_hash();
                 // c_member_ktai_pre に追加
                 if (db_member_c_member_ktai_pre4ktai_address($mail)) {
                     db_member_update_c_member_ktai_pre($session, $mail, $c_member_id_invite, $is_disable_regist_easy_access_id);
                 } else {
                     db_member_insert_c_member_ktai_pre($session, $mail, $c_member_id_invite, $is_disable_regist_easy_access_id);
                 }
                 h_invite_insert_c_invite_mail_send($session, $c_member_id_invite, $mail, $requests['message']);
                 $send_complete[] = $mail;
             }
         }
         //>
         //<PCKTAI
         if (OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_PC) {
             // PCへ招待メール
             foreach ($pcs as $mail) {
                 $session = create_hash();
                 // c_member_pre に追加
                 if (db_member_c_member_pre4pc_address($mail)) {
                     db_member_update_c_invite($c_member_id_invite, $mail, $requests['message'], $session, $is_disable_regist_easy_access_id);
                 } else {
                     db_member_insert_c_invite($c_member_id_invite, $mail, $requests['message'], $session, $is_disable_regist_easy_access_id);
                 }
                 do_h_invite_insert_c_invite_mail_send($c_member_id_invite, $session, $requests['message'], $mail);
                 $send_complete[] = $mail;
             }
         }
         //>
         // メール送信完了数が1件以上ある時は、完了画面へ
         if ($send_complete) {
             admin_client_redirect('top', '招待メールを送信しました');
         }
     }
     $_REQUEST['error_mails'] = $errors;
     $_REQUEST['registered_mails'] = $registered;
     $_REQUEST['pc_mails'] = $pcs;
     $_REQUEST['ktai_mails'] = $ktais;
     $_REQUEST['limit_domain_mails'] = $limits;
     openpne_forward($module_name, 'page', 'send_invites_confirm');
     exit;
 }
예제 #15
0
 function execute($requests)
 {
     $member_file = $_FILES['member_file'];
     $limit = 1000;
     // 行数制限
     if (empty($member_file) || $member_file['error'] === UPLOAD_ERR_NO_FILE) {
         $this->handleError('ファイルを指定してください');
     }
     $filename_parts = explode('.', $member_file['name']);
     if (array_pop($filename_parts) != 'csv') {
         $this->handleError('拡張子は.csvにしてください');
     }
     $handle = fopen($member_file['tmp_name'], 'r');
     if (($data = fgetcsv($handle, 4096)) === false) {
         $this->handleError('ファイルの内容が空です');
     }
     $required_list = array('nickname', 'mail_address', 'password');
     if (OPENPNE_AUTH_MODE == 'pneid') {
         $required_list[] = 'login_id';
     }
     foreach ($required_list as $required) {
         if (!in_array($required, $data)) {
             $this->handleError('1行目: ' . $required . 'は必須項目です');
         }
     }
     $title = array();
     foreach ($data as $key => $value) {
         $matches = array();
         if (preg_match('/^profile\\[(.*)\\]$/', $value, $matches)) {
             $is_profile = true;
             $name = $matches[1];
             $c_profile = db_member_c_profile4name($name);
         } else {
             $is_profile = false;
             $name = $value;
             $c_profile = null;
         }
         $title[$key] = array('is_profile' => $is_profile, 'name' => $name, 'c_profile' => $c_profile);
     }
     $row = 1;
     // 1行目がタイトル行
     $count = 0;
     // メンバー登録に成功した数
     while (($data = fgetcsv($handle, 4096)) !== false && $row <= $limit) {
         $row++;
         $data_member = array();
         $data_profile = array();
         foreach ($data as $key => $value) {
             if (empty($title[$key])) {
                 continue;
             }
             $name = $title[$key]['name'];
             if ($title[$key]['is_profile']) {
                 if ($title[$key]['c_profile']['form_type'] === 'checkbox') {
                     $data_profile[$name] = explode(',', $value);
                 } else {
                     $data_profile[$name] = $value;
                 }
             } else {
                 $data_member[$name] = $value;
             }
         }
         if (is_ktai_mail_address($data_member['mail_address'])) {
             $data_member['mail_address'] = str_replace('"', '', $data_member['mail_address']);
         }
         // validate
         $errors = array();
         $validator = new OpenPNE_Validator();
         $validator->addRequests($data_member);
         $validator->addRules($this->_getValidateRules());
         if (!$validator->validate()) {
             $errors = array_merge($errors, $validator->getErrors());
         }
         $member = $validator->getParams();
         // mail_address
         if (!db_common_is_mailaddress($member['mail_address'])) {
             $errors[] = "メールアドレス [{$member['mail_address']}] はメールアドレスとして正しくありません";
         } elseif (db_member_is_sns_join4mail_address($member['mail_address'])) {
             $errors[] = "メールアドレス [{$member['mail_address']}] は既に登録済みです";
         } elseif (!db_member_is_limit_domain4mail_address($member['mail_address'])) {
             $errors[] = "メールアドレス [{$member['mail_address']}] は登録できません";
         }
         // login_id
         if (OPENPNE_AUTH_MODE == 'pneid') {
             if (db_member_c_member_id4username($member['login_id'])) {
                 $errors[] = "ログインID[{$member['login_id']}]は既に登録済みです";
             }
         }
         // 生年月日のチェック
         if ($member['birth_year'] || $member['birth_month'] || $member['birth_day']) {
             if (!t_checkdate($member['birth_month'], $member['birth_day'], $member['birth_year'])) {
                 $errors[] = '生年月日を正しく入力してください';
             } elseif (t_isFutureDate($member['birth_day'], $member['birth_month'], $member['birth_year'])) {
                 $errors[] = '生年月日を未来に設定することはできません';
             }
         }
         if ($errors) {
             $this->handleError("{$row}行目:" . array_shift($errors));
         }
         // profile
         $c_member_profile = db_member_check_profile($data_profile, array());
         // register
         // メールアドレスが携帯メールアドレスのドメインの場合は、
         // 携帯メールアドレスとして登録する
         if (is_ktai_mail_address($member['mail_address'])) {
             $ktai_address = $member['mail_address'];
             $pc_address = '';
         } else {
             $ktai_address = '';
             $pc_address = $member['mail_address'];
         }
         $c_member = array('nickname' => $member['nickname'], 'birth_year' => $member['birth_year'], 'birth_month' => $member['birth_month'], 'birth_day' => $member['birth_day'], 'c_password_query_id' => 0, 'c_member_id_invite' => 1, 'is_receive_mail' => 1, 'is_receive_ktai_mail' => 1, 'is_receive_daily_news' => 1, 'public_flag_birth_year' => $member['public_flag_birth_year'], 'public_flag_birth_month_day' => $member['public_flag_birth_month_day']);
         if (OPENPNE_AUTH_MODE == 'pneid') {
             $c_member['login_id'] = $member['login_id'];
         }
         $c_member_secure = array('password' => $member['password'], 'pc_address' => $pc_address, 'ktai_address' => $ktai_address, 'regist_address' => $member['mail_address']);
         if (!util_regist_c_member($c_member, $c_member_secure, $c_member_profile)) {
             $this->handleError("{$row}行目:メンバー登録に失敗しました");
         }
         $count++;
     }
     fclose($handle);
     admin_client_redirect('import_c_member', "{$count}件のインポートが完了しました");
 }
예제 #16
0
function put_mail_queue($address, $subject, $body, $is_receive_mail = true, $from = ADMIN_EMAIL)
{
    if (!$is_receive_mail || !db_common_is_mailaddress($address)) {
        return false;
    }
    // 改行コード
    $cr = "\r";
    $lf = "\n";
    $crlf = "\r\n";
    // header
    $headers['MIME-Version'] = "1.0";
    $headers['Content-Type'] = "text/plain; charset=iso-2022-jp";
    $headers['From'] = $from;
    $headers['To'] = $address;
    // 半角カナを全角カナに変換
    if (MAIL_HAN2ZEN) {
        $subject = mb_convert_kana($subject, "KV");
        $body = mb_convert_kana($body, "KV");
    }
    // subject (改行コードを含んではならない)
    $subject = str_replace(array($cr, $lf), "", $subject);
    $subject = mb_convert_encoding($subject, "JIS");
    $headers['Subject'] = '=?ISO-2022-JP?B?' . base64_encode($subject) . '?=';
    // body (LF)
    if (MAIL_WRAP_WIDTH) {
        $body = t_wordwrap($body, MAIL_WRAP_WIDTH);
    }
    $body = mb_convert_encoding($body, "JIS");
    $body = str_replace($cr, $lf, str_replace($crlf, $lf, $body));
    include_once 'Mail/Queue.php';
    $db_opt = array("type" => "db", "dsn" => $GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn'], "mail_table" => "mail_queue");
    $mail_opt = array("driver" => "mail");
    if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] === 'pgsql') {
        $db_opt['sequence'] = 'mail_queue_seq_id';
    }
    $mail_mime = new Mail_mime();
    $mail_mime->setTXTBody($body);
    $body = $mail_mime->get(array("text_charset" => "ISO-2022-JP"));
    $body = addslashes($body);
    $headers = $mail_mime->headers($headers);
    if (MAIL_SET_ENVFROM) {
        if (MAIL_ENVFROM) {
            $f = MAIL_ENVFROM;
        } else {
            $f = ADMIN_EMAIL;
        }
        $params = '-f' . escapeshellcmd($f);
        $mail_opt['param'] = $params;
        $mail_queue = new Mail_Queue($db_opt, $mail_opt);
        return $mail_queue->put($from, $address, $headers, $body);
    } else {
        $mail_queue = new Mail_Queue($db_opt, $mail_opt);
        return $mail_queue->put($from, $address, $headers, $body);
    }
}
예제 #17
0
 function execute($requests)
 {
     // オープン制のSNS以外では無効
     if (IS_CLOSED_SNS) {
         client_redirect_login();
     }
     //<PCKTAI
     if (OPENPNE_AUTH_MODE == 'slavepne' || !(OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_PC)) {
         client_redirect_login();
     }
     //>
     // --- リクエスト変数
     $pc_address = $requests['pc_address'];
     $pc_address2 = $requests['pc_address2'];
     // ----------
     //新規登録時の招待者(c_member_id=1)
     $c_member_id_invite = 1;
     if (OPENPNE_USE_CAPTCHA) {
         @session_start();
         if (empty($_SESSION['captcha_keystring']) || $_SESSION['captcha_keystring'] != $requests['captcha']) {
             unset($_SESSION['captcha_keystring']);
             $msg = "確認キーワードが誤っています";
             $p = array('msg' => $msg);
             openpne_redirect('pc', 'page_o_public_invite', $p);
         }
         unset($_SESSION['captcha_keystring']);
     }
     if (!db_common_is_mailaddress($pc_address)) {
         $msg = 'メールアドレスを正しく入力してください';
         $p = array('msg' => $msg);
         openpne_redirect('pc', 'page_o_public_invite', $p);
     }
     if (is_ktai_mail_address($pc_address)) {
         $msg = '携帯メールアドレスは入力できません';
         $p = array('msg' => $msg);
         openpne_redirect('pc', 'page_o_public_invite', $p);
     }
     if ($pc_address != $pc_address2) {
         $msg = 'メールアドレスが一致していません';
         $p = array('msg' => $msg);
         openpne_redirect('pc', 'page_o_public_invite', $p);
     }
     if (db_member_c_member_id4pc_address($pc_address)) {
         $msg = 'そのメールアドレスは既に登録されています';
         $p = array('msg' => $msg);
         openpne_redirect('pc', 'page_o_public_invite', $p);
     }
     if (!db_member_is_limit_domain4mail_address($pc_address)) {
         $msg = 'そのメールアドレスでは登録できません';
         $p = array('msg' => $msg);
         openpne_redirect('pc', 'page_o_public_invite', $p);
     }
     $session = create_hash();
     if (db_member_c_member_pre4pc_address($pc_address)) {
         db_member_update_c_invite($c_member_id_invite, $pc_address, '', $session);
     } else {
         db_member_insert_c_invite($c_member_id_invite, $pc_address, '', $session);
     }
     do_h_invite_insert_c_invite_mail_send($c_member_id_invite, $session, '', $pc_address);
     // delete cookie
     setcookie(session_name(), '', time() - 3600, ini_get('session.cookie_path'));
     openpne_redirect('pc', 'page_o_public_invite_end');
 }