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

source: OpenPNE/branches/maruyama/prj_ext_auth/webapp/lib/auth.inc @ 1300

Last change on this file since 1300 was 1300, checked in by maruyama, 14 years ago

過去のセッションで他のユーザと認識される対策

File size: 1.6 KB
Line 
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
7require_once 'OpenPNE/Auth.php';
8
9$auth = new OpenPNE_Auth();
10$auth->setExpire($GLOBALS['OpenPNE']['common']['session_lifetime']);
11$auth->setIdle($GLOBALS['OpenPNE']['common']['session_idletime']);
12
13if (   !$auth->auth()
14    || !($u = $auth->getUsername(LOGIN_NAME_TYPE))
15    || !($u == (string)intval($u))
16    || !(db_member_username4c_member_id($u, false))
17    || db_member_is_login_rejected($u)) {
18    $auth->logout();
19
20    if (LOGIN_URL_PC) {
21        client_redirect_absolute(get_login_url());
22    } else {
23        $_REQUEST['login_params'] = $_SERVER['QUERY_STRING'];
24        openpne_forward('pc', 'page', "o_login");
25        exit;
26    }
27}
28
29$auth->uid($u);
30$GLOBALS['AUTH'] = $auth;
31
32if ((LOGIN_NAME_TYPE == 1) && !$_SESSION['regist_step']) {
33    $check_param = db_member_check_param_inputed($u);
34    $_SESSION['regist_step'] = ($check_param == 0);
35   
36    //プロフィールが未登録の場合はリダイレクト
37    $prof_ext_page=array(
38    "do_h_regist_prof"=>true,
39    "page_h_regist_prof"=>true,
40    "do_inc_page_header_logout"=>true,
41    );
42   
43    if (($check_param==1) && !$prof_ext_page[$_REQUEST['a']]) {
44        openpne_redirect('pc', 'page_h_regist_prof');
45    }
46   
47    //メールアドレスが未登録の場合はリダイレクト
48    $mail_ext_page=array(
49    "do_h_regist_address"=>true,
50    "page_h_regist_address"=>true,
51    "do_inc_page_header_logout"=>true,
52    );
53   
54    if (($check_param==2) && !$mail_ext_page[$_REQUEST['a']]) {
55        openpne_redirect('pc', 'page_h_regist_address');
56    }
57}
58
59?>
Note: See TracBrowser for help on using the repository browser.