1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2006 OpenPNE Project |
---|
4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
5 | */ |
---|
6 | |
---|
7 | if (empty($_REQUEST['ksid'])) { |
---|
8 | __logout(); |
---|
9 | } |
---|
10 | |
---|
11 | session_name('OpenPNEktai'); |
---|
12 | session_id($_REQUEST['ksid']); |
---|
13 | session_start(); |
---|
14 | require_once 'OpenPNE/Auth.php'; |
---|
15 | |
---|
16 | $options = array("advancedsecurity"=>false); |
---|
17 | |
---|
18 | $auth = new OpenPNE_Auth('DB','',true); |
---|
19 | $auth->setExpire($GLOBALS['OpenPNE']['common']['session_lifetime']); |
---|
20 | $auth->setIdle($GLOBALS['OpenPNE']['common']['session_idletime']); |
---|
21 | |
---|
22 | if ( !$auth->auth() |
---|
23 | || !($u = $auth->getUsername(LOGIN_NAME_TYPE)) |
---|
24 | || db_member_is_login_rejected($u)) { |
---|
25 | $auth->logout(); |
---|
26 | |
---|
27 | __logout(); |
---|
28 | } |
---|
29 | |
---|
30 | $auth->uid($u); |
---|
31 | $GLOBALS['AUTH'] = $auth; |
---|
32 | |
---|
33 | $GLOBALS['KTAI_C_MEMBER_ID'] = $auth->uid(); |
---|
34 | $GLOBALS['KTAI_URL_TAIL'] = "ksid=" . session_id(); |
---|
35 | |
---|
36 | |
---|
37 | if (!$_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 | } |
---|
60 | } |
---|
61 | |
---|
62 | function __logout($msg = 0, $c_member_id = 0) |
---|
63 | { |
---|
64 | @session_destroy(); |
---|
65 | |
---|
66 | if ($msg) { |
---|
67 | $_REQUEST['msg'] = $msg; |
---|
68 | } |
---|
69 | if ($c_member_id) { |
---|
70 | $_REQUEST['kad'] = t_encrypt(db_member_username4c_member_id($c_member_id, true)); |
---|
71 | } |
---|
72 | $_REQUEST['login_params'] = $_SERVER['QUERY_STRING']; |
---|
73 | openpne_forward('ktai', 'page', 'o_login'); |
---|
74 | exit; |
---|
75 | } |
---|
76 | |
---|
77 | ?> |
---|