source: branches/feature-module-paygent/data/class/SC_SiteSession.php @ 17

Revision 17, 1.8 KB checked in by uehara, 14 years ago (diff)
Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8/* ¥«¡¼¥È¥»¥Ã¥·¥ç¥ó´ÉÍý¥¯¥é¥¹ */
9class SC_SiteSession {
10    /* ¥³¥ó¥¹¥È¥é¥¯¥¿ */
11    function SC_SiteSession() {
12        sfDomainSessionStart();
13        // Á°¥Ú¡¼¥¸¤Ç¤ÎÅÐÏ¿À®¸ùȽÄê¤ò°ú¤­·Ñ¤°
14        $_SESSION['site']['pre_regist_success'] = $_SESSION['site']['regist_success'];
15        $_SESSION['site']['regist_success'] = false;
16        $_SESSION['site']['pre_page'] = $_SESSION['site']['now_page'];
17        $_SESSION['site']['now_page'] = $_SERVER['PHP_SELF'];
18    }
19   
20    /* Á°¥Ú¡¼¥¸¤¬ÀµÅö¤Ç¤¢¤ë¤«¤ÎȽÄê */
21    function isPrePage() {
22        if($_SESSION['site']['pre_page'] != "" && $_SESSION['site']['now_page'] != "") {
23            if($_SESSION['site']['pre_regist_success'] || $_SESSION['site']['pre_page'] == $_SESSION['site']['now_page']) {
24                return true;
25            }
26        }
27        return false;
28    }
29   
30    function setNowPage($path) {
31        $_SESSION['site']['now_page'] = $path;
32    }
33   
34    /* ÃͤμèÆÀ */
35    function getValue($keyname) {
36        return $_SESSION['site'][$keyname];
37    }
38   
39    /* ¥æ¥Ë¡¼¥¯ID¤Î¼èÆÀ */
40    function getUniqId() {
41        // ¥æ¥Ë¡¼¥¯ID¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¥»¥Ã¥È¤¹¤ë¡£
42        if(!isset($_SESSION['site']['uniqid']) || $_SESSION['site']['uniqid'] == "") {
43            $this->setUniqId();
44        }
45        return $_SESSION['site']['uniqid'];
46    }
47   
48    /* ¥æ¥Ë¡¼¥¯ID¤Î¥»¥Ã¥È */
49    function setUniqId() {
50        // ͽ¬¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¥é¥ó¥À¥àʸ»úÎó¤òÉÕÍ¿¤¹¤ë¡£
51        $_SESSION['site']['uniqid'] = sfGetUniqRandomId();
52    }
53   
54    /* ¥æ¥Ë¡¼¥¯ID¤Î¥Á¥§¥Ã¥¯ */
55    function checkUniqId() {
56        if($_POST['uniqid'] != "") {
57            if($_POST['uniqid'] != $_SESSION['site']['uniqid']) {
58                return false;
59            }
60        }
61        return true;
62    }
63   
64    /* ¥æ¥Ë¡¼¥¯ID¤Î²ò½ü */
65    function unsetUniqId() {
66        $_SESSION['site']['uniqid'] = "";
67    }
68   
69    /* ÅÐÏ¿À®¸ù¤òµ­Ï¿ */
70    function setRegistFlag() {
71        $_SESSION['site']['regist_success'] = true;
72    }
73}
74?>
Note: See TracBrowser for help on using the repository browser.