function execute($requests)
 {
     //<PCKTAI
     if (OPENPNE_AUTH_MODE == 'slavepne' || !(OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_PC)) {
         client_redirect_login();
     }
     //>
     // --- リクエスト変数
     $sid = $requests['sid'];
     // ----------
     if (!db_member_is_active_sid($sid)) {
         $p = array('msg_code' => 'invalid_url');
         openpne_redirect('pc', 'page_o_tologin', $p);
     }
     $pre = db_member_c_member_pre4sid($sid);
     $this->set('inc_page_header', fetch_inc_page_header('regist'));
     $this->set('sid', $sid);
     session_name('OpenPNEpcregist');
     @session_start();
     $this->set('prof', $_REQUEST['prof']);
     $this->set('pc_address', $pre['pc_address']);
     $query_list = p_common_c_password_query4null();
     $query_id = $_REQUEST['c_password_query_id'];
     $this->set('password_query_name', $query_list[$query_id]);
     $this->set('profile_list', db_member_c_profile_list4null());
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     $this->set('inc_navi', fetch_inc_navi("h"));
     $this->set('prof', $_SESSION['prof']);
     $this->set('profile_list', db_member_c_profile_list4null());
     return 'success';
 }
 function execute($requests)
 {
     $v = array();
     $v['c_profile_list'] = db_member_c_profile_list4null();
     $v['c_member'] = db_member_c_member4c_member_id($requests['target_c_member_id'], true, true, 'private');
     $v['from'] = $requests['from'];
     $this->set($v);
     return 'success';
 }
 function execute($requests)
 {
     if (!db_member_c_member4c_member_id_LIGHT($requests['target_c_member_id'])) {
         admin_client_redirect('list_c_member', '指定されたメンバーは存在しません');
     }
     $v = array();
     $v['c_profile_list'] = db_member_c_profile_list4null();
     $v['c_member'] = db_member_c_member4c_member_id($requests['target_c_member_id'], true, true, 'private');
     $this->set($v);
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $prof = $_REQUEST['prof'];
     // do:h_config_prof で値チェック済み
     // ----------
     $this->set('inc_navi', fetch_inc_navi('h'));
     $this->set('prof', $prof);
     $this->set('profile_list', db_member_c_profile_list4null());
     return 'success';
 }
 function execute($requests)
 {
     // ID 1 のメンバーは強制退会できない
     if ($requests['target_c_member_id'] == 1) {
         admin_client_redirect('top', 'ID 1 のメンバーを強制退会させることはできません');
     }
     $v = array();
     $v['c_profile_list'] = db_member_c_profile_list4null();
     $v['c_member'] = db_member_c_member4c_member_id($requests['target_c_member_id'], true, true, 'private');
     $this->set($v);
     return 'success';
 }
Example #7
0
 function execute($requests)
 {
     $tail = $GLOBALS['KTAI_URL_TAIL'];
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     $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_config'] && $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 ($errors) {
         ktai_display_error($errors);
     }
     db_member_config_prof_new($u, $prof);
     // insert c_member_profile
     db_member_update_c_member_profile($u, $c_member_profile_list);
     //管理画面で指定したコミュニティに強制参加
     $c_commu_id_list = db_commu_regist_join_list();
     foreach ($c_commu_id_list as $c_commu_id) {
         db_commu_join_c_commu($c_commu_id, $u);
     }
     openpne_redirect('ktai', 'page_h_home');
 }
Example #8
0
function db_common_c_profile_list4null()
{
    return db_member_c_profile_list4null();
}
Example #9
0
function do_common_send_mail_taikai4admin($c_member_id, $reason)
{
    $p_list = db_member_c_profile_list4null();
    $c_profile_list = array();
    foreach ($p_list as $key => $value) {
        $c_profile_list[] = $p_list[$key];
    }
    $c_member = db_member_c_member4c_member_id($c_member_id, true, true, 'private');
    $c_member['c_member_invite'] = db_member_c_member4c_member_id_LIGHT($c_member['c_member_id_invite']);
    if (OPENPNE_USE_POINT_RANK) {
        $c_member['point'] = db_point_get_point($c_member_id);
        $c_member['rank'] = db_point_get_rank4point($c_member['point']);
    }
    $params = array("c_member" => $c_member, "c_profile_list" => $c_profile_list, "reason" => $reason);
    if (OPENPNE_AUTH_MODE == 'pneid' || OPENPNE_AUTH_MODE == 'slavepne') {
        $params['login_id'] = db_member_username4c_member_id($c_member_id);
    }
    return fetch_send_mail(ADMIN_EMAIL, 'm_admin_taikai', $params);
}
 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);
 }
Example #11
0
 function execute($requests)
 {
     $order = $requests['order'];
     $cond = substr($_REQUEST['cond'], 1);
     $temp_list = explode('&', $cond);
     foreach ($temp_list as $value) {
         $temp_list2 = explode('=', $value);
         $_REQUEST[$temp_list2[0]] = $temp_list2[1];
     }
     $v = array();
     $pager = array();
     //絞り込み条件作成
     $cond_list = validate_cond($_REQUEST);
     $v['cond_list'] = $cond_list;
     $cond = '';
     foreach ($cond_list as $key => $value) {
         if (is_array($value)) {
             foreach ($value as $prof_key => $profile_value) {
                 if (is_array($profile_value)) {
                     foreach ($profile_value as $check_value) {
                         $cond .= '&' . $key . urlencode('[') . $prof_key . urlencode('][]') . '=' . urlencode($check_value);
                     }
                 } else {
                     $cond .= '&' . $key . urlencode('[') . $prof_key . urlencode(']') . '=' . urlencode($profile_value);
                 }
             }
         } else {
             $cond .= '&' . $key . '=' . urlencode($value);
         }
     }
     $v['cond'] = $cond;
     //絞り込みのための年
     $year = date('Y');
     $v['years'] = get_int_assoc($year - 100, $year);
     //絞り込みのドロップダウンを作る用
     $v['profile_list'] = db_member_c_profile_list();
     //絞り込みのための最終ログイン時間
     $select_last_login = array(1 => "3日以内", 2 => "3~7日以内", 3 => "7~30日以内", 4 => "30日以上", 5 => "未ログイン");
     $v['select_last_login'] = $select_last_login;
     $v['rank_data'] = db_point_get_rank_all();
     //開始年が終了年より大きい
     if (!empty($cond_list['s_year']) && !empty($cond_list['e_year']) && $cond_list['s_year'] > $cond_list['e_year']) {
         $msg = '※開始年は終了年より小さくして下さい';
     }
     //ランクが開始>終了
     if (!is_null($cond_list['s_rank']) && !is_null($cond_list['e_rank']) && $cond_list['s_rank'] > $cond_list['e_rank']) {
         $msg = '※開始ランクは終了ランクより小さくして下さい';
     }
     if ($msg) {
         $v['msg'] = $msg;
     }
     // 表示用検索データ
     $v['cond_name_data'] = cond_name_list($cond_list, $select_last_login);
     $v['SNS_NAME'] = SNS_NAME;
     $v['c_profile_list'] = db_member_c_profile_list4null();
     $v['c_member_list'] = array();
     // メンバー検索対応により、メールアドレス検索、ログインID検索ともに下記関数に統合
     $v['c_member_list'] = _db_admin_c_member_list($requests['page'], $requests['page_size'], $pager, $cond_list, $order);
     foreach ($v['c_member_list'] as $key => $value) {
         $v['c_member_list'][$key]['c_member_invite'] = db_member_c_member4c_member_id_LIGHT($value['c_member_id_invite']);
         $v['c_member_list'][$key]['c_rank'] = db_point_get_rank4point($value['profile']['PNE_POINT']['value']);
         $v['c_member_list'][$key]['is_receive_any_mail'] = db_admin_is_receive_any_mail4c_member_id($value['c_member_id']);
     }
     $v['pager'] = $pager;
     $this->set($v);
     return 'success';
 }
Example #12
0
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     $mode = $requests['mode'];
     $errors = array();
     $validator = new OpenPNE_Validator();
     $validator->addRequests($_REQUEST);
     $validator->addRules($this->_getValidateRules());
     if (!$validator->validate()) {
         $errors = array_merge($errors, $validator->getErrors());
     }
     $prof = $validator->getParams();
     //--- c_profile の項目をチェック
     $validator = new OpenPNE_Validator();
     $validator->addRequests($_REQUEST['profile']);
     $validator->addRules(util_get_validate_rules_profile('config'));
     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_config'] && $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 ($errors) {
         $_REQUEST['msg'] = array_shift($errors);
         $mode = "input";
     }
     switch ($mode) {
         case "input":
             $prof['profile'] = $c_member_profile_list;
             $_REQUEST['prof'] = $prof;
             openpne_forward('pc', 'page', "h_config_prof");
             exit;
             break;
         default:
         case "confirm":
             $prof['profile'] = $c_member_profile_list;
             $_REQUEST['prof'] = $prof;
             // page:h_config_prof_confirm への値の引渡し
             openpne_forward('pc', 'page', "h_config_prof_confirm");
             exit;
             break;
         case "register":
             db_member_config_prof_new($u, $prof);
             db_member_update_c_member_profile($u, $c_member_profile_list);
             db_member_update_c_member_config($u, 'IS_SEARCH_RESULT', $prof['is_search_result']);
             openpne_redirect('pc', 'page_h_prof');
             break;
     }
 }
Example #13
0
 function execute($requests)
 {
     //<PCKTAI
     if (OPENPNE_AUTH_MODE == 'slavepne' || !(OPENPNE_REGIST_FROM & OPENPNE_REGIST_FROM_PC)) {
         client_redirect_login();
     }
     //>
     $sid = $requests['sid'];
     if (!db_member_is_active_sid($sid)) {
         $p = array('msg_code' => 'invalid_url');
         openpne_redirect('pc', 'page_o_tologin', $p);
     }
     $pre = db_member_c_member_pre4sid($sid);
     $mode = $requests['mode'];
     $errors = array();
     $validator = new OpenPNE_Validator();
     if ($mode == 'register') {
         session_name('OpenPNEpcregist');
         @session_start();
         $validator->addRequests($_SESSION['prof']);
         $requests['password2'] = $_SESSION['prof']['password'];
     } else {
         $validator->addRequests($_REQUEST);
     }
     $validator->addRules($this->_getValidateRules());
     if (!$validator->validate()) {
         $errors = $validator->getErrors();
     }
     $prof = $validator->getParams();
     if ($prof['password'] !== $requests['password2']) {
         $errors['password2'] = 'パスワードが一致していません';
     }
     //--- c_profile の項目をチェック
     $validator = new OpenPNE_Validator();
     if ($mode == 'register') {
         $validator->addRequests($_SESSION['prof']['profile']);
         $public_flag_list = $_SESSION['prof']['public_flag'];
     } else {
         $validator->addRequests($_REQUEST['profile']);
         $public_flag_list = $_REQUEST['public_flag'];
     }
     $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(), $public_flag_list);
     // 必須項目チェック
     $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 (OPENPNE_AUTH_MODE == 'pneid') {
         // ログインIDの重複チェック
         if (db_member_c_member_id4username($prof['login_id'])) {
             $errors[] = 'このログインIDはすでに登録されています';
         }
     }
     if ($mode != 'input' && $errors) {
         $_REQUEST['err_msg'] = $errors;
         $mode = 'input';
         @session_start();
         $_SESSION['prof'] = $_REQUEST;
         unset($_SESSION['password']);
     }
     switch ($mode) {
         case 'input':
             $prof['profile'] = $c_member_profile_list;
             unset($prof['password']);
             openpne_forward('pc', 'page', 'o_regist_prof');
             exit;
         case 'confirm':
         default:
             $prof['profile'] = $c_member_profile_list;
             session_name('OpenPNEpcregist');
             @session_start();
             $_SESSION['prof'] = $_REQUEST;
             $_REQUEST['prof'] = $prof;
             openpne_forward('pc', 'page', 'o_regist_prof_confirm');
             exit;
         case 'register':
             $pre = db_member_c_member_pre4sid($sid);
             // delete cookie
             setcookie(session_name(), '', time() - 3600, ini_get('session.cookie_path'));
             if (IS_GET_EASY_ACCESS_ID != 3 || $pre['is_disabled_regist_easy_access_id']) {
                 // 管理者へ承認申請
                 if (IS_SNS_ENTRY_CONFIRM) {
                     // c_member_pre にデータ挿入
                     $c_member_pre_secure = array('session' => $pre['session'], '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'], 'password' => $prof['password'], 'c_password_query_id' => $prof['c_password_query_id'], 'c_password_query_answer' => $prof['c_password_query_answer'], 'pc_address' => $pre['pc_address'], 'regist_address' => $pre['pc_address'], 'is_sns_entry_confirm' => 1);
                     // c_member_pre_profile にデータ挿入
                     db_member_update_c_member_pre_profile($pre['c_member_pre_id'], $c_member_profile_list);
                     if (OPENPNE_AUTH_MODE == 'pneid') {
                         $c_member_pre_secure['login_id'] = $prof['login_id'];
                     }
                     db_member_update_c_member_pre4c_member_pre_id($pre['c_member_pre_id'], $c_member_pre_secure);
                     openpne_redirect('pc', 'page_o_regist_wait', array('c_member_id' => $u));
                 }
                 // メンバー登録時の携帯個体識別番号取得設定が「PC・携帯登録時に個体識別番号を必須にする」でない場合、メンバー登録処理をおこなう
                 $c_member = $prof;
                 $c_member['c_member_id_invite'] = $pre['c_member_id_invite'];
                 $c_member_secure = array('password' => $prof['password'], 'password_query_answer' => $prof['c_password_query_answer'], 'pc_address' => $pre['pc_address'], 'ktai_address' => '', 'regist_address' => $pre['pc_address']);
                 // メンバー登録
                 $u = util_regist_c_member($c_member, $c_member_secure, $c_member_profile_list);
                 // pre の内容を削除
                 db_member_delete_c_member_pre4sid($sid);
                 // 登録完了メール送信
                 do_regist_prof_do_regist2_mail_send($u);
                 // 登録完了メール(管理者宛)
                 if (SEND_USER_DATA) {
                     do_common_send_mail_regist4admin($u);
                 }
                 openpne_redirect('pc', 'page_o_regist_end', array('c_member_id' => $u));
             } else {
                 // メンバー登録時の携帯個体識別番号取得設定が「PC・携帯登録時に個体識別番号を必須にする」である場合、
                 // ここでのメンバー登録はすべてスキップする。入力した項目は c_member_pre とc_member_pre_profile に
                 // 保持しておき、携帯の登録が完了した場合に、メンバー登録も完了する
                 // c_member_pre_profile にデータ挿入
                 db_member_update_c_member_pre_profile($pre['c_member_pre_id'], $c_member_profile_list);
                 // c_member_pre にデータ挿入
                 $c_member_pre_secure = array('session' => $pre['session'], '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'], 'password' => $prof['password'], 'c_password_query_id' => $prof['c_password_query_id'], 'password_query_answer' => $prof['c_password_query_answer'], 'pc_address' => $pre['pc_address'], 'regist_address' => $pre['pc_address']);
                 if (OPENPNE_AUTH_MODE == 'pneid') {
                     $c_member_pre_secure['login_id'] = $prof['login_id'];
                 }
                 db_member_update_c_member_pre_secure($pre['c_member_pre_id'], $c_member_pre_secure);
                 openpne_redirect('pc', 'page_o_regist_ktai_address', array('sid' => $pre['session']));
             }
     }
 }
Example #14
0
function util_get_validate_rules_profile($disp = 'config')
{
    $disp_key = 'disp_' . $disp;
    $rules = array();
    $profile_list = db_member_c_profile_list4null();
    foreach ($profile_list as $profile) {
        if ($profile[$disp_key]) {
            $rule = array('type' => 'int', 'required' => $profile['is_required'], 'caption' => $profile['caption']);
            switch ($profile['form_type']) {
                case 'text':
                case 'textlong':
                case 'textarea':
                    $rule['type'] = $profile['val_type'];
                    $rule['regexp'] = $profile['val_regexp'];
                    $rule['min'] = $profile['val_min'];
                    if ($profile['val_max']) {
                        $rule['max'] = $profile['val_max'];
                    }
                    break;
                case 'checkbox':
                    $rule['is_array'] = '1';
                    break;
            }
            $rules[$profile['name']] = $rule;
        }
    }
    return $rules;
}
Example #15
0
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     $mode = $requests['mode'];
     $errors = array();
     $validator = new OpenPNE_Validator();
     if ($mode == 'register') {
         $validator->addRequests($_SESSION['prof_req']);
     } else {
         $validator->addRequests($_REQUEST);
     }
     $validator->addRules($this->_getValidateRules());
     if (!$validator->validate()) {
         $errors = array_merge($errors, $validator->getErrors());
     }
     $prof = $validator->getParams();
     //--- c_profile の項目をチェック
     $validator = new OpenPNE_Validator();
     if ($mode == 'register') {
         $validator->addRequests($_SESSION['prof_req']['profile']);
         $request_public_flags = $_SESSION['prof_req']['public_flag'];
     } else {
         $validator->addRequests($_REQUEST['profile']);
         $request_public_flags = $_REQUEST['public_flag'];
     }
     $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_flags);
     // 必須項目チェック
     $profile_list = db_member_c_profile_list4null();
     foreach ($profile_list as $profile) {
         $value = $c_member_profile_list[$profile['name']]['value'];
         if ($profile['disp_config'] && $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[] = '生年月日を未来に設定することはできません';
     }
     $prof['profile'] = $c_member_profile_list;
     if ($errors && $mode != "input") {
         $_REQUEST['msg'] = array_shift($errors);
         $mode = "input";
         $_SESSION['prof'] = $prof;
         unset($_SESSION['prof_req']);
     }
     switch ($mode) {
         case "input":
             openpne_forward('pc', 'page', "h_regist_prof");
             exit;
             break;
         default:
         case "confirm":
             $_SESSION['prof_req'] = $_REQUEST;
             $_SESSION['prof'] = $prof;
             openpne_forward('pc', 'page', "h_regist_prof_confirm");
             exit;
             break;
         case "register":
             db_member_config_prof_new($u, $prof);
             db_member_update_c_member_profile($u, $c_member_profile_list);
             //管理画面で指定したコミュニティに強制参加
             $c_commu_id_list = db_commu_regist_join_list();
             foreach ($c_commu_id_list as $c_commu_id) {
                 db_commu_join_c_commu($c_commu_id, $u);
             }
             unset($_SESSION['prof']);
             openpne_redirect('pc', 'page_h_home');
             break;
     }
 }
Example #16
0
function db_member_c_profile_list()
{
    static $is_recurred = false;
    //再帰処理中かどうかの判定フラグ
    if (!$is_recurred) {
        //function cacheのために再帰処理を行う
        $is_recurred = true;
        $funcargs = func_get_args();
        $result = pne_cache_recursive_call(OPENPNE_FUNCTION_CACHE_LIFETIME_FAST, __FUNCTION__, $funcargs);
        $is_recurred = false;
        return $result;
    }
    $list = db_member_c_profile_list4null();
    $profile_list = array();
    foreach ($list as $value) {
        $profile_list[$value['name']] = $value;
        $profile_list[$value['name']]['options'] = db_member_c_profile_option_list4c_profile_id($value['c_profile_id']);
    }
    return $profile_list;
}