ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 1056


Ignore:
Timestamp:
Dec 7, 2006, 10:10:15 AM (14 years ago)
Author:
maruyama
Message:

不足プロフィールを強制入力させる機能追加

Location:
OpenPNE/branches/maruyama/prj_ext_auth/webapp
Files:
5 added
9 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/maruyama/prj_ext_auth/webapp/init.inc

    r546 r1056  
    6060    'dk.pdx.ne.jp',
    6161    'wm.pdx.ne.jp',
     62    'gmail.com',
    6263);
    6364
  • OpenPNE/branches/maruyama/prj_ext_auth/webapp/lib/auth.inc

    r957 r1056  
    2828$GLOBALS['AUTH'] = $auth;
    2929
    30 /*
    31 //プロフィールが未登録の場合はリダイレクト
    32 $prof_ext_page=array(
    33 "do_h_regist_prof"=>true,
    34 "page_h_regist_prof"=>true,
    35 "do_inc_page_header_logout"=>true,
    36 );
    37 
    38 $param_check = db_member_check_param_inputed($u);
    39 
    40 if (($param_check==1)&&!$prof_ext_page[$_REQUEST['a']]){
    41     openpne_redirect('pc', 'page_h_regist_prof');
    42 }
    43 */
    44 
    45 //メールアドレスが未登録の場合はリダイレクト
    46 $mail_ext_page=array(
    47 "do_h_regist_address"=>true,
    48 "page_h_regist_address"=>true,
    49 "do_inc_page_header_logout"=>true,
    50 );
    51 
    52 if (($param_check==2)&&!$mail_ext_page[$_REQUEST['a']]){
    53     openpne_redirect('pc', 'page_h_regist_address');
     30if(!$_SESSION['regist_step']){
     31    $check_param = db_member_check_param_inputed($u);
     32    $_SESSION['regist_step'] = ($check_param == 0);
     33   
     34    //プロフィールが未登録の場合はリダイレクト
     35    $prof_ext_page=array(
     36    "do_h_regist_prof"=>true,
     37    "page_h_regist_prof"=>true,
     38    "do_inc_page_header_logout"=>true,
     39    );
     40   
     41    if (($check_param==1) && !$prof_ext_page[$_REQUEST['a']]) {
     42        openpne_redirect('pc', 'page_h_regist_prof');
     43    }
     44   
     45    //メールアドレスが未登録の場合はリダイレクト
     46    $mail_ext_page=array(
     47    "do_h_regist_address"=>true,
     48    "page_h_regist_address"=>true,
     49    "do_inc_page_header_logout"=>true,
     50    );
     51   
     52    if (($check_param==2) && !$mail_ext_page[$_REQUEST['a']]) {
     53        openpne_redirect('pc', 'page_h_regist_address');
     54    }
    5455}
    5556
  • OpenPNE/branches/maruyama/prj_ext_auth/webapp/lib/db/member.php

    r957 r1056  
    9494function db_member_c_member_secure4c_member_id($c_member_id)
    9595{
    96     $sql = 'SELECT pc_address, ktai_address, regist_address, easy_access_id FROM c_member_secure WHERE c_member_id = ?';
     96    $sql = 'SELECT pc_address, ktai_address, regist_address, easy_access_id, hashed_password, hashed_password_query_answer FROM c_member_secure WHERE c_member_id = ?';
    9797    $c_member_secure = db_get_row($sql, array(intval($c_member_id)));
    9898   
     
    14411441 * 2:メールアドレス未登録
    14421442 */
    1443 function db_member_check_param_inputed($c_member_id){
    1444     $c_member = db_member_c_member4c_member_id($c_member_id);
    1445     /*
     1443function db_member_check_param_inputed($c_member_id, $is_ktai = false){
     1444    $c_member = db_member_c_member4c_member_id($c_member_id, true);
     1445   
    14461446    if (($c_member['nickname']=="")
    14471447    ||($c_member['birth_year']=="")
     
    14491449    ||($c_member['birth_day']=="")
    14501450    ||($c_member['c_password_query_id']=="")
    1451     ||($c_member['hashed_password_query_answer']=="")
     1451    ||($c_member['secure']['hashed_password_query_answer']=="")
    14521452    ) {
    14531453        return 1;
    14541454    }
    1455     */
    14561455   
    1457     if ($c_member['secure']['pc_address']=="") {
     1456   
     1457    if ($c_member['secure']['pc_address']=="" && !$is_ktai) {
     1458        return 2;
     1459    }
     1460    if ($c_member['secure']['ktai_address']=="" && $is_ktai) {
    14581461        return 2;
    14591462    }
     
    14611464    return 0;
    14621465}
     1466           
    14631467
    14641468?>
  • OpenPNE/branches/maruyama/prj_ext_auth/webapp/modules/ktai/auth.inc

    r733 r1056  
    3434$GLOBALS['KTAI_URL_TAIL'] = "ksid=" . session_id();
    3535
    36 //メールアドレスが未登録の場合はリダイレクト
    37 $c_member_secure = db_member_c_member_secure4c_member_id($GLOBALS['KTAI_C_MEMBER_ID']);
    38 $mail_ext_page=array(
    39 "do_h_regist_address"=>true,
    40 "page_h_regist_address"=>true,
    41 );
    4236
    43 if (($c_member_secure['ktai_address']=="")&&!$mail_ext_page[$_REQUEST['a']]){
    44     openpne_redirect('ktai', 'page_h_regist_address');
     37if(!$_SESSION['regist_step']){
     38    $check_param = db_member_check_param_inputed($u, true);
     39    $_SESSION['regist_step'] = ($check_param == 0);
     40   
     41    //プロフィールが未登録の場合はリダイレクト
     42    $prof_ext_page=array(
     43    "do_h_regist_prof"=>true,
     44    "page_h_regist_prof"=>true,
     45    );
     46   
     47    if (($check_param==1) && !$prof_ext_page[$_REQUEST['a']]) {
     48        openpne_redirect('ktai', 'page_h_regist_prof');
     49    }
     50   
     51    //メールアドレスが未登録の場合はリダイレクト
     52    $mail_ext_page=array(
     53    "do_h_regist_address"=>true,
     54    "page_h_regist_address"=>true,
     55    );
     56   
     57    if (($check_param==2) && !$mail_ext_page[$_REQUEST['a']]) {
     58        openpne_redirect('ktai', 'page_h_regist_address');
     59    }
    4560}
    4661
  • OpenPNE/branches/maruyama/prj_ext_auth/webapp/modules/ktai/do/h_regist_address.php

    r715 r1056  
    1212        $u = $GLOBALS['KTAI_C_MEMBER_ID'];
    1313
    14         // --- 繝ェ繧ッ繧ィ繧ケ繝亥、画焚
     14        // --- リクエスト変数
    1515        $ktai_address = $requests['ktai_address'];
    1616        // ----------
    1717
    18         //--- 讓ゥ髯舌メ繧ァ繝�繧ッ
    19         //蠢�隕√↑縺
     18        //--- 権限チェック
     19        //必要なし
    2020
    2121        //---
    2222
    2323        if (!db_common_is_mailaddress($ktai_address)) {
    24             // 繝。繝シ繝ォ繧「繝峨Ξ繧ケ繧貞�・蜉帙@縺ヲ縺上□縺輔>
     24            // メールアドレスを入力してください
    2525            $p = array('msg' => 12);
    2626            openpne_redirect('ktai', 'page_h_regist_address', $p);
     
    2828
    2929        if (!is_ktai_mail_address($ktai_address)) {
    30             // 謳コ蟶ッ繧「繝峨Ξ繧ケ莉・螟悶�ッ謖�螳壹〒縺阪∪縺帙s
     30            // 携帯アドレス以外は指定できません
    3131            $p = array('msg' => 16);
    32             openpne_redirect('ktai', 'page_h_regist_address', $p);
     32            openpne_redirect('ktai', 'page_h_config_mail', $p);
    3333        }
    3434
    3535        if (p_is_sns_join4mail_address($ktai_address)) {
    36             // 縺薙�ョ繧「繝峨Ξ繧ケ縺ッ縺吶〒縺ォ逋サ骭イ縺輔l縺ヲ縺�縺セ縺�
     36            // このアドレスはすでに登録されています
    3737            $p = array('msg' => 17);
    38             openpne_redirect('ktai', 'page_h_regist_address', $p);
     38            openpne_redirect('ktai', 'page_h_config_mail', $p);
    3939        }
    4040
  • OpenPNE/branches/maruyama/prj_ext_auth/webapp/modules/pc/do/h_regist_prof.php

    r957 r1056  
    1818
    1919        $validator = new OpenPNE_Validator();
    20         $validator->addRequests($_REQUEST);
     20        if ($mode == 'register') {
     21            $validator->addRequests($_SESSION['prof']);
     22        } else {
     23            $validator->addRequests($_REQUEST);
     24        }
    2125        $validator->addRules($this->_getValidateRules());
    2226        if (!$validator->validate()) {
     
    2731        //--- c_profile の項目をチェック
    2832        $validator = new OpenPNE_Validator();
    29         $validator->addRequests($_REQUEST['profile']);
     33        if ($mode == 'register') {
     34            $validator->addRequests($_SESSION['prof']['profile']);
     35        } else {
     36            $validator->addRequests($_REQUEST['profile']);
     37        }
    3038        $validator->addRules($this->_getValidateRulesProfile());
    3139        if (!$validator->validate()) {
     
    5664        }
    5765       
    58         if ($errors) {
     66        if ($errors && $mode != "input") {
    5967            $_REQUEST['msg'] = array_shift($errors);
    6068            $mode = "input";
     69            $_SESSION['prof'] = $prof;
    6170        }
    6271       
     
    6473        case "input":
    6574            $prof['profile'] = $c_member_profile_list;
    66            
    67             $_SESSION['prof'] = $prof;
    6875            openpne_forward('pc', 'page', "h_regist_prof");
    6976            exit;
     
    7380            $prof['profile'] = $c_member_profile_list;
    7481
    75             $_SESSION['prof'] = $prof; // page:h_config_prof_confirm への値の引渡し
    76             openpne_forward('pc', 'page', "h_config_prof_confirm");
     82            $_SESSION['prof'] = $prof; // page:h_regist_prof_confirm への値の引渡し
     83            openpne_forward('pc', 'page', "h_regist_prof_confirm");
    7784            exit;
    7885            break;
    7986        case "register":
    80             do_config_prof_new($u, $prof);
    81             do_config_prof_update_c_member_profile($u, $c_member_profile_list);
    82 
    83             openpne_redirect('pc', 'page_h_prof');
     87            db_member_config_prof_new($u, $prof);
     88            db_member_update_c_member_profile($u, $c_member_profile_list);
     89            db_member_update_password_query($u, $prof['password_query_id'], $prof['password_query_answer']);
     90            unset($_SESSION['prof']);
     91           
     92            openpne_redirect('pc', 'page_h_home');
    8493            break;
    8594        }
     
    118127            'public_flag_birth_year' => array(
    119128                'type' => 'string',
    120             ),
    121             'password' => array(
    122                 'type' => 'regexp',
    123                 'regexp' => '/^[a-z0-9]+$/i',
    124                 'required' => '1',
    125                 'caption' => 'パスワード',
    126                 'min' => '6',
    127                 'max' => '12',
    128129            ),
    129130            'c_password_query_id' => array(
  • OpenPNE/branches/maruyama/prj_ext_auth/webapp/modules/pc/page/h_regist_prof.php

    r957 r1056  
    1010    {
    1111        $u = $GLOBALS['AUTH']->uid();
    12         print_r($_SESSION['prof']);
    1312        $this->set('c_member', db_member_c_member4c_member_id($u, true, true, 'private'));
    1413        $this->set('profs', $_SESSION['prof']);
  • OpenPNE/branches/maruyama/prj_ext_auth/webapp/modules/pc/templates/h_regist_prof.tpl

    r957 r1056  
    225225<table style="width:100%;border-collapse:collapse;padding:0">
    226226<tr>
    227 <td style="padding:0">
     227<td style="padding:0;">
    228228
    229229<div class="padding_s">
     
    231231({strip})
    232232({if $profile.form_type == 'text'})
    233     <input type="text" size="30" name="profile[({$profile.name})]" value="({$profs.profile[$profile.name]})">
     233    <input type="text" size="30" name="profile[({$profile.name})]" value="({$profs.profile[$profile.name].value})">
    234234({elseif $profile.form_type == 'textarea'})
    235     <textarea name="profile[({$profile.name})]" rows="6" cols="50">({$profs.profile[$profile.name]})</textarea>
     235    <textarea name="profile[({$profile.name})]" rows="6" cols="50">({$profs.profile[$profile.name].value})</textarea>
    236236({elseif $profile.form_type == 'select'})
    237237    <select name="profile[({$profile.name})]">
    238238    <option value="">選択してください</option>
    239239    ({foreach item=item from=$profile.options})
    240     <option value="({$item.c_profile_option_id})"({if $profs.profile[$profile.name] == $item.value}) selected="selected"({/if})>({$item.value|default:"--"})</option>
     240    <option value="({$item.c_profile_option_id})"({if $profs.profile[$profile.name].value == $item.value}) selected="selected"({/if})>({$item.value|default:"--"})</option>
    241241    ({/foreach})
    242242    </select>
     
    246246    ({counter name=$profile.name assign=_cnt})
    247247    ({if $_cnt % 3 == 1})<tr>({/if})
    248         <td><input type="radio" name="profile[({$profile.name})]" value="({$item.c_profile_option_id})"({if $profs.profile[$profile.name] == $item.value}) checked="checked"({/if})></td>
     248        <td><input type="radio" name="profile[({$profile.name})]" value="({$item.c_profile_option_id})"({if $profs.profile[$profile.name].value == $item.value}) checked="checked"({/if}) class="no_bg"></td>
    249249        <td>({$item.value|default:"--"})</td>
    250250    ({if $_cnt % 3 == 0})</tr>({/if})
     
    259259    ({counter name=$profile.name assign=_cnt})
    260260    ({if $_cnt % 3 == 1})<tr>({/if})
    261         <td><input type="checkbox" name="profile[({$profile.name})][]" value="({$item.c_profile_option_id})"({if $profs.profile[$profile.name] && in_array($item.value|smarty:nodefaults, $profs.profile[$profile.name])}) checked="checked"({/if})></td>
     261        <td><input type="checkbox" name="profile[({$profile.name})][]" value="({$item.c_profile_option_id})"({if $profs.profile[$profile.name].value && in_array($item.value|smarty:nodefaults, $profs.profile[$profile.name].value)}) checked="checked"({/if}) class="no_bg"></td>
    262262        <td>({$item.value|default:"--"})</td>
    263263    ({if $_cnt % 3 == 0})</tr>({/if})
     
    276276<div class="padding_s">
    277277
    278 ({if $profs.public_flag[$profile.name]})
    279 ({assign var=pflag value=$profs.public_flag[$profile.name]})
     278({if $profs.profile[$profile.name].public_flag})
     279({assign var=pflag value=$profs.profile[$profile.name].public_flag})
    280280({else})
    281281({assign var=pflag value=$profile.public_flag_default})
     
    317317({if !$_cnt_birth})({$smarty.capture.birth|smarty:nodefaults})({/if})
    318318({/if})
    319 ({if $c_member.secure.pc_address==""})
     319({if $profs.secure.pc_address==""&&false})
    320320<tr>
    321321<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
  • OpenPNE/branches/maruyama/prj_ext_auth/webapp/modules/pc/templates/o_login.tpl

    r401 r1056  
    3636<div class="msg lh_130">
    3737<input type="checkbox" tabindex="3" name="is_save" id="is_save" value="1" class="no_bg"><label for="is_save">次回から自動的にログイン</label><br>
     38({if $smarty.const.LOGIN_NAME_TYPE != 2})
    3839<span class="password_query"><a href="({t_url m=pc a=page_o_password_query})">&gt;パスワードを忘れた方はこちらへ</a></span>
     40({/if})
    3941({if $SSL_SELECT_URL})
    4042<br><a href="({$SSL_SELECT_URL})">({if $HTTPS})標準(http)({else})SSL(https)({/if})はこちら</a>
Note: See TracChangeset for help on using the changeset viewer.