Beispiel #1
0
 public function process_actions()
 {
     $redirect = null;
     foreach ($this->actions as $type => $actions) {
         if ($type == 'redirect') {
             $redirect = array_pop($actions);
         }
     }
     if ($redirect !== null) {
         $redirect = 'http://' . def::site('domain') . (empty($redirect) ? $_SERVER["REQUEST_URI"] : $redirect);
         engine::redirect($redirect);
     }
 }
Beispiel #2
0
		'news/' :
		$url[3].'/'. ($url[4] == 'all' ? '' : $url[4].'/'.$url[5])
	);
	engine::redirect($redirect);
}

if (isset(query::$post['do'])) {
	query::$post['do'] = explode('.', query::$post['do']);
	if (count(query::$post['do']) == 2) {
		$input_class = 'input__'.query::$post['do'][0];
		$input = new $input_class;
		$input_function = query::$post['do'][1];
		$input->$input_function(query::$post);
	}
	$redirect = 'http://'.def::site('domain').(empty($input->redirect) ? $_SERVER["REQUEST_URI"] : $input->redirect);
	engine::redirect($redirect);
} elseif (isset(query::$post['action']) &&
	in_array(query::$post['action'], array('Create', 'Update', 'Delete'))) {

	$class = query::$post['action'] . '_' . ucfirst($url[1]);

	if (class_exists($class)) {

		$worker = new $class();

		$function = empty(query::$post['function']) ?
			'main' : query::$post['function'];

		if ($worker->check_access($function)) {

			$worker->$function();
Beispiel #3
0
    }
    return str_replace(array("\t", "  ", "\n", "\r", "<!--br-->"), array("", " ", "", "", "\n"), $buffer);
}
include_once ROOT_DIR . SL . 'engine' . SL . 'backwards_compatibility.php';
mb_internal_encoding('UTF-8');
if (strpos($_SERVER["REQUEST_URI"], 'art/download') === false && !strpos($_SERVER["REQUEST_URI"], '/rss/') && _TYPE_ != 'cron' && _TYPE_ != 'api' && !(_TYPE_ == 'ajax' && $_GET['f'] == 'download')) {
    ob_start('myoutput');
}
include_once ROOT_DIR . SL . 'engine' . SL . 'config.php';
def::import($def);
if (!def::site('domain')) {
    def::set('site', 'domain', $_SERVER['SERVER_NAME']);
}
define('SITE_DIR', str_replace(array('/', '\\'), SL, rtrim(def::site('dir'), '/')));
if (def::site('domain') != $_SERVER['SERVER_NAME'] && _TYPE_ != 'cron' && !empty($_SERVER['REMOTE_ADDR']) && $_SERVER['SERVER_NAME'] != 'upload.4otaku.org') {
    engine::redirect('http://' . $def['site']['domain'] . $_SERVER["REQUEST_URI"], true);
}
if (_TYPE_ != 'cron' && _TYPE_ != 'api') {
    $check = new check_values();
    include_once ROOT_DIR . SL . 'engine' . SL . 'twig_init.php';
}
if (_TYPE_ != 'cron') {
    list($get, $post) = query::get_globals($_GET, $_POST);
}
include_once ROOT_DIR . SL . 'engine' . SL . 'metafunctions.php';
// Тут мы работаем с сессиями
if (_TYPE_ != 'cron' && _TYPE_ != 'api') {
    // Логично, что у крона или апи сессии нет.
    // Удалим все левые куки, нечего захламлять пространство
    foreach ($_COOKIE as $key => $cook) {
        if ($key != 'settings') {
Beispiel #4
0
	$link = '/'.implode('/', $url);
} elseif (
	$url[1] == 'news' &&
	($id = array_search($url[2], $news))
) {
	$url[2] = $id;
	$link = '/'.implode('/', $url);
}

if (isset($link)) {

	if ($url[1] == 'mixed') {
		$link = str_replace(';', '&', $link);
	}

	engine::redirect(SITE_DIR.$link, true, false);
	$domain = $def['site']['domain'] ? $def['site']['domain'] : $_SERVER['SERVER_NAME'];

	?>
		<html>
			<head>
				<meta name="robots" content="noindex" />
				<meta http-equiv="REFRESH" content="0;url=<?php 
echo SITE_DIR . $link;
?>
">
			</head>
			<body>
				Выполняется перенаправление на адрес
				<a href="<?php 
echo SITE_DIR . $link;