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

source: OpenPNE/trunk/webapp/lib/auth.inc @ 4032

Last change on this file since 4032 was 4032, checked in by ebihara, 15 years ago

r3811の変更を取り消し

File size: 2.2 KB
Line 
1<?php
2/**
3 * @copyright 2005-2007 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 = db_member_c_member_id4username_encrypted($auth->getUsername(), false))
15    || db_member_is_login_rejected($u)) {
16    $auth->logout();
17
18    if (LOGIN_URL_PC) {
19        client_redirect_absolute(get_login_url());
20    } else {
21        $parts = explode('/', $_SERVER['SCRIPT_NAME']);
22        $_REQUEST['target_script'] = array_pop($parts);
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 (IS_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    );
53   
54    if (($check_param==1) && !$prof_ext_page[$current_page]) {
55        openpne_redirect('pc', 'page_h_regist_prof');
56    }
57   
58    //メールアドレスが未登録の場合はリダイレクト
59    $mail_ext_page=array(
60    'do_h_regist_address'=>true,
61    'page_h_regist_address'=>true,
62    'do_inc_page_header_logout'=>true,
63    );
64   
65    if (($check_param==2) && !$mail_ext_page[$current_page]) {
66        openpne_redirect('pc', 'page_h_regist_address');
67    }
68}
69
70?>
Note: See TracBrowser for help on using the repository browser.