예제 #1
0
 function execute($requests)
 {
     $tail = $GLOBALS['KTAI_URL_TAIL'];
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     // 現在のパスワードが正しいか
     if (!db_common_authenticate_password($u, $requests['password'], true)) {
         $p = array('msg' => 18);
         openpne_redirect('ktai', 'page_h_config_easy_login', $p);
     }
     if (!($easy_access_id = OpenPNE_KtaiID::getID())) {
         $p = array('msg' => 27);
         openpne_redirect('ktai', 'page_h_config_easy_login', $p);
     }
     if (!$requests['delete']) {
         // 個体識別番号がすでに登録済み
         if (db_member_c_member_id4easy_access_id($easy_access_id)) {
             $p = array('msg' => 39);
             openpne_redirect('ktai', 'page_h_config', $p);
         } elseif (db_member_easy_access_id_is_blacklist(md5($easy_access_id))) {
             $p = array('msg' => 44);
             openpne_redirect('ktai', 'page_h_config', $p);
         } else {
             // update
             db_member_update_easy_access_id($u, $easy_access_id);
             $p = array('msg' => 28);
             openpne_redirect('ktai', 'page_h_config', $p);
         }
     } else {
         // 個体識別番号の取得が必須の場合は個体識別番号の削除はできない
         if (IS_GET_EASY_ACCESS_ID == 2 || IS_GET_EASY_ACCESS_ID == 3) {
             handle_kengen_error();
         }
         // delete
         db_member_update_easy_access_id($u, '');
         $p = array('msg' => 29);
         openpne_redirect('ktai', 'page_h_config', $p);
     }
 }
예제 #2
0
 function execute($requests)
 {
     if (!($c_member_id = db_member_c_member_id4easy_access_id(OpenPNE_KtaiID::getID()))) {
         // 認証エラー
         $p = array('msg' => 14, 'kad' => t_encrypt($requests['ktai_address']), 'login_params' => $requests['login_params']);
         openpne_redirect('ktai', 'page_o_login', $p);
     }
     $c_member = db_member_c_member4c_member_id($c_member_id, true);
     @session_name('OpenPNEktai');
     $config = get_auth_config(true);
     $auth = new OpenPNE_Auth($config);
     $auth->setExpire($GLOBALS['OpenPNE']['ktai']['session_lifetime']);
     $auth->setIdle($GLOBALS['OpenPNE']['ktai']['session_idletime']);
     $this->_auth =& $auth;
     if (LOGIN_CHECK_ENABLE) {
         // 不正ログインチェック
         include_once 'OpenPNE/LoginChecker.php';
         $options = array('check_num' => LOGIN_CHECK_NUM, 'check_time' => LOGIN_CHECK_TIME, 'reject_time' => LOGIN_REJECT_TIME);
         $lc = new OpenPNE_LoginChecker($options);
         if ($lc->is_rejected()) {
             // 認証エラー
             $lc->fail_login();
             $p = array('msg' => '0', 'login_params' => $requests['login_params']);
             openpne_redirect('ktai', 'page_o_login', $p);
         }
     }
     $auth->auth =& $auth->factory(true);
     $username = db_member_username4c_member_id($c_member_id, true);
     if (OPENPNE_AUTH_MODE == 'email') {
         $username = t_encrypt($username);
     }
     $auth->auth->setAuth($username);
     $auth->auth->setAuthData('OPENPNE_URL', OPENPNE_URL);
     $auth->auth->setAuthData('USER_AGENT', $_SERVER['HTTP_USER_AGENT']);
     if (OPENPNE_ONE_SESSION_PER_USER) {
         db_member_update_c_member_secure_insert_sess_id($c_member_id, session_id());
     }
     if (db_member_is_login_rejected($c_member_id)) {
         ktai_display_error('ログインできませんでした。');
     }
     if (db_member_is_blacklist($c_member_id)) {
         ktai_display_error('ログインできませんでした。');
     }
     db_member_do_access($c_member_id);
     // ログイン後のリダイレクト先を決定する
     $a = '';
     $m = 'ktai';
     $p = array();
     if ($requests['login_params']) {
         parse_str($requests['login_params'], $p);
     }
     if (!empty($p['a'])) {
         $a = $p['a'];
     }
     if (!empty($p['m'])) {
         $m = $p['m'];
     }
     if ($m == 'ktai' && $a == 'page_o_login') {
         $a = '';
     }
     $_SESSION['c_member_id'] = $c_member_id;
     $p['ksid'] = session_id();
     openpne_redirect($m, $a, $p);
 }
예제 #3
0
 function execute($requests)
 {
     //<PCKTAI
     if (OPENPNE_AUTH_MODE == 'slavepne' || !((OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_KTAI) >> 1)) {
         openpne_redirect('ktai', 'page_o_login', array('msg' => 42));
     }
     //>
     // --- リクエスト変数
     $ses = $requests['ses'];
     $aff_id = $requests['aff_id'];
     // ----------
     //--- 権限チェック
     //セッションが有効
     // セッションが有効かどうか
     if (!($pre = db_member_c_member_ktai_pre4session($ses))) {
         // 無効の場合、login へリダイレクト
         openpne_redirect('ktai', 'page_o_login', array('msg' => 42));
     }
     // メールアドレスが登録できるかどうか
     if (!util_is_regist_mail_address($pre['ktai_address'])) {
         openpne_redirect('ktai', 'page_o_login', array('msg' => 42));
     }
     //---
     $errors = array();
     $validator = new OpenPNE_Validator();
     $validator->addRequests($_REQUEST);
     $validator->addRules($this->_getValidateRules());
     if (!$validator->validate()) {
         $errors = $validator->getErrors();
     }
     $prof = $validator->getParams();
     //--- c_profile の項目をチェック
     $validator = new OpenPNE_Validator();
     $validator->addRequests($_REQUEST['profile']);
     $validator->addRules(util_get_validate_rules_profile('regist'));
     if (!$validator->validate()) {
         $errors = array_merge($errors, $validator->getErrors());
     }
     // 値の整合性をチェック(DB)
     $c_member_profile_list = db_member_check_profile($validator->getParams(), $_REQUEST['public_flag']);
     // 必須項目チェック
     $profile_list = db_member_c_profile_list4null();
     foreach ($profile_list as $profile) {
         $value = $c_member_profile_list[$profile['name']]['value'];
         if ($profile['disp_regist'] && $profile['is_required']) {
             if (is_null($value) || $value === '' || $value === array()) {
                 $errors[$profile['name']] = $profile['caption'] . 'を入力してください';
             }
         }
     }
     // 生年月日のチェック
     if (!t_checkdate($prof['birth_month'], $prof['birth_day'], $prof['birth_year'])) {
         $errors[] = '生年月日を正しく入力してください';
     }
     if (t_isFutureDate($prof['birth_day'], $prof['birth_month'], $prof['birth_year'])) {
         $errors[] = '生年月日を未来に設定することはできません';
     }
     if (IS_GET_EASY_ACCESS_ID != 0) {
         $easy_access_id = OpenPNE_KtaiID::getID();
         if (!$easy_access_id && (IS_GET_EASY_ACCESS_ID == 2 || IS_GET_EASY_ACCESS_ID == 3) && !$pre['is_disabled_regist_easy_access_id']) {
             openpne_redirect('ktai', 'page_o_regist_ktai_uid_err');
         }
         if (db_member_c_member_id4easy_access_id($easy_access_id)) {
             $errors[] = 'この携帯個体識別番号はすでに登録されています';
         }
         if (db_member_easy_access_id_is_blacklist(md5($easy_access_id))) {
             ktai_display_error('新規登録を完了できませんでした。');
         }
     }
     if (OPENPNE_AUTH_MODE == 'pneid') {
         // ログインIDの重複チェック
         if (db_member_c_member_id4username($prof['login_id'])) {
             $errors[] = 'このログインIDはすでに登録されています';
         }
     }
     // 入力エラー
     if ($errors) {
         ktai_display_error($errors);
     }
     // insert c_member
     $prof['c_member_id_invite'] = $pre['c_member_id_invite'];
     // 参加承認制
     if (IS_SNS_ENTRY_CONFIRM) {
         $c_member_secure = array('password' => $prof['password'], 'c_password_query_answer' => $prof['password_query_answer'], 'ktai_address' => $pre['ktai_address'], 'regist_address' => $pre['ktai_address'], 'nickname' => $prof['nickname'], 'birth_year' => $prof['birth_year'], 'birth_month' => $prof['birth_month'], 'birth_day' => $prof['birth_day'], 'public_flag_birth_year' => $prof['public_flag_birth_year'], 'public_flag_birth_month_day' => $prof['public_flag_birth_month_day'], 'c_password_query_id' => $prof['c_password_query_id'], 'is_sns_entry_confirm' => 1);
         // 仮登録IDを割り出す
         $c_member_pre_id = db_member_insert_c_member_pre_from_ktai($prof['c_member_id_invite'], $pre['ktai_address'], $pre['ktai_address'], $pre['session']);
         // c_member_pre_profile にデータ挿入
         db_member_update_c_member_pre_profile($c_member_pre_id, $c_member_profile_list);
         if ($easy_access_id) {
             $c_member_secure['easy_access_id'] = $easy_access_id;
         }
         if (OPENPNE_AUTH_MODE == 'pneid') {
             $c_member_secure['login_id'] = $prof['login_id'];
         }
         // 登録
         db_member_update_c_member_pre4c_member_pre_id($c_member_pre_id, $c_member_secure);
         // delete c_member_ktai_pre
         db_member_delete_c_member_ktai_pre4id($pre['c_member_ktai_pre_id']);
         openpne_redirect('ktai', 'page_o_regist_wait');
     }
     $c_member_secure = array('password' => $prof['password'], 'password_query_answer' => $prof['password_query_answer'], 'pc_address' => '', 'ktai_address' => $pre['ktai_address'], 'regist_address' => $pre['ktai_address']);
     if (!($c_member_id = util_regist_c_member($prof, $c_member_secure, $c_member_profile_list))) {
         openpne_redirect('ktai', 'page_o_login', array('msg' => 42));
     }
     // 個体識別番号の登録
     if ($easy_access_id) {
         db_member_update_easy_access_id($c_member_id, $easy_access_id);
     }
     // delete c_member_ktai_pre
     db_member_delete_c_member_ktai_pre4id($pre['c_member_ktai_pre_id']);
     do_insert_c_member_mail_send($c_member_id, $prof['password'], $pre['ktai_address']);
     // 登録完了メール(管理者宛)
     if (SEND_USER_DATA) {
         do_common_send_mail_regist4admin($c_member_id);
     }
     if ($aff_id) {
         $p = array('aff_id' => $aff_id);
     } else {
         $p = array();
     }
     $p['c_member_id'] = $c_member_id;
     openpne_redirect('ktai', 'page_o_regist_end', $p);
 }
예제 #4
0
 function execute($requests)
 {
     // --- リクエスト変数
     $ses = $requests['ses'];
     $password = $requests['password'];
     // ----------
     if (!($pre = db_member_c_member_pre4ktai_session($ses))) {
         openpne_redirect('ktai', 'page_o_login');
     }
     $c_member_pre_id = $pre['c_member_pre_id'];
     $ktai_address = $pre['ktai_address'];
     // パスワードチェック
     if (md5($password) !== $pre['password']) {
         $p = array('msg' => 18, 'ses' => $ses);
         openpne_redirect('ktai', 'page_o_regist_ktai', $p);
     }
     // 携帯個体識別番号を取得できなかった場合
     if (!($easy_access_id = OpenPNE_KtaiID::getID())) {
         $p = array('ses' => $ses);
         openpne_redirect('ktai', 'page_o_regist_ktai_uid_err', $p);
     }
     // 携帯個体識別番号が登録済み
     if (db_member_c_member_id4easy_access_id($easy_access_id)) {
         $p = array('msg' => 39, 'ses' => $ses);
         openpne_redirect('ktai', 'page_o_regist_ktai', $p);
     }
     // 携帯個体識別番号がブラックリストに登録済み
     if (db_member_easy_access_id_is_blacklist(md5($easy_access_id))) {
         ktai_display_error('新規登録を完了できませんでした。');
     }
     // 携帯アドレスが登録済みかどうか
     if (db_member_is_sns_join4mail_address($ktai_address)) {
         $p = array('msg' => 17, 'ses' => $ses);
         openpne_redirect('ktai', 'page_o_regist_ktai', $p);
     }
     // 参加承認制の場合
     if (IS_SNS_ENTRY_CONFIRM) {
         // PCから入力された情報は既にpreに登録されているので、
         // 携帯個体識別番号のみを登録する
         $data = array('easy_access_id' => $easy_access_id, 'is_sns_entry_confirm' => 1);
         db_member_update_c_member_pre4c_member_pre_id($pre['c_member_pre_id'], $data);
         openpne_redirect('ktai', 'page_o_regist_wait');
     }
     // PC版で行わなかったメンバー登録処理をここで行う
     $c_member = $pre;
     $c_member_secure = array('password' => $pre['password'], 'c_password_query_id' => $pre['c_password_query_id'], 'password_query_answer' => $pre['c_password_query_answer'], 'pc_address' => $pre['pc_address'], 'ktai_address' => $pre['ktai_address'], 'regist_address' => $pre['pc_address']);
     $c_member_pre_profile = db_member_c_member_pre_profile4c_member_pre_id($pre['c_member_pre_id']);
     $u = util_regist_c_member($c_member, $c_member_secure, $c_member_pre_profile, true);
     // 携帯個体識別番号を登録する
     db_member_update_easy_access_id($u, $easy_access_id);
     // pre の内容を削除
     db_member_delete_c_member_pre4ktai_session($ses);
     db_member_delete_c_member_pre_profile4c_member_pre_id($pre['c_member_pre_id']);
     // 登録完了メール送信
     do_regist_prof_do_regist2_mail_send($u);
     // 登録完了メール(管理者宛)
     if (SEND_USER_DATA) {
         do_common_send_mail_regist4admin($u);
     }
     openpne_redirect('ktai', 'page_o_regist_ktai_end', array('c_member_id' => $u));
 }
 function execute($requests)
 {
     // --- リクエスト変数
     $ses = $requests['ses'];
     $password = $requests['password'];
     // ----------
     // セッションが有効かどうか
     if (!($pre = db_member_c_ktai_address_pre4session($ses))) {
         // 無効の場合、login へリダイレクト
         openpne_redirect('ktai', 'page_o_login');
     }
     // メールアドレスが登録できるかどうか
     if (!util_is_regist_mail_address($pre['ktai_address'], $pre['c_member_id'])) {
         openpne_redirect('ktai', 'page_o_login', array('msg' => 42));
     }
     $c_member_id = $pre['c_member_id'];
     $ktai_address = $pre['ktai_address'];
     // パスワードチェック
     if (!db_common_authenticate_password($c_member_id, $password, true)) {
         $p = array('msg' => 18, 'ses' => $ses);
         openpne_redirect('ktai', 'page_o_login2', $p);
     }
     if (IS_GET_EASY_ACCESS_ID == 2 || IS_GET_EASY_ACCESS_ID == 3) {
         // 携帯の個体識別番号の取得が必須
         if (!($easy_access_id = OpenPNE_KtaiID::getID())) {
             // 携帯の個体識別番号を取得できませんでした
             $p = array('msg' => 27, 'ses' => $ses);
             openpne_redirect('ktai', 'page_o_login2', $p);
         } else {
             $id = db_member_c_member_id4easy_access_id($easy_access_id);
             if ($id && $c_member_id != $id) {
                 $p = array('msg' => 39, 'ses' => $ses);
                 openpne_redirect('ktai', 'page_o_login2', $p);
             }
             if (db_member_easy_access_id_is_blacklist(md5($easy_access_id))) {
                 ktai_display_error('携帯メールアドレスを登録できませんでした。');
             }
             // update
             db_member_update_easy_access_id($c_member_id, $easy_access_id);
             db_member_update_ktai_address($c_member_id, $ktai_address);
             db_member_delete_ktai_address_pre($pre['c_ktai_address_pre_id']);
             openpne_redirect('ktai', 'do_o_easy_login');
         }
     } else {
         if (IS_GET_EASY_ACCESS_ID == 1) {
             // 携帯の個体識別番号の取得が任意
             if ($easy_access_id = OpenPNE_KtaiID::getID()) {
                 $id = db_member_c_member_id4easy_access_id($easy_access_id);
                 if ($id && $c_member_id != $id) {
                     $p = array('msg' => 39, 'ses' => $ses);
                     openpne_redirect('ktai', 'page_o_login2', $p);
                 }
                 if (db_member_easy_access_id_is_blacklist(md5($easy_access_id))) {
                     ktai_display_error('携帯メールアドレスを登録できませんでした。');
                 }
                 // update
                 db_member_update_easy_access_id($c_member_id, $easy_access_id);
                 db_member_update_ktai_address($c_member_id, $ktai_address);
                 db_member_delete_ktai_address_pre($pre['c_ktai_address_pre_id']);
                 openpne_redirect('ktai', 'do_o_easy_login');
             }
         }
     }
     // 携帯の個体識別番号を取得しない
     db_member_update_ktai_address($c_member_id, $ktai_address);
     db_member_delete_ktai_address_pre($pre['c_ktai_address_pre_id']);
     // login ページへリダイレクト
     $p = array('msg' => 19, 'kad' => t_encrypt(db_member_username4c_member_id($c_member_id, true)));
     openpne_redirect('ktai', 'page_o_login', $p);
 }