function check_login() { global $admindir, $PHORUM, $q, $DB; $success = false; $user =& XMEC::getUser(); if ($user->isLoggedIn()) { $PHORUM["admin_user"] = xmec_user_to_phorum_user($user); if (is_array($PHORUM["admin_user"]["forums"])) { $success = true; } } if (!$success && $user->isAdmin()) { $success = true; } if (!$success && $user->isLoggedIn()) { echo '<br><br>You need admin previliges..<br>'; } else { if (!$success) { echo '<br><br>You need to login first.<br>'; } } if (!$success) { include "{$admindir}/footer.php"; exit; } }
include "./" . $default_lang; include $include_path . "/blankset.php"; } if (!$PHORUM["started"] && !defined("PHORUM_ADMIN")) { Header("Location: {$forum_url}/{$down_page}.{$ext}"); exit; } if (!defined("PHORUM_ADMIN") && $DB->connect_id) { // check security if ($ForumFolder == 1) { $SQL = "Select max(security) as sec from {$pho_main}"; $q->query($DB, $SQL); $max_sec = $q->field("sec", 0); } if (($ForumSecurity != SEC_NONE || ($ForumFolder == 1 || $f == 0) && $max_sec > 0) && $xmec_user->isLoggedIn()) { $phorum_user = xmec_user_to_phorum_user($xmec_user); } // if(!isset($phorum_user["id"]) && isset($phorum_auth)) unset($phorum_auth); if ($ForumSecurity == SEC_ALL && !$xmec_user->isLoggedIn()) { header("Location: {$forum_url}/login.{$ext}?target=" . urlencode($REQUEST_URI)); exit; } // load plugins unset($plugins); $plugins = array("read_body" => array(), "read_header" => array()); if (isset($PHORUM["plugins"])) { $dir = opendir("./plugin/"); while ($plugindirname = readdir($dir)) { if ($plugindirname[0] != "." && @file_exists("./plugin/{$plugindirname}/plugin.php") && !empty($PHORUM["plugins"][$plugindirname])) { include "./plugin/{$plugindirname}/plugin.php"; }