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

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

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

revert:1300

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    || !(db_member_username4c_member_id($u, 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        $_REQUEST['login_params'] = $_SERVER['QUERY_STRING'];
23        openpne_forward('pc', 'page', "o_login");
24        exit;
25    }
26}
27
28$auth->uid($u);
29$GLOBALS['AUTH'] = $auth;
30
31if ((LOGIN_NAME_TYPE == 1) && !$_SESSION['regist_step']) {
32    $check_param = db_member_check_param_inputed($u);
33    $_SESSION['regist_step'] = ($check_param == 0);
34   
35    //プロフィールが未登録の場合はリダイレクト
36    $prof_ext_page=array(
37    "do_h_regist_prof"=>true,
38    "page_h_regist_prof"=>true,
39    "do_inc_page_header_logout"=>true,
40    );
41   
42    if (($check_param==1) && !$prof_ext_page[$_REQUEST['a']]) {
43        openpne_redirect('pc', 'page_h_regist_prof');
44    }
45   
46    //メールアドレスが未登録の場合はリダイレクト
47    $mail_ext_page=array(
48    "do_h_regist_address"=>true,
49    "page_h_regist_address"=>true,
50    "do_inc_page_header_logout"=>true,
51    );
52   
53    if (($check_param==2) && !$mail_ext_page[$_REQUEST['a']]) {
54        openpne_redirect('pc', 'page_h_regist_address');
55    }
56}
57
58?>
Note: See TracBrowser for help on using the repository browser.