mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
set svn property - svn:eol-style LF
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8253 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
9802eaa60a
commit
620b03d184
763 changed files with 114595 additions and 114595 deletions
|
|
@ -1,50 +1,50 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="0.2">
|
||||
<title xml:lang="ko">세션 관리자</title>
|
||||
<title xml:lang="jp">セッション管理</title>
|
||||
<title xml:lang="en">Session</title>
|
||||
<title xml:lang="vi">Session</title>
|
||||
<title xml:lang="zh-CN">会话管理</title>
|
||||
<title xml:lang="zh-TW">SESSION管理</title>
|
||||
<title xml:lang="tr">Oturum</title>
|
||||
<description xml:lang="ko">
|
||||
접속자의 세션을 관리하는 모듈입니다.
|
||||
기본적인 세션 설정과 사용뿐 아니라 세션 정보를 이용하여 접속자등의 세션 기반의 정보를 제공하는 기능도 있습니다.
|
||||
</description>
|
||||
<description xml:lang="jp">
|
||||
アクセスユーザのセッションを管理します。
|
||||
基本的セッション設定はもちろん、セッション情報を利用してアクセスユーザなどのセッション基盤の情報を提供する機能も持っています。
|
||||
</description>
|
||||
<description xml:lang="en">
|
||||
This module manages session data.
|
||||
You will get not only session setting or using but also session-level data such as visitors by using session data.
|
||||
</description>
|
||||
<description xml:lang="tr">
|
||||
Bu modül oturum verisini yönetir.
|
||||
Siz sadece oturum ayarı veya kullanımı değil ayrıca oturum bilgilerini kullanan kullanıcıların oturum-seviyesi verilerini de elde edeceksiniz.
|
||||
</description>
|
||||
<description xml:lang="vi">Module này quản lý dữ liệu Session.
|
||||
Bạn không phải chỉ duy nhất thiết lập Session hay sử dụng, Cấp độ của Session phụ thuộc vào lượng người truy cập trên Website của bạn.
|
||||
</description>
|
||||
<description xml:lang="zh-CN">
|
||||
管理在线会员会话(session)功能的模块。
|
||||
提供最基本的会话设置及使用,并且还可以获得基于会话功能的在线会员信息。
|
||||
</description>
|
||||
<description xml:lang="zh-TW">
|
||||
管理線上會員SESSION功能的模組。
|
||||
提供最基本的SESSION設置和使用,且還可以獲得此功能的線上會員資料。
|
||||
</description>
|
||||
<version>0.1</version>
|
||||
<date>2008-06-18</date>
|
||||
<category>system</category>
|
||||
|
||||
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
|
||||
<name xml:lang="ko">NHN</name>
|
||||
<name xml:lang="vi">NHN</name>
|
||||
<name xml:lang="jp">NHN</name>
|
||||
<name xml:lang="en">NHN</name>
|
||||
<name xml:lang="zh-CN">NHN</name>
|
||||
<name xml:lang="zh-TW">NHN</name>
|
||||
<name xml:lang="tr">NHN</name>
|
||||
</author>
|
||||
</module>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="0.2">
|
||||
<title xml:lang="ko">세션 관리자</title>
|
||||
<title xml:lang="jp">セッション管理</title>
|
||||
<title xml:lang="en">Session</title>
|
||||
<title xml:lang="vi">Session</title>
|
||||
<title xml:lang="zh-CN">会话管理</title>
|
||||
<title xml:lang="zh-TW">SESSION管理</title>
|
||||
<title xml:lang="tr">Oturum</title>
|
||||
<description xml:lang="ko">
|
||||
접속자의 세션을 관리하는 모듈입니다.
|
||||
기본적인 세션 설정과 사용뿐 아니라 세션 정보를 이용하여 접속자등의 세션 기반의 정보를 제공하는 기능도 있습니다.
|
||||
</description>
|
||||
<description xml:lang="jp">
|
||||
アクセスユーザのセッションを管理します。
|
||||
基本的セッション設定はもちろん、セッション情報を利用してアクセスユーザなどのセッション基盤の情報を提供する機能も持っています。
|
||||
</description>
|
||||
<description xml:lang="en">
|
||||
This module manages session data.
|
||||
You will get not only session setting or using but also session-level data such as visitors by using session data.
|
||||
</description>
|
||||
<description xml:lang="tr">
|
||||
Bu modül oturum verisini yönetir.
|
||||
Siz sadece oturum ayarı veya kullanımı değil ayrıca oturum bilgilerini kullanan kullanıcıların oturum-seviyesi verilerini de elde edeceksiniz.
|
||||
</description>
|
||||
<description xml:lang="vi">Module này quản lý dữ liệu Session.
|
||||
Bạn không phải chỉ duy nhất thiết lập Session hay sử dụng, Cấp độ của Session phụ thuộc vào lượng người truy cập trên Website của bạn.
|
||||
</description>
|
||||
<description xml:lang="zh-CN">
|
||||
管理在线会员会话(session)功能的模块。
|
||||
提供最基本的会话设置及使用,并且还可以获得基于会话功能的在线会员信息。
|
||||
</description>
|
||||
<description xml:lang="zh-TW">
|
||||
管理線上會員SESSION功能的模組。
|
||||
提供最基本的SESSION設置和使用,且還可以獲得此功能的線上會員資料。
|
||||
</description>
|
||||
<version>0.1</version>
|
||||
<date>2008-06-18</date>
|
||||
<category>system</category>
|
||||
|
||||
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
|
||||
<name xml:lang="ko">NHN</name>
|
||||
<name xml:lang="vi">NHN</name>
|
||||
<name xml:lang="jp">NHN</name>
|
||||
<name xml:lang="en">NHN</name>
|
||||
<name xml:lang="zh-CN">NHN</name>
|
||||
<name xml:lang="zh-TW">NHN</name>
|
||||
<name xml:lang="tr">NHN</name>
|
||||
</author>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/ko.lang.php
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief Korean Language Pack (Basic Contents Only)
|
||||
**/
|
||||
|
||||
$lang->session = 'Session';
|
||||
$lang->about_session = "This module manages sessions\nFrequent session arrangement will provide better environment for your site.";
|
||||
|
||||
$lang->cmd_clear_session = 'Arrange Session';
|
||||
$lang->session_cleared = 'Session data have been arranged succesfully';
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/ko.lang.php
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief Korean Language Pack (Basic Contents Only)
|
||||
**/
|
||||
|
||||
$lang->session = 'Session';
|
||||
$lang->about_session = "This module manages sessions\nFrequent session arrangement will provide better environment for your site.";
|
||||
|
||||
$lang->cmd_clear_session = 'Arrange Session';
|
||||
$lang->session_cleared = 'Session data have been arranged succesfully';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/fr.lang.php
|
||||
* @author NHN (developers@xpressengine.com) Traduit par Pierre Duvent <PierreDuvent@gmail.com>
|
||||
* @brief Paquet du langage en français pour le module de la Session
|
||||
**/
|
||||
|
||||
$lang->session = 'Session';
|
||||
$lang->about_session = "Ce module administre les sessions\nL'arrangement fréquent des sessions pourvoira de meilleur environnement pour votre site Web.";
|
||||
|
||||
$lang->cmd_clear_session = 'Arranger la Session';
|
||||
$lang->session_cleared = 'Les données de Session sont arrangées avec succès';
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/fr.lang.php
|
||||
* @author NHN (developers@xpressengine.com) Traduit par Pierre Duvent <PierreDuvent@gmail.com>
|
||||
* @brief Paquet du langage en français pour le module de la Session
|
||||
**/
|
||||
|
||||
$lang->session = 'Session';
|
||||
$lang->about_session = "Ce module administre les sessions\nL'arrangement fréquent des sessions pourvoira de meilleur environnement pour votre site Web.";
|
||||
|
||||
$lang->cmd_clear_session = 'Arranger la Session';
|
||||
$lang->session_cleared = 'Les données de Session sont arrangées avec succès';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/jp.lang.php
|
||||
* @author NHN (developers@xpressengine.com) 翻訳:ミニミ
|
||||
* @brief 日本語言語パッケージ(基本的な内容のみ)
|
||||
**/
|
||||
|
||||
$lang->session = 'セッション';
|
||||
$lang->about_session = "セッションを管理するモジュールです。\n定期的なセッションの整理はサイトパフォーマンスに効果的です。";
|
||||
|
||||
$lang->cmd_clear_session = 'セッション整理';
|
||||
$lang->session_cleared = 'ごみセッションが整理されました。';
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/jp.lang.php
|
||||
* @author NHN (developers@xpressengine.com) 翻訳:ミニミ
|
||||
* @brief 日本語言語パッケージ(基本的な内容のみ)
|
||||
**/
|
||||
|
||||
$lang->session = 'セッション';
|
||||
$lang->about_session = "セッションを管理するモジュールです。\n定期的なセッションの整理はサイトパフォーマンスに効果的です。";
|
||||
|
||||
$lang->cmd_clear_session = 'セッション整理';
|
||||
$lang->session_cleared = 'ごみセッションが整理されました。';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/ko.lang.php
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief 한국어 언어팩 (기본적인 내용만 수록)
|
||||
**/
|
||||
|
||||
$lang->session = '세션';
|
||||
$lang->about_session = "세션 관리를 하는 모듈입니다.\n틈틈이 세션 정리를 하시면 사이트 운영에 보다 좋은 효과를 낼 수 있습니다.";
|
||||
|
||||
$lang->cmd_clear_session = '세션 정리';
|
||||
$lang->session_cleared = '쓸모 없는 세션 정보가 정리되었습니다.';
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/ko.lang.php
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief 한국어 언어팩 (기본적인 내용만 수록)
|
||||
**/
|
||||
|
||||
$lang->session = '세션';
|
||||
$lang->about_session = "세션 관리를 하는 모듈입니다.\n틈틈이 세션 정리를 하시면 사이트 운영에 보다 좋은 효과를 낼 수 있습니다.";
|
||||
|
||||
$lang->cmd_clear_session = '세션 정리';
|
||||
$lang->session_cleared = '쓸모 없는 세션 정보가 정리되었습니다.';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/ko.lang.php
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief Korean Language Pack (Basic Contents Only)
|
||||
**/
|
||||
|
||||
$lang->session = 'Oturum';
|
||||
$lang->about_session = "Bu modül oturumları yönetir\nAlışılmış oturum düzenlemesi, sitenize daha iyi bir ortam sağlayacaktır.";
|
||||
|
||||
$lang->cmd_clear_session = 'Oturum Düzenle';
|
||||
$lang->session_cleared = 'Oturum verisi başarıyla düzenlendi';
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/ko.lang.php
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief Korean Language Pack (Basic Contents Only)
|
||||
**/
|
||||
|
||||
$lang->session = 'Oturum';
|
||||
$lang->about_session = "Bu modül oturumları yönetir\nAlışılmış oturum düzenlemesi, sitenize daha iyi bir ortam sağlayacaktır.";
|
||||
|
||||
$lang->cmd_clear_session = 'Oturum Düzenle';
|
||||
$lang->session_cleared = 'Oturum verisi başarıyla düzenlendi';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
/* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
||||
░░ * @File : common/lang/vi.lang.php ░░
|
||||
░░ * @Author : NHN (developers@xpressengine.com) ░░
|
||||
░░ * @Trans : Đào Đức Duy (ducduy.dao.vn@vietxe.net) ░░
|
||||
░░ * @Website: http://vietxe.net ░░
|
||||
░░ * @Brief : Vietnamese Language Pack (Only basic words are included here) ░░
|
||||
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ */
|
||||
|
||||
$lang->session = 'Session';
|
||||
$lang->about_session = "Module này quản lý những Session\nThường xuyên xắp xếp Session sẽ giúp Website của bạn hoạt động ổn định và nhanh hơn.";
|
||||
|
||||
$lang->cmd_clear_session = 'Sắp xếp Session';
|
||||
$lang->session_cleared = 'Session Data đã được sắp xếp thành công!';
|
||||
?>
|
||||
<?php
|
||||
/* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
||||
░░ * @File : common/lang/vi.lang.php ░░
|
||||
░░ * @Author : NHN (developers@xpressengine.com) ░░
|
||||
░░ * @Trans : Đào Đức Duy (ducduy.dao.vn@vietxe.net) ░░
|
||||
░░ * @Website: http://vietxe.net ░░
|
||||
░░ * @Brief : Vietnamese Language Pack (Only basic words are included here) ░░
|
||||
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ */
|
||||
|
||||
$lang->session = 'Session';
|
||||
$lang->about_session = "Module này quản lý những Session\nThường xuyên xắp xếp Session sẽ giúp Website của bạn hoạt động ổn định và nhanh hơn.";
|
||||
|
||||
$lang->cmd_clear_session = 'Sắp xếp Session';
|
||||
$lang->session_cleared = 'Session Data đã được sắp xếp thành công!';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/zh-CN.lang.php
|
||||
* @author NHN (developers@xpressengine.com) 翻译:guny
|
||||
* @brief 会话模块简体中文语言包
|
||||
**/
|
||||
|
||||
$lang->session = '会话';
|
||||
$lang->about_session = "管理会话的模块。\n有时间清理无用会话,可提高网站效率。";
|
||||
|
||||
$lang->cmd_clear_session = '清理会话';
|
||||
$lang->session_cleared = '无用会话已清理完毕。';
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/zh-CN.lang.php
|
||||
* @author NHN (developers@xpressengine.com) 翻译:guny
|
||||
* @brief 会话模块简体中文语言包
|
||||
**/
|
||||
|
||||
$lang->session = '会话';
|
||||
$lang->about_session = "管理会话的模块。\n有时间清理无用会话,可提高网站效率。";
|
||||
|
||||
$lang->cmd_clear_session = '清理会话';
|
||||
$lang->session_cleared = '无用会话已清理完毕。';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/zh-TW.lang.php
|
||||
* @author NHN (developers@xpressengine.com) 翻譯:royallin
|
||||
* @brief SESSION模組正體中文語言
|
||||
**/
|
||||
|
||||
$lang->session = 'SESSION';
|
||||
$lang->about_session = "管理SESSION的模組。\n請定時清理SESSION,可提高網站效率。";
|
||||
|
||||
$lang->cmd_clear_session = '清理SESSION';
|
||||
$lang->session_cleared = 'SESSION已清理完畢。';
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @file modules/session/lang/zh-TW.lang.php
|
||||
* @author NHN (developers@xpressengine.com) 翻譯:royallin
|
||||
* @brief SESSION模組正體中文語言
|
||||
**/
|
||||
|
||||
$lang->session = 'SESSION';
|
||||
$lang->about_session = "管理SESSION的模組。\n請定時清理SESSION,可提高網站效率。";
|
||||
|
||||
$lang->cmd_clear_session = '清理SESSION';
|
||||
$lang->session_cleared = 'SESSION已清理完畢。';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
<?php
|
||||
/**
|
||||
* @class sessionAdminController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief session 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class sessionAdminController extends session {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 더비 세션 정리하는 action
|
||||
**/
|
||||
function procSessionAdminClear() {
|
||||
$oSessionController = &getController('session');
|
||||
$oSessionController->gc(0);
|
||||
|
||||
$this->add('result',Context::getLang('session_cleared'));
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @class sessionAdminController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief session 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class sessionAdminController extends session {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 더비 세션 정리하는 action
|
||||
**/
|
||||
function procSessionAdminClear() {
|
||||
$oSessionController = &getController('session');
|
||||
$oSessionController->gc(0);
|
||||
|
||||
$this->add('result',Context::getLang('session_cleared'));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
<?php
|
||||
/**
|
||||
* @class sessionAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief session모듈의 admin view class
|
||||
**/
|
||||
|
||||
class sessionAdminView extends session {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설정
|
||||
**/
|
||||
function dispSessionAdminIndex() {
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @class sessionAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief session모듈의 admin view class
|
||||
**/
|
||||
|
||||
class sessionAdminView extends session {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설정
|
||||
**/
|
||||
function dispSessionAdminIndex() {
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,83 +1,83 @@
|
|||
<?php
|
||||
/**
|
||||
* @class session
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief session 모듈의 high class
|
||||
* @version 0.1
|
||||
*
|
||||
* session 관리를 하는 class
|
||||
**/
|
||||
|
||||
class session extends ModuleObject {
|
||||
|
||||
var $lifetime = 18000;
|
||||
var $session_started = false;
|
||||
|
||||
function session() {
|
||||
if(Context::isInstalled()) $this->session_started= true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치시 추가 작업이 필요할시 구현
|
||||
**/
|
||||
function moduleInstall() {
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치가 이상이 없는지 체크하는 method
|
||||
**/
|
||||
function checkUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isTableExists('session')) return true;
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) return true;
|
||||
if(!$oDB->isIndexExists("session","idx_session_update_mid")) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 업데이트 실행
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml');
|
||||
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128);
|
||||
|
||||
if(!$oDB->isIndexExists("session","idx_session_update_mid")) $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief session string decode
|
||||
**/
|
||||
function unSerializeSession($val) {
|
||||
$vars = preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/', $val,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
||||
for($i=0; $vars[$i]; $i++) $result[$vars[$i++]] = unserialize($vars[$i]);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief session string encode
|
||||
**/
|
||||
function serializeSession($data) {
|
||||
if(!count($data)) return;
|
||||
|
||||
$str = '';
|
||||
foreach($data as $key => $val) $str .= $key.'|'.serialize($val);
|
||||
return substr($str, 0, strlen($str)-1).'}';
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 캐시 파일 재생성
|
||||
**/
|
||||
function recompileCache() {
|
||||
// 기존 파일 기반의 세션 삭제
|
||||
FileHandler::removeDir(_XE_PATH_."files/sessions");
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @class session
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief session 모듈의 high class
|
||||
* @version 0.1
|
||||
*
|
||||
* session 관리를 하는 class
|
||||
**/
|
||||
|
||||
class session extends ModuleObject {
|
||||
|
||||
var $lifetime = 18000;
|
||||
var $session_started = false;
|
||||
|
||||
function session() {
|
||||
if(Context::isInstalled()) $this->session_started= true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치시 추가 작업이 필요할시 구현
|
||||
**/
|
||||
function moduleInstall() {
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치가 이상이 없는지 체크하는 method
|
||||
**/
|
||||
function checkUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isTableExists('session')) return true;
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) return true;
|
||||
if(!$oDB->isIndexExists("session","idx_session_update_mid")) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 업데이트 실행
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml');
|
||||
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128);
|
||||
|
||||
if(!$oDB->isIndexExists("session","idx_session_update_mid")) $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief session string decode
|
||||
**/
|
||||
function unSerializeSession($val) {
|
||||
$vars = preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/', $val,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
||||
for($i=0; $vars[$i]; $i++) $result[$vars[$i++]] = unserialize($vars[$i]);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief session string encode
|
||||
**/
|
||||
function serializeSession($data) {
|
||||
if(!count($data)) return;
|
||||
|
||||
$str = '';
|
||||
foreach($data as $key => $val) $str .= $key.'|'.serialize($val);
|
||||
return substr($str, 0, strlen($str)-1).'}';
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 캐시 파일 재생성
|
||||
**/
|
||||
function recompileCache() {
|
||||
// 기존 파일 기반의 세션 삭제
|
||||
FileHandler::removeDir(_XE_PATH_."files/sessions");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,70 +1,70 @@
|
|||
<?php
|
||||
/**
|
||||
* @class sessionController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief session 모듈의 controller class
|
||||
**/
|
||||
|
||||
class sessionController extends session {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
function open() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function close() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function write($session_key, $val) {
|
||||
if(!$session_key || !$this->session_started) return;
|
||||
|
||||
$args->session_key = $session_key;
|
||||
$output = executeQuery('session.getSession', $args);
|
||||
$session_info = $output->data;
|
||||
if($session_info->session_key == $session_key && $session_info->ipaddress != $_SERVER['REMOTE_ADDR']) {
|
||||
executeQuery('session.deleteSession', $args);
|
||||
return true;
|
||||
}
|
||||
|
||||
$args->expired = date("YmdHis", time()+$this->lifetime);
|
||||
$args->val = $val;
|
||||
$args->cur_mid = Context::get('mid');
|
||||
if(!$args->cur_mid) {
|
||||
$module_info = Context::get('current_module_info');
|
||||
$args->cur_mid = $module_info->mid;
|
||||
}
|
||||
|
||||
if(Context::get('is_logged')) {
|
||||
$logged_info = Context::get('logged_info');
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
} else {
|
||||
$args->member_srl = 0;
|
||||
}
|
||||
|
||||
if($session_info->session_key) $output = executeQuery('session.updateSession', $args);
|
||||
else $output = executeQuery('session.insertSession', $args);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function destroy($session_key) {
|
||||
if(!$session_key || !$this->session_started) return;
|
||||
|
||||
$args->session_key = $session_key;
|
||||
executeQuery('session.deleteSession', $args);
|
||||
return true;
|
||||
}
|
||||
|
||||
function gc($maxlifetime) {
|
||||
if(!$this->session_started) return;
|
||||
executeQuery('session.gcSession');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @class sessionController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief session 모듈의 controller class
|
||||
**/
|
||||
|
||||
class sessionController extends session {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
function open() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function close() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function write($session_key, $val) {
|
||||
if(!$session_key || !$this->session_started) return;
|
||||
|
||||
$args->session_key = $session_key;
|
||||
$output = executeQuery('session.getSession', $args);
|
||||
$session_info = $output->data;
|
||||
if($session_info->session_key == $session_key && $session_info->ipaddress != $_SERVER['REMOTE_ADDR']) {
|
||||
executeQuery('session.deleteSession', $args);
|
||||
return true;
|
||||
}
|
||||
|
||||
$args->expired = date("YmdHis", time()+$this->lifetime);
|
||||
$args->val = $val;
|
||||
$args->cur_mid = Context::get('mid');
|
||||
if(!$args->cur_mid) {
|
||||
$module_info = Context::get('current_module_info');
|
||||
$args->cur_mid = $module_info->mid;
|
||||
}
|
||||
|
||||
if(Context::get('is_logged')) {
|
||||
$logged_info = Context::get('logged_info');
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
} else {
|
||||
$args->member_srl = 0;
|
||||
}
|
||||
|
||||
if($session_info->session_key) $output = executeQuery('session.updateSession', $args);
|
||||
else $output = executeQuery('session.insertSession', $args);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function destroy($session_key) {
|
||||
if(!$session_key || !$this->session_started) return;
|
||||
|
||||
$args->session_key = $session_key;
|
||||
executeQuery('session.deleteSession', $args);
|
||||
return true;
|
||||
}
|
||||
|
||||
function gc($maxlifetime) {
|
||||
if(!$this->session_started) return;
|
||||
executeQuery('session.gcSession');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,93 +1,93 @@
|
|||
<?php
|
||||
/**
|
||||
* @class sessionModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief session 모듈의 Model class
|
||||
**/
|
||||
|
||||
class sessionModel extends session {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
function getLifeTime() {
|
||||
return $this->lifetime;
|
||||
}
|
||||
|
||||
function read($session_key) {
|
||||
if(!$session_key || !$this->session_started) return;
|
||||
|
||||
$args->session_key = $session_key;
|
||||
$output = executeQuery('session.getSession', $args);
|
||||
|
||||
// 읽기 오류 발생시 테이블 생성 유무 확인
|
||||
if(!$output->toBool()) {
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml');
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128);
|
||||
$output = executeQuery('session.getSession', $args);
|
||||
}
|
||||
|
||||
// 세션 정보에서 cur_mid값이 없을 경우 테이블 생성 체크
|
||||
if(!isset($output->data->cur_mid)) {
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128);
|
||||
}
|
||||
|
||||
return $output->data->val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 현재 접속중인 사용자의 목록을 구함
|
||||
* 여러개의 인자값을 필요로 해서 object를 인자로 받음
|
||||
* limit_count : 대상 수
|
||||
* page : 페이지 번호
|
||||
* period_time : 인자의 값을 n으로 하여 최근 n분 이내에 세션을 갱신한 대상을 추출함
|
||||
* mid : 특정 mid에 속한 사용자
|
||||
**/
|
||||
function getLoggedMembers($args) {
|
||||
if(!$args->site_srl) {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
}
|
||||
if(!$args->list_count) $args->list_count = 20;
|
||||
if(!$args->page) $args->page = 1;
|
||||
if(!$args->period_time) $args->period_time = 3;
|
||||
$args->last_update = date("YmdHis", time() - $args->period_time*60);
|
||||
|
||||
$output = executeQueryArray('session.getLoggedMembers', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$member_srls = array();
|
||||
if(count($output->data)) {
|
||||
foreach($output->data as $key => $val) {
|
||||
$member_srls[$key] = $val->member_srl;
|
||||
$member_keys[$val->member_srl] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
if(Context::get('is_logged')) {
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!in_array($logged_info->member_srl, $member_srls)) {
|
||||
$member_srls[0] = $logged_info->member_srl;
|
||||
$member_keys[$logged_info->member_srl] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(!count($member_srls)) return $output;
|
||||
|
||||
$member_args->member_srl = implode(',',$member_srls);
|
||||
$member_output = executeQueryArray('member.getMembers', $member_args);
|
||||
if($member_output->data) {
|
||||
foreach($member_output->data as $key => $val) {
|
||||
$output->data[$member_keys[$val->member_srl]] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @class sessionModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief session 모듈의 Model class
|
||||
**/
|
||||
|
||||
class sessionModel extends session {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
function getLifeTime() {
|
||||
return $this->lifetime;
|
||||
}
|
||||
|
||||
function read($session_key) {
|
||||
if(!$session_key || !$this->session_started) return;
|
||||
|
||||
$args->session_key = $session_key;
|
||||
$output = executeQuery('session.getSession', $args);
|
||||
|
||||
// 읽기 오류 발생시 테이블 생성 유무 확인
|
||||
if(!$output->toBool()) {
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml');
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128);
|
||||
$output = executeQuery('session.getSession', $args);
|
||||
}
|
||||
|
||||
// 세션 정보에서 cur_mid값이 없을 경우 테이블 생성 체크
|
||||
if(!isset($output->data->cur_mid)) {
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128);
|
||||
}
|
||||
|
||||
return $output->data->val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 현재 접속중인 사용자의 목록을 구함
|
||||
* 여러개의 인자값을 필요로 해서 object를 인자로 받음
|
||||
* limit_count : 대상 수
|
||||
* page : 페이지 번호
|
||||
* period_time : 인자의 값을 n으로 하여 최근 n분 이내에 세션을 갱신한 대상을 추출함
|
||||
* mid : 특정 mid에 속한 사용자
|
||||
**/
|
||||
function getLoggedMembers($args) {
|
||||
if(!$args->site_srl) {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
}
|
||||
if(!$args->list_count) $args->list_count = 20;
|
||||
if(!$args->page) $args->page = 1;
|
||||
if(!$args->period_time) $args->period_time = 3;
|
||||
$args->last_update = date("YmdHis", time() - $args->period_time*60);
|
||||
|
||||
$output = executeQueryArray('session.getLoggedMembers', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$member_srls = array();
|
||||
if(count($output->data)) {
|
||||
foreach($output->data as $key => $val) {
|
||||
$member_srls[$key] = $val->member_srl;
|
||||
$member_keys[$val->member_srl] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
if(Context::get('is_logged')) {
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!in_array($logged_info->member_srl, $member_srls)) {
|
||||
$member_srls[0] = $logged_info->member_srl;
|
||||
$member_keys[$logged_info->member_srl] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(!count($member_srls)) return $output;
|
||||
|
||||
$member_args->member_srl = implode(',',$member_srls);
|
||||
$member_output = executeQueryArray('member.getMembers', $member_args);
|
||||
if($member_output->data) {
|
||||
foreach($member_output->data as $key => $val) {
|
||||
$output->data[$member_keys[$val->member_srl]] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue