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

Changeset 7609


Ignore:
Timestamp:
Jun 18, 2008, 6:25:42 PM (13 years ago)
Author:
ogawa
Message:

#1502:スレーブPNEで使われるdb_member_create_member()でc_member_idを返すようにした、またINSERT失敗時に不要なデータを削除する処理を加えた

Location:
OpenPNE/branches/stable-2.12.x/webapp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/stable-2.12.x/webapp/lib/db/member.php

    r7379 r7609  
    19001900    );
    19011901    $c_member_id = db_insert('c_member', $data);
     1902    if (!$c_member_id) {
     1903        return false;
     1904    }
    19021905
    19031906    $data = array(
     
    19101913        'easy_access_id' => '',
    19111914    );
    1912 
    19131915    if (!IS_SLAVEPNE_EMAIL_REGIST) {
    19141916        $data['pc_address'] = t_encrypt($c_member_id.'@pc.example.com');
    19151917        $data['ktai_address'] = t_encrypt($c_member_id.'@ktai.example.com');
    19161918    }
    1917 
    1918     db_insert('c_member_secure', $data);
     1919    if (!db_insert('c_member_secure', $data)) {
     1920        $sql = 'DELETE FROM c_member WHERE c_member_id = ?';
     1921        db_query($sql, array($c_member_id));
     1922
     1923        return false;
     1924    }
    19191925
    19201926    $data = array(
     
    19221928        'username' => $username,
    19231929    );
    1924     db_insert('c_username', $data);
     1930    if (!db_insert('c_username', $data)) {
     1931        $sql = 'DELETE FROM c_member WHERE c_member_id = ?';
     1932        db_query($sql, array($c_member_id));
     1933
     1934        $sql = 'DELETE FROM c_member_secure WHERE c_member_id = ?';
     1935        db_query($sql, array($c_member_id));
     1936
     1937        return false;
     1938    }
     1939
     1940    return $c_member_id;
    19251941}
    19261942
  • OpenPNE/branches/stable-2.12.x/webapp/modules/ktai/do/o_login.php

    r7008 r7609  
    5555
    5656        $c_member_id = db_member_c_member_id4username_encrypted($auth->getUsername(), true);
     57        if (OPENPNE_AUTH_MODE == 'slavepne' && !$c_member_id) {
     58            $c_member_id = db_member_create_member($_POST['username']);
     59        }
    5760        if (!$c_member_id) {
    58             if (OPENPNE_AUTH_MODE == 'slavepne') {
    59                 db_member_create_member($_POST['username']);
    60             } else {
    61                 $p = array('msg' => '0', 'kad' => t_encrypt($ktai_address), 'login_params' => $requests['login_params']);
    62                 openpne_redirect('ktai', 'page_o_login', $p);
    63             }
     61            $p = array('msg' => '0', 'kad' => t_encrypt($ktai_address), 'login_params' => $requests['login_params']);
     62            openpne_redirect('ktai', 'page_o_login', $p);
    6463        }
    6564
  • OpenPNE/branches/stable-2.12.x/webapp/modules/pc/do/o_login.php

    r5568 r7609  
    4747
    4848        $c_member_id = db_member_c_member_id4username_encrypted($auth->getUsername(), false);
     49        if (OPENPNE_AUTH_MODE == 'slavepne' && !$c_member_id) {
     50            $c_member_id = db_member_create_member($_POST['username']);
     51        }
    4952        if (!$c_member_id) {
    50             if (OPENPNE_AUTH_MODE == 'slavepne') {
    51                 db_member_create_member($_POST['username']);
    52             } else {
    53                 $this->_fail_login();
    54             }
     53            $this->_fail_login();
    5554        }
    5655
Note: See TracChangeset for help on using the changeset viewer.