private static function init()
 {
     load_functions();
     if (!build()) {
         die('build directories error');
     }
     safe();
 }
function &newbb_load_config()
{
    static $moduleConfig;
    if (isset($moduleConfig)) {
        return $moduleConfig;
    }
    load_functions("config");
    $moduleConfig = mod_loadConfig("newbb");
    return $moduleConfig;
}
Example #3
0
function xoops_module_update_tag(&$module, $prev_version = null)
{
    load_functions("config");
    mod_clearConfg($module->getVar("dirname", "n"));
    if ($prev_version <= 150) {
        $GLOBALS['xoopsDB']->queryFromFile(XOOPS_ROOT_PATH . "/modules/" . $module->getVar("dirname") . "/sql/mysql.150.sql");
    }
    /* Do some synchronization */
    mod_loadFunctions("recon", $module->getVar("dirname"));
    tag_synchronization();
    return true;
}
 /**
  * Function to convert UNIX time to formatted time string
  */
 function newbb_formatTimestamp($time, $format = "c", $timeoffset = "")
 {
     load_functions("locale");
     $newbbConfig = newbb_load_config();
     $format = strtolower($format);
     if ($format == "reg" || $format == "") {
         $format = "c";
     }
     if (($format == "custom" || $format == "c") && !empty($newbbConfig["formatTimestamp_custom"])) {
         $format = $newbbConfig["formatTimestamp_custom"];
     }
     return XoopsLocal::formatTimestamp($time, $format, $timeoffset);
 }
Example #5
0
function xoops_module_update_newbb(&$module, $oldversion = null)
{
    load_functions("config");
    mod_clearConfg($module->getVar("dirname", "n"));
    $newbbConfig = newbb_load_config();
    //$oldversion = $module->getVar('version');
    //$oldconfig = $module->getVar('hasconfig');
    // NewBB 1.0 -- no config
    //if (empty($oldconfig)) {
    if ($oldversion == 100) {
        include_once dirname(__FILE__) . "/module.v100.php";
        xoops_module_update_newbb_v100($module);
    }
    // NewBB 2.* and CBB 1.*
    // change group permission name
    // change forum moderators
    if ($oldversion < 220) {
        include_once dirname(__FILE__) . "/module.v220.php";
        xoops_module_update_newbb_v220($module);
    }
    if ($oldversion < 230) {
        $GLOBALS['xoopsDB']->queryFromFile(XOOPS_ROOT_PATH . "/modules/" . $module->getVar("dirname", "n") . "/sql/upgrade_230.sql");
        //$module->setErrors("bb_moderates table inserted");
    }
    if ($oldversion < 304) {
        $GLOBALS['xoopsDB']->queryFromFile(XOOPS_ROOT_PATH . "/modules/" . $module->getVar("dirname", "n") . "/sql/mysql.304.sql");
    }
    if ($oldversion < 400) {
        $GLOBALS['xoopsDB']->queryFromFile(XOOPS_ROOT_PATH . "/modules/" . $module->getVar("dirname", "n") . "/sql/mysql.400.sql");
        include dirname(__FILE__) . "/module.v400.php";
        xoops_module_update_newbb_v400($module);
    }
    if ($oldversion < 403) {
        $sql = "\tALTER TABLE " . $GLOBALS['xoopsDB']->prefix("bb_posts") . " CHANGE `poster_ip` `poster_ipd` varchar(15) NOT NULL default '0.0.0.0'";
        $GLOBALS['xoopsDB']->queryF($sql);
    }
    if (!empty($newbbConfig["syncOnUpdate"])) {
        mod_loadFunctions("recon", "newbb");
        newbb_synchronization();
    }
    return true;
}
Example #6
0
 private static function init()
 {
     defined('LOAD_COMMON') or define('LOAD_COMMON', false);
     if (LOAD_COMMON === false) {
         load_functions();
     }
     if (!build()) {
         die('build directories error');
     }
     $mood = $GLOBALS['_Module'];
     if (!is_dir(RUNTIME_CACHE . $mood)) {
         mkdirs(RUNTIME_CACHE . $mood, false, 0777);
         file_put_contents(RUNTIME_CACHE . $mood . DS . 'index.html', '');
     }
     if (CACHE_TIME_OUT >= 10 || C('template-cache') === true && C('template-is_smarty') === true) {
         if (!is_dir(RUNTIME_DATA . $mood)) {
             mkdirs(RUNTIME_DATA . $mood, false, 0777);
             file_put_contents(RUNTIME_DATA . $mood . DS . 'index.html', '');
         }
     }
     unset($mood);
     safe();
 }
// GNU General Public License for more details.                             //
// //
// You should have received a copy of the GNU General Public License        //
// along with this program; if not, write to the Free Software              //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
// ------------------------------------------------------------------------ //
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //
include 'admin_header.php';
include XOOPS_ROOT_PATH . "/class/xoopstree.php";
include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
mod_loadFunctions("forum", "newbb");
mod_loadFunctions("render", "newbb");
load_functions("cache");
xoops_cp_header();
$op = !empty($_GET['op']) ? $_GET['op'] : (!empty($_POST['op']) ? $_POST['op'] : "");
$forum_id = intval(!empty($_GET['forum']) ? $_GET['forum'] : (!empty($_POST['forum']) ? $_POST['forum'] : 0));
$forum_handler =& xoops_getmodulehandler('forum', 'newbb');
switch ($op) {
    case 'moveforum':
        loadModuleAdminMenu(2, "");
        if (!empty($_POST['dest_forum'])) {
            $dest = $_POST['dest_forum'];
            if ($dest > 0) {
                $pid = intval($dest);
                $forum_dest =& $forum_handler->get($pid);
                $cid = $forum_dest->getVar("cat_id");
                unset($forum_dest);
            } else {
Example #8
0
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright    The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license      http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package      Tad Web
 * @since        2.5.0
 * @author       Tad
 * @version      $Id $
 **/
include '../../../include/cp_header.php';
defined('FRAMEWORKS_ART_FUNCTIONS_INI') || (include_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.ini.php');
include_once XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/class/admin.php";
load_functions('admin');
if (!@(include_once XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/language/" . $xoopsConfig['language'] . "/main.php")) {
    include_once XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/language/english/main.php";
}
if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
    include_once XOOPS_ROOT_PATH . '/class/template.php';
    $xoopsTpl = new XoopsTpl();
}
if (file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/include/beforeheader.php")) {
    include_once XOOPS_ROOT_PATH . "/modules/tadtools/include/beforeheader.php";
    $xoopsOption['template_main'] = set_bootstrap();
}
xoops_cp_header();
// Define Stylesheet and JScript
$xoTheme->addStylesheet(XOOPS_URL . "/modules/" . $xoopsModule->getVar('dirname') . "/css/admin.css");
//$xoTheme->addScript("browse.php?Frameworks/jquery/jquery.js");
Example #9
0
<?php

/**
 * CBB 4.0, or newbb, the forum module for XOOPS project
 *
 * @copyright	The XOOPS Project http://xoops.sf.net
 * @license		http://www.fsf.org/copyleft/gpl.html GNU public license
 * @author		Taiwen Jiang (phppp or D.J.) <*****@*****.**>
 * @since		4.00
 * @version		$Id $
 * @package		module::newbb
 */
if (!defined('XOOPS_ROOT_PATH')) {
    exit;
}
defined("NEWBB_FUNCTIONS_INI") || (include dirname(__FILE__) . "/functions.ini.php");
define("NEWBB_FUNCTIONS_LOADED", TRUE);
if (!defined("NEWBB_FUNCTIONS")) {
    define("NEWBB_FUNCTIONS", 1);
    load_functions();
    mod_loadFunctions("image", "newbb");
    mod_loadFunctions("user", "newbb");
    mod_loadFunctions("render", "newbb");
    mod_loadFunctions("forum", "newbb");
    mod_loadFunctions("session", "newbb");
    mod_loadFunctions("stats", "newbb");
}
Example #10
0
function AspisInternalCallback($name)
{
    global $built_in_functions;
    if (empty($built_in_functions)) {
        load_functions();
    }
    if (is_string($name[0]) && isset($built_in_functions[$name[0]])) {
        return $name[0];
    }
    $name = deAspisRC($name);
    $nfunction = function () use($name) {
        $args = func_get_args();
        foreach ($args as &$arg) {
            //only on params! If the function uses
            $arg = attAspisR($arg);
            //global vars, they they should be protected! :-)
        }
        $ret = call_user_func_array($name, $args);
        $ret = deAspisRC($ret);
        return $ret;
    };
    return $nfunction;
}
Example #11
0
 function &loadPermData($perm_name = "forum_access")
 {
     load_functions("cache");
     if (!($perms = mod_loadCacheFile("permission_{$perm_name}", "xoops_newbb"))) {
         $perms = $this->createPermData($perm_name);
     }
     return $perms;
 }
Example #12
0
function AspisUntainted_usort(&$array, $cmp_function)
{
    //these cases need attaching aspides to the arguments
    if (is_string($cmp_function)) {
        global $aspis_taint_details;
        if (empty($aspis_taint_details)) {
            loadTaintDetails();
        }
        global $built_in_functions;
        if (empty($built_in_functions)) {
            load_functions();
        }
        if (!isset($built_in_functions[$cmp_function]) && isset($aspis_taint_details[0][$cmp_function])) {
            $n_cmp_function = function ($op1, $op2) use($cmp_function) {
                $ret = call_user_func($cmp_function, attAspisRCO($op1), attAspisRCO($op2));
                return $ret[0];
            };
            return usort($array, $n_cmp_function);
        }
    } else {
        $class = get_class($cmp_function[0]);
        if ($class == "AspisProxy") {
            //the enclosed obj is untainted
            $f = array($cmp_function[0]->obj, $cmp_function[1]);
            $n_cmp_function = function ($op1, $op2) use($f) {
                $ret = call_user_func($f, attAspisRCO($op1), attAspisRCO($op2));
                return $ret[0];
            };
            return usort($array, $n_cmp_function);
        }
    }
    //in al other cases, the comparison function can be called directly
    $n_cmp_function = function ($op1, $op2) use($cmp_function) {
        return call_user_func($cmp_function, $op1, $op2);
    };
    return array(usort($array, $n_cmp_function), false);
}
Example #13
0
function forum_formatTimestamp($time, $format = "c", $timeoffset = "")
{
	if(strtolower($format) == "reg" || strtolower($format) == "") {
		$format = "c";
	}
	if( (strtolower($format) == "custom" || strtolower($format) == "c") && !empty($GLOBALS["xoopsModuleConfig"]["formatTimestamp_custom"]) ) {
		$format = $GLOBALS["xoopsModuleConfig"]["formatTimestamp_custom"];
	}
	
	load_functions("locale");
	return XoopsLocal::formatTimestamp($time, $format, $timeoffset);
	
	if(class_exists("XoopsLocal") && is_callable(array("XoopsLocal", "formatTimestamp")) && defined("_TODAY")){
		return XoopsLocal::formatTimestamp($time, $format, $timeoffset);
	}
	
    global $xoopsConfig, $xoopsUser;
    if(strtolower($format) == "rss" || strtolower($format) == "r"){
    	$TIME_ZONE = "";
    	if(!empty($GLOBALS['xoopsConfig']['server_TZ'])){
			$server_TZ = abs(intval($GLOBALS['xoopsConfig']['server_TZ']*3600.0));
			$prefix = ($GLOBALS['xoopsConfig']['server_TZ']<0)?" -":" +";
			$TIME_ZONE = $prefix.date("Hi",$server_TZ);
		}
		$date = gmdate("D, d M Y H:i:s", intval($time)).$TIME_ZONE;
		return $date;
	}
	
    $usertimestamp = xoops_getUserTimestamp($time, $timeoffset);
    switch (strtolower($format)) {
    case 's':
        $datestring = _SHORTDATESTRING;
        break;
    case 'm':
        $datestring = _MEDIUMDATESTRING;
        break;
    case 'mysql':
        $datestring = "Y-m-d H:i:s";
        break;
    case 'rss':
    	$datestring = "r";
        break;
    case 'l':
        $datestring = _DATESTRING;
        break;
    case 'c':
    case 'custom':
    default:
    	forum_load_lang_file("main", "xforum");
        $current_timestamp = xoops_getUserTimestamp(time(), $timeoffset);
        if(date("Ymd", $usertimestamp) == date("Ymd", $current_timestamp)){
			$datestring = _MD_TODAY;
		}elseif(date("Ymd", $usertimestamp+24*60*60) == date("Ymd", $current_timestamp)){
			$datestring = _MD_YESTERDAY;
		}elseif(date("Y", $usertimestamp) == date("Y", $current_timestamp)){
			$datestring = _MD_MONTHDAY;
		}else{
			$datestring = _MD_YEARMONTHDAY;
		}
        break;
    }

    return date($datestring, $usertimestamp);
}
Example #14
0
                echo "/3->" . isAspisFunction($filename[0]) . "\n";
                print_r($t);
                print_r($trace);
                die;
            }
        }
        break;
    }
}
echo "============================\n";
if ($argc != 3) {
    die("Usage: php calc_taint_graph.php trace_filename www_folder_root\n");
}
echo "Using file: {$argv[$argc - 2]}\n";
$folder = $argv[$argc - 1];
$overriden_functions = load_functions();
//**************************
$file = file($argv[$argc - 2], FILE_IGNORE_NEW_LINES) or die("Failed to open file, exiting...\n");
$traces = array();
$c = 0;
$traces = array();
foreach ($file as $t) {
    $parts = explode("\t", $t);
    $parts[1] = filter(unserialize($parts[1]), $folder);
    $traces[] = $parts;
}
//Now, let's do the actual logging of what treats tainted data.
$source_functions = array();
//these 4 keep just the name of the functions
$sink_functions = array();
$global_functions = array();
 function newbb_createParentForumList()
 {
     $forum_handler =& xoops_getModuleHandler("forum", "newbb");
     $criteria = new Criteria("1", 1);
     $criteria->setSort("parent_forum");
     $criteria->setOrder("ASC");
     $forums_obj = $forum_handler->getObjects($criteria);
     require_once XOOPS_ROOT_PATH . "/modules/newbb/class/tree.php";
     $tree = new newbbObjectTree($forums_obj, "forum_id", "parent_forum");
     $forum_array = array();
     foreach (array_keys($forums_obj) as $key) {
         $parent_forum = $forums_obj[$key]->getVar("parent_forum");
         if (!$parent_forum) {
             continue;
         }
         if (isset($forum_array[$parent_forum])) {
             $forum_array[$forums_obj[$key]->getVar("forum_id")] = $forum_array[$parent_forum];
             $forum_array[$forums_obj[$key]->getVar("forum_id")][] = $parent_forum;
         } else {
             $forum_array[$forums_obj[$key]->getVar("forum_id")] = $tree->getParentForums($forums_obj[$key]->getVar("forum_id"));
         }
     }
     unset($forums_obj, $tree, $criteria);
     load_functions("cache");
     mod_createCacheFile($forum_array, "forum_parent", "newbb");
     return $forum_array;
 }
Example #16
0
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @author          Taiwen Jiang <*****@*****.**>
 * @since           1.00
 * @version         $Id$
 * @package         Frameworks
 * @subpackage      art
 */
if (defined('XOOPS_ART_FUNCTIONS')) {
    return false;
}
define('XOOPS_ART_FUNCTIONS', true);
include_once __DIR__ . "/functions.ini.php";
load_functions("cache");
load_functions("user");
load_functions("locale");
load_functions("admin");
if (!class_exists('ArtObject', false)) {
    require_once __DIR__ . "/object.php";
}
/**
 * get MySQL server version
 *
 * In some cases mysql_get_client_info is required instead
 *
 * @param null $conn
 * @return string
 */
function mod_getMysqlVersion($conn = null)
{
    static $mysql_version;
    if (isset($mysql_version)) {
Example #17
0
     * time
     * uid
     * tags
     */
    if (!($item = @$items_module[$items[$key]["modid"]][$items[$key]["catid"]][$items[$key]["itemid"]])) {
        continue;
    }
    $item["module"] = $modules_obj[$items[$key]["modid"]]->getVar("name");
    $item["dirname"] = $modules_obj[$items[$key]["modid"]]->getVar("dirname");
    $time = empty($item["time"]) ? $items[$key]["time"] : $item["time"];
    $item["time"] = formatTimestamp($time, "s");
    $item["tags"] = tagBar($item["tags"]);
    $items_data[] = $item;
    $uids[$item["uid"]] = 1;
}
load_functions("user");
$users = mod_getUnameFromIds(array_keys($uids));
foreach (array_keys($items_data) as $key) {
    $items_data[$key]["uname"] = $users[$items_data[$key]["uid"]];
}
if (!empty($start) || count($items_data) >= $limit) {
    $count_item = $tag_handler->getItemCount($tag_id, $modid, $catid);
    // Tag, modid, catid
    include XOOPS_ROOT_PATH . "/class/pagenav.php";
    $nav = new XoopsPageNav($count_item, $limit, $start, "start", "tag={$tag_id}&amp;catid={$catid}");
    $pagenav = $nav->renderNav(4);
} else {
    $pagenav = "";
}
$tag_addon = array();
if (!empty($GLOBALS["TAG_MD_ADDONS"])) {
Example #18
0
/**
 * CBB 4.0, or newbb, the forum module for XOOPS project
 *
 * @copyright	The XOOPS Project http://xoops.sf.net
 * @license		http://www.fsf.org/copyleft/gpl.html GNU public license
 * @author		Taiwen Jiang (phppp or D.J.) <*****@*****.**>
 * @since		4.00
 * @version		$Id $
 * @package		module::newbb
 */
if (!defined("XOOPS_ROOT_PATH")) {
    exit;
}
defined("NEWBB_FUNCTIONS_INI") || (include XOOPS_ROOT_PATH . '/modules/newbb/include/functions.ini.php');
load_functions("locale");
/**
 * Description
 *
 * @param type $var description
 * @return type description
 * @link
 */
class Xmlrss
{
    var $xml_version;
    var $rss_version;
    var $xml_encoding;
    var $channel_title;
    var $channel_link;
    var $channel_desc;