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

source: OpenPNE/branches/takanashi/prj_takanashi3/webapp/modules/ktai/auth.inc @ 1172

Last change on this file since 1172 was 1172, checked in by takanashi, 14 years ago

外部認証使用しないときのリダイレクト抑止

File size: 1.9 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
7if (empty($_REQUEST['ksid'])) {
8    __logout();
9}
10
11session_name('OpenPNEktai');
12session_id($_REQUEST['ksid']);
13session_start();
14require_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
22if (   !$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
37if ((LOGIN_NAME_TYPE == 1) && !$_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
62function __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?>
Note: See TracBrowser for help on using the repository browser.