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

source: OpenPNE/branches/prj/slavepne2/webapp/modules/ktai/auth.inc @ 5031

Last change on this file since 5031 was 5031, checked in by ebihara, 14 years ago

#1831:SlavePNE2で初回ログイン時に利用規約を出すようにした

File size: 2.4 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
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']['ktai']['session_lifetime']);
20$auth->setIdle($GLOBALS['OpenPNE']['ktai']['session_idletime']);
21
22if (   !$auth->auth()
23    || !($u = db_member_c_member_id4username_encrypted($auth->getUsername(), true))
24    || db_member_is_login_rejected($u)) {
25    $auth->logout();
26   
27    __logout();
28}
29
30if (db_member_is_blacklist($u)) {
31    ktai_display_error('ログインできませんでした。');
32}
33
34$auth->uid($u);
35$GLOBALS['AUTH'] = $auth;
36
37$GLOBALS['KTAI_C_MEMBER_ID'] = $auth->uid();
38$GLOBALS['KTAI_URL_TAIL'] = "ksid=" . session_id();
39
40
41if (IS_SLAVEPNE && (empty($_SESSION['regist_step']) || !$_SESSION['regist_step'])) {
42    $check_param = db_member_check_param_inputed($u, true);
43    $_SESSION['regist_step'] = ($check_param == 0);
44    $current_page = $GLOBALS['__Framework']['current_type']."_".$GLOBALS['__Framework']['current_action'];
45   
46    //プロフィールが未登録の場合はリダイレクト
47    $prof_ext_page = array(
48        'page_h_regist_pre' => true,
49        'do_h_regist_prof' => true,
50        'page_h_regist_prof' => true,
51    );
52   
53    if (($check_param == 1) && !$prof_ext_page[$current_page]) {
54        openpne_redirect('ktai', 'page_h_regist_pre');
55    }
56   
57    //メールアドレスが未登録の場合はリダイレクト
58    $mail_ext_page = array(
59        'do_h_regist_address' => true,
60        'page_h_regist_address' => true,
61    );
62   
63    if (($check_param == 2) && !$mail_ext_page[$current_page]) {
64        openpne_redirect('ktai', 'page_h_regist_address');
65    }
66}
67
68function __logout($msg = 0, $c_member_id = 0)
69{
70    @session_destroy();
71
72    if ($msg) {
73        $_REQUEST['msg'] = $msg;
74    }
75    if ($c_member_id) {
76        $_REQUEST['kad'] = t_encrypt(db_member_username4c_member_id($c_member_id, true));
77    }
78    $_REQUEST['login_params'] = $_SERVER['QUERY_STRING'];
79    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
80        $_POST = array('login_params' => $_SERVER['QUERY_STRING']);
81    } else {
82        $_GET = array('login_params' => $_SERVER['QUERY_STRING']);
83    }
84    openpne_forward('ktai', 'page', 'o_login');
85    exit;
86}
87
88?>
Note: See TracBrowser for help on using the repository browser.