Exemplo n.º 1
0
            }
            $settings = NowhereCore::FetchSettings();
            include GlobalCore::template('settings');
        } else {
            GlobalCore::nwHeader('Location: ' . NWDIR);
        }
        break;
    case 'output':
        if ($nw_uid) {
            include GlobalCore::template('output');
        } else {
            GlobalCore::nwHeader('Location: ' . NWDIR);
        }
        break;
    case 'js':
        $status = NowhereCore::FetchUserStatus(1, 16, 16, 1);
        $url = GlobalCore::SubURL($_SERVER['REQUEST_URI']);
        $limit = isset($url['limit']) ? intval(trim($url['limit'])) : 1;
        GlobalCore::nwHeader('Content-type: text/javascript; charset=utf-8');
        include GlobalCore::template('js');
        break;
    case 'feed':
        $status = NowhereCore::FetchUserStatus(1, 16, 16, 1);
        GlobalCore::nwHeader("Content-type: application/xml");
        echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
        include GlobalCore::template('feed');
        break;
    case 'login':
        include GlobalCore::template('login');
        break;
}
Exemplo n.º 2
0
 public static function showmessage($message, $url_forward = '', $extra = '', $others = '0')
 {
     extract($GLOBALS, EXTR_SKIP);
     global $extrahead, $chobits_action, $debuginfo, $fid, $tid, $charset, $show_message, $_NCACHE;
     define('CACHE_FORBIDDEN', TRUE);
     $disable_robot = 1;
     $show_message = $message;
     $msgforward = unserialize($_CHOBITS['settings']['msgforward']);
     $msgforward['refreshtime'] = intval($msgforward['refreshtime']);
     $url_forward = empty($url_forward) ? '' : (empty($_DCOOKIE['sid']) && $transsidstatus ? transsid($url_forward) : $url_forward);
     if ($url_forward && empty($_GET['inajax']) && $msgforward['quick'] && $msgforward['messages'] && @in_array($message, $msgforward['messages'])) {
         GlobalCore::updatesession();
         GlobalCore::nwHeader("location: " . str_replace('&amp;', '&', $url_forward));
     }
     if (in_array($extra, array('HALTED', 'NOPERM'))) {
         $fid = $tid = 0;
         $chobits_action = 254;
     } else {
         $chobits_action = 255;
     }
     include GlobalCore::language('messages');
     if (isset($language[$message])) {
         eval("\$show_message = \"" . $language[$message] . "\";");
     }
     $extrahead .= $url_forward ? '<meta http-equiv="refresh" content="' . $msgforward['refreshtime'] . ' url=' . $url_forward . '">' : '';
     if ($extra == 'NOPERM') {
         include GlobalCore::template('nopermission');
     } elseif ($extra == 'DONE') {
         include GlobalCore::template('showmessage_done');
     } else {
         if ($others == 0) {
             $this_page = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
             include GlobalCore::template('showmessage');
         } else {
             include GlobalCore::template('showmessage_other');
         }
     }
     GlobalCore::chobits_exit();
 }
Exemplo n.º 3
0
$PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$SCRIPT_FILENAME = str_replace('\\\\', '/', isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] : $_SERVER['SCRIPT_FILENAME']);
if (getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')) {
    $onlineip = getenv('HTTP_CLIENT_IP');
} elseif (getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) {
    $onlineip = getenv('HTTP_X_FORWARDED_FOR');
} elseif (getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) {
    $onlineip = getenv('REMOTE_ADDR');
} elseif (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {
    $onlineip = $_SERVER['REMOTE_ADDR'];
}
preg_match("/[\\d\\.]{7,15}/", $onlineip, $onlineipmatches);
$onlineip = $onlineipmatches[0] ? $onlineipmatches[0] : 'unknown';
unset($onlineipmatches);
require_once NOWHERE_ROOT . './inc/Settings.inc.php';
@extract($_CHOBITS['settings']);
@(include NOWHERE_ROOT . './data/cache/nowhere_settings.php');
@extract($nowhere_settings);
//&& AJAX_CORE != 1
if ($gzipcompress && function_exists('ob_gzhandler')) {
    ob_start('ob_gzhandler');
} else {
    $gzipcompress = 0;
    ob_start();
}
$db = new dbstuff();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset);
if (SYSTEM_UPDATE == 1 && !in_array($adminid, array(1, 2, 3))) {
    include GlobalCore::template('system_update');
    exit;
}