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

source: OpenPNE/branches/work/ebihara/prj_id_login/webapp/lib/auth.inc @ 5565

Last change on this file since 5565 was 5565, checked in by ebihara, 12 years ago

#2021:IS_SLAVEPNE->OPENPNE_AUTH_MODE='slavepne'

File size: 2.2 KB
Line 
1<?php
2/**
3 * @copyright 2005-2008 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$config = get_auth_config();
10$auth = new OpenPNE_Auth($config);
11$auth->setExpire($GLOBALS['OpenPNE']['common']['session_lifetime']);
12$auth->setIdle($GLOBALS['OpenPNE']['common']['session_idletime']);
13
14if (   !$auth->auth()
15    || !($u = db_member_c_member_id4username_encrypted($auth->getUsername(), false))
16    || db_member_is_login_rejected($u)) {
17    $auth->logout();
18
19    if (LOGIN_URL_PC) {
20        client_redirect_absolute(get_login_url());
21    } else {
22        $parts = explode('/', $_SERVER['SCRIPT_NAME']);
23        $_REQUEST['login_params'] = $_SERVER['QUERY_STRING'];
24        if ($_SERVER['REQUEST_METHOD'] == 'POST') {
25            $_POST = array('login_params' => $_SERVER['QUERY_STRING']);
26        } else {
27            $_GET = array('login_params' => $_SERVER['QUERY_STRING']);
28        }
29        openpne_forward('pc', 'page', "o_login");
30        exit;
31    }
32}
33
34if (db_member_is_blacklist($u)) {
35    $p = array('msg_code' => 'blacklist');
36    openpne_redirect('pc', 'page_o_tologin', $p);
37}
38
39$auth->uid($u);
40$GLOBALS['AUTH'] = $auth;
41
42if (OPENPNE_AUTH_MODE == 'slavepne' && (empty($_SESSION['regist_step']) || !$_SESSION['regist_step'])) {
43    $check_param = db_member_check_param_inputed($u);
44    $_SESSION['regist_step'] = ($check_param == 0);
45    $current_page = $GLOBALS['__Framework']['current_type'] . '_' . $GLOBALS['__Framework']['current_action'];
46
47    // プロフィールが未登録の場合はリダイレクト
48    $prof_ext_page = array(
49        'do_h_regist_prof' => true,
50        'page_h_regist_prof' => true,
51        'do_inc_page_header_logout' => true,
52        'page_h_regist_intro' => true,
53    );
54
55    if (($check_param == 1) && !$prof_ext_page[$current_page]) {
56        openpne_redirect('pc', 'page_h_regist_intro');
57    }
58
59    // メールアドレスが未登録の場合はリダイレクト
60    $mail_ext_page = array(
61        'do_h_regist_address' => true,
62        'page_h_regist_address' => true,
63        'do_inc_page_header_logout' => true,
64    );
65
66    if (($check_param == 2) && !$mail_ext_page[$current_page]) {
67        openpne_redirect('pc', 'page_h_regist_address');
68    }
69}
70
71?>
Note: See TracBrowser for help on using the repository browser.