File: //opt/cloudlinux/alt-php53/root/usr/share/pear/RVSeagullMod/modules/forums/classes/ForumsMgr.php
<?php
##copyright##
/**
* Forums Manager
*
* @package forums
* @author Pairote Manunphol <pairote@rvglobalsoft.com>
* @author Parinya Chaipetch <parinya@rvglobalsoft.com>
*/
class ForumsMgr extends SGL_Manager
{
function ForumsMgr()
{
parent::SGL_Manager();
$this->pageTitle = 'Forums';
$this->template = 'under_construction.html';
$this->_aActionsMapping = array(
'view' => array('view'),
'login' => array('login'),
);
}
function validate($req, &$input)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
$this->validated = true;
$input->error = array();
$input->masterTemplate = $this->masterTemplate;
$input->action = ($req->get('action')) ? $req->get('action') : 'view';
$input->pageTitle = $this->pageTitle;
$input->pageAction = $input->action;
$input->template = $this->template;
switch ($input->action) {
case 'login' :
$input->username = $req->get('frmUsername');
$input->password = $req->get('frmPassword');
$input->redir = $req->get('redir');
break;
case 'view' :
break;
}
}
function display(&$output)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
}
function _cmd_view($input, &$output)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
$this->forumRedirect();
}
function _cmd_login($input, &$output)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
$redir = SGL_BASE_URL . '/' . SGL_Config::get('site.frontScriptName') . '/forums/adminforums/';
$options = array(
'moduleName' => 'user',
'managerName' => 'login',
'action' => 'login',
'frmUsername' => $input->username,
'frmPassword' => $input->password,
'redir' => base64_encode($redir),
);
SGL_HTTP::redirect($options);
}
function forumRedirect ()
{
$pathInstallComplete = SGL_Config::get('path.webRoot'). '/forums/installcomplete.sql';
$pathIndex = SGL_Config::get('path.webRoot') . "/forums/index.php";
$pathInstall = SGL_Config::get('path.webRoot') . "/forums/install.php";
if(is_file($pathInstallComplete) && is_file($pathIndex) && !is_file($pathInstall)) {
//if(is_file($pathIndex)) {
header("Location: " . SGL_Config::get('site.baseUrl') . "/forums/index.php");
//}
}
/*
$oBoardCategory = $this->getBoardId();
$categoryId = isset($oBoardCategory->ID_CAT) ? $oBoardCategory->ID_CAT : 0;
if(is_file($pathInstallComplete) && is_file($pathIndex)
&& !is_file($pathInstall) && SGL_Config::get('forums.categoryType') == 1) {
//if(is_file($pathIndex)) {
header("Location: " . SGL_Config::get('site.baseUrl') . "/forums/index.php");
//}
} elseif(is_file($pathInstallComplete) && is_file($pathIndex)
&& !is_file($pathInstall) && SGL_Config::get('forums.categoryType') == 0) {
//if(is_file($pathIndex)) {
header("Location: " . SGL_Config::get('site.baseUrl') . "/forums/index.php?board=" . $categoryId);
//}
}
*/
// return true;
}
function getBoardId()
{
$query = sprintf('
SELECT
*
FROM
%s
'
, $this->conf['table']['forums_categories']
);
$res = $this->dbh->getRow($query);
return $res;
}
}
?>