うぇブログD3 - 白扇モジュールインストール時のハック
ヘッダーナビゲーション
白扇モジュールインストール時のハック2008/03/28 6:28 pm
白扇モジュールはもう配布されていないので残念であるが、ユーザーのアカウント情報の表示内容を項目ごとに表示・非表示のコントロールができて便利であるため、現在も利用させて頂いている。
白扇モジュールのインストール前に、xoopsルートディレクトリにある
edituser.php
register.php
userinfo.php
をハックする必要がある。
[edituser.phpのハック箇所]
$xoopsOption['pagetype'] = 'user';
include 'mainfile.php';
include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
// Hakusen Alt
if(file_exists(XOOPS_ROOT_PATH."/modules/hakusen/edituser.php")){
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname('hakusen');
if( $module->getVar('isactive') == 1){
header('Location: '.XOOPS_URL.'/modules/hakusen/edituser.php');
}
}
// Hakusen Alt
// If not a user, redirect
if (!is_object($xoopsUser)) {
redirect_header('index.php',3,_US_NOEDITRIGHT);
exit();
}
[register.phpのハック箇所]
$xoopsOption['pagetype'] = 'user';
include 'mainfile.php';
// Hakusen Alt
if(file_exists(XOOPS_ROOT_PATH."/modules/hakusen/register.php")){
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname('hakusen');
if( $module->getVar('isactive') == 1){
header('Location: '.XOOPS_URL.'/modules/hakusen/register.php');
}
}
// Hakusen Alt
$myts =& MyTextSanitizer::getInstance();
[userinfo.phpのハック箇所]
$xoopsOption['pagetype'] = 'user';
include 'mainfile.php';
include_once XOOPS_ROOT_PATH.'/class/module.textsanitizer.php';
include_once XOOPS_ROOT_PATH . '/modules/system/constants.php';
$uid = intval($_GET['uid']);
if ($uid <= 0) {
redirect_header('index.php', 3, _US_SELECTNG);
exit();
}
// Hakusen Alt
if(file_exists(XOOPS_ROOT_PATH."/modules/hakusen/userinfo.php")){
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname('hakusen');
if( $module->getVar('isactive') == 1){
header('Location: '.XOOPS_URL.'/modules/hakusen/userinfo.php?uid='.$uid);
}
}
// Hakusen Alt
$gperm_handler = & xoops_gethandler( 'groupperm' );
$groups = ( $xoopsUser ) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS;
白扇モジュールのインストール前に、xoopsルートディレクトリにある
edituser.php
register.php
userinfo.php
をハックする必要がある。
[edituser.phpのハック箇所]
$xoopsOption['pagetype'] = 'user';
include 'mainfile.php';
include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
// Hakusen Alt
if(file_exists(XOOPS_ROOT_PATH."/modules/hakusen/edituser.php")){
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname('hakusen');
if( $module->getVar('isactive') == 1){
header('Location: '.XOOPS_URL.'/modules/hakusen/edituser.php');
}
}
// Hakusen Alt
// If not a user, redirect
if (!is_object($xoopsUser)) {
redirect_header('index.php',3,_US_NOEDITRIGHT);
exit();
}
[register.phpのハック箇所]
$xoopsOption['pagetype'] = 'user';
include 'mainfile.php';
// Hakusen Alt
if(file_exists(XOOPS_ROOT_PATH."/modules/hakusen/register.php")){
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname('hakusen');
if( $module->getVar('isactive') == 1){
header('Location: '.XOOPS_URL.'/modules/hakusen/register.php');
}
}
// Hakusen Alt
$myts =& MyTextSanitizer::getInstance();
[userinfo.phpのハック箇所]
$xoopsOption['pagetype'] = 'user';
include 'mainfile.php';
include_once XOOPS_ROOT_PATH.'/class/module.textsanitizer.php';
include_once XOOPS_ROOT_PATH . '/modules/system/constants.php';
$uid = intval($_GET['uid']);
if ($uid <= 0) {
redirect_header('index.php', 3, _US_SELECTNG);
exit();
}
// Hakusen Alt
if(file_exists(XOOPS_ROOT_PATH."/modules/hakusen/userinfo.php")){
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname('hakusen');
if( $module->getVar('isactive') == 1){
header('Location: '.XOOPS_URL.'/modules/hakusen/userinfo.php?uid='.$uid);
}
}
// Hakusen Alt
$gperm_handler = & xoops_gethandler( 'groupperm' );
$groups = ( $xoopsUser ) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS;