isit()); # $ajax->error('stopped'); $skin = new _0x20_skin_light(X_PATH.'skin/'.$conf['skin'],array('globals'=>'conf','extract'=>'args')); $db = new _0x20_mysqldbdriver ( $conf['mysql']['host'], $conf['mysql']['user'], $conf['mysql']['pass'], $conf['mysql']['db'], $conf['mysql']['charset'], $conf['mysql']['log'], $conf['mysql']['prefix'] ); if (!$db->connected()) { if (AJAX) { $ajax->error('сервер mysql не отвечает'); } $skin->req('500'); return; } get_db_conf(); $auth = new _0x20_cookie_auth ( $db, $conf['session_id'], 'users' ); define('ADMIN',(int)$auth->authed()); if (ADMIN) { define('ADMIN_LEVEL',$auth->get_level()); } $admin_hint = array(); if (ADMIN) { $admin_hint[] = 'Админпанель'; } $uri = new _0x20_uri(); $op = $uri->get_piece(); try { if ($op === false) { # empty uri if ($conf['def']) { throw new Exception(); } $op = $conf['def_op']; } if (!preg_match('/^[a-z0-9_\-]{1,20}$/',$op)) { # illegal op throw new Exception(); } if (!file_exists(X_PATH.'op/'.$op.'.php')) { $uri->undo(); $op = $conf['def_op']; } if (!file_exists(X_PATH.'op/'.$op.'-desc.php')) { throw new Exception(); } $conf['op'] = $op; } catch (Exception $e) { if (AJAX) { $ajax->error('Неверный запрос [core]'); } redirect($conf['def']); } if ($conf['disabled']) { if (ADMIN) { $admin_hint[] = explain_hint('Сайт в режиме техобслуживания','T+'); } elseif ($op!=='admin') { if (AJAX) { $ajax->error('сайт в режиме техобслуживания'); } $skin->req('disabled'); return; } } $conf['is_op_stopped'] = is_listed($conf['stoplist'],$op); $conf['title_mode'] = (int)is_listed($conf['titlemodelist'],$op); if ($conf['title_mode']==TITLE_FREE) { $conf['title'] = ''; } require(X_PATH.'op/'.$op.'-desc.php'); $ok = 1; if ($conf['is_op_stopped']&&$op_conf['can_be_disabled']) { if (ADMIN) { $admin_hint[] = explain_hint('Модуль отключен','M–'); } else { if (AJAX) { $ajax->error('модуль отключен администратором'); } $ok = 0; } } if (AJAX) { # $ok==1 if ($conf['agzip']) { if (extension_loaded('zlib')) ob_start('ob_gzhandler'); } header('Content-Type: text/plain;charset=windows-1251'); require(X_PATH.'op/'.$op.'.php'); return; } if ($op_conf['self_designed']) { if ($ok) { require(X_PATH.'op/'.$op.'.php'); } return; } ob_start(); if ($ok) { $bolx = require(X_PATH.'op/'.$op.'.php'); } else { $skin->req('module_disabled'); $bolx = false; } $_op = ob_get_contents(); ob_clean(); $skin->assign(array( 'admin_hint' => ADMIN?$admin_hint:'', 'content' => &$_op, 'apath' => $uri->path() )); if (is_array($bolx)&&sizeof($bolx)) { $skin->assign($bolx); } $skin->req('main'); # just dump now if ($conf['gzip']) { $s = ob_get_contents(); #### total page code ob_end_clean(); if (extension_loaded('zlib')) ob_start('ob_gzhandler'); } foreach ($conf['http_headers'] as $v) { header($v); } if ($conf['gzip']) { echo $s; } ?>