0) {$name_url=substr($name_url, 0, $n);} //echo '<--'.$name_url.'-->'; ///////////////////////////////////////////////////////////////// if ($name_url=='test' or $name_url=='news' or $name_url=='yeeeah' or $name_url=='gorod' or $name_url=='relax' or $name_url=='about' or $name_url=='info' or $name_url=='photo' or $name_url=='journal' or $name_url=='myblog' or $name_url=='business' or $name_url=='phorum' or $name_url=='index' or $name_url=='maps' or $name_url=='blog' or $name_url=='myphoto' or $name_url=='myphotos' or $name_url=='registration.html' or $name_url=='sberegi' or $name_url=='password.html' or $name_url=='mymessage' or $name_url=='myprofile' or $name_url=='myvote' or $name_url=='gorspravka' or $name_url == 'pm' or $name_url=='photonew' or isset($_REQUEST['dev'])) { if (isset($page_mass[0]) and $page_mass[0]=='relax' and isset($page_mass[1]) and $page_mass[1] == 'tv' and isset($page_mass[2])) { $from=$page_mass[2]; preg_match('/(.*)\-(.*)\-(.*)/', $from, $aDate); // echo $aDate[1]; if ($aDate[1] > 2018 or $aDate[1] < 2016) { die(); } } require_once $_SERVER['DOCUMENT_ROOT']."/_inc/DbSimple/Generic.php"; require_once $_SERVER['DOCUMENT_ROOT']."/_inc/DbSimple/Mysql.php"; $DB = DbSimple_Generic::connect("mysql://keminfo:sdONhx8aVO@localhost/keminfo"); // echo '123'; mysql_query ("set character_set_client='utf8'"); mysql_query ("set character_set_results='utf8'"); mysql_query ("set collation_connection='utf8_general_ci'"); include_once ($_SERVER['DOCUMENT_ROOT'].'/_inc/class.inc.php'); $object= new myclass(); //include_once ($_SERVER['DOCUMENT_ROOT'].'/_inc/karmadate.php'); //var_dump($news); require_once $_SERVER['DOCUMENT_ROOT']."/_inc/Loginza/LoginzaAPI.class.php"; require_once $_SERVER['DOCUMENT_ROOT']."/_inc/Loginza/LoginzaUserProfile.class.php"; $LoginzaAPI = new LoginzaAPI(); // require_once $_SERVER['DOCUMENT_ROOT']."/_inc/WikiPartners.class.php"; // class CustomWikiPartners extends WikiPartners // { // protected function applyTemplate($links) { // // Тут можно переопределить шаблон // if (!$links || !count($links)) // return ''; // $tpl = '
'; // return $tpl; // } // } // $request = array(); // $request['SERVER_NAME'] = @$_SERVER['SERVER_NAME']; // $request['REQUEST_URI'] = @$_SERVER['REQUEST_URI']; // $request['HTTP_USER_AGENT'] = @$_SERVER['HTTP_USER_AGENT']; // $wikiPartners = new CustomWikiPartners($request, @$_SERVER["DOCUMENT_ROOT"] . '/wiki2012links'); // $wikiPartners->setCharset('Windows-1251'); //$wikiPartners->setCharset('UTF-8'); // $wikitemplate = $wikiPartners->getIncludeBlock(); if (!empty($_POST['token'])) { $s = file_get_contents('http://ulogin.ru/token.php?token=' . $_POST['token'] . '&host=' . $_SERVER['HTTP_HOST']); $user = json_decode($s, true); //print_r($user); if (1==2){ $DB->setLogger('myLogger'); function myLogger($db, $sql) { $caller = $db->findLibraryCaller(); $tip = "at ".@$caller['file'].' line '.@$caller['line']; // Печатаем запрос (конечно, Debug_HackerConsole лучше) echo ""; print_r($sql); echo ""; } } if ($DB->selectCell("SELECT id FROM ".$object->tables['ulogin']." WHERE identity=? and network=?", $user['identity'], $user['network'])=='') { // echo '123'; $DB->query("INSERT INTO ".$object->tables['ulogin']." set identity=?, photo_big=?, network=?, date=?, status=0", $user['identity'], $user['photo_big'], $user['network'], $object->today); $UloginId = $DB->selectcell("SELECT LAST_INSERT_ID()"); $AvatarName = $object->MakePassword(8); $object->LoadAvatar($user['photo_big'], $AvatarName); $DB->query("INSERT INTO ".$object->tables['members']." set login=?, password=?, real_name=?, date_register=?, status=1, provider=?, ulogin=?, avatar=?", $user['nickname'], md5($object->MakePassword(8)), $user['last_name'].' '.$user['first_name'], $object->today, $user['network'], $UloginId, $AvatarName.'.jpg'); $UserId=$DB->selectcell("SELECT LAST_INSERT_ID()"); $DB->query("UPDATE ".$object->tables['ulogin']." set status=1, user=? WHERE id=?", $UserId, $UloginId); } if ($DB->selectCell("SELECT id FROM ".$object->tables['ulogin']." WHERE identity=? and network=? and status=1", $user['identity'], $user['network'])<>'') { $UloginId = $DB->selectcell("SELECT id FROM ".$object->tables['ulogin']." WHERE identity=? and network=? and status=1", $user['identity'], $user['network']); $User = $DB->SelectRow("SELECT * FROM ".$object->tables['members']." WHERE ulogin=?", $UloginId); //echo 'авторизация'; //print_r($User); $object->ulogined($User['login'],$User['password']); } } if (!empty($_POST['token']) and 1==2) { // получаем профиль авторизованного пользователя $UserProfile = $LoginzaAPI->getAuthInfo($_POST['token']); // проверка на ошибки if (!empty($UserProfile->error_type)) { // есть ошибки, выводим их // в рабочем примере данные ошибки не следует выводить пользователю, так как они несут информационный характер только для разработчика //echo $UserProfile->error_type.": ".$UserProfile->error_message; } elseif (empty($UserProfile)) { // прочие ошибки echo 'Ошибка'; } else { //echo $_POST['token']; // $JsonUserProfile = (array)$UserProfile; // print_r($JsonUserProfile); //echo $DB->selectCell("SELECT id FROM ".$object->tables['loginza']." WHERE identity=? and provider=?", $JsonUserProfile['identity'], $JsonUserProfile['provider']); // ошибок нет запоминаем пользователя как авторизованного //$_SESSION['loginza']['is_auth'] = 1; // запоминаем профиль пользователя в сессию или создаем локальную учетную запись пользователя в БД //$_SESSION['loginza']['profile'] = $UserProfile; //$loginzaid='10741'; //ID виджета мы получили в подготовительном этапе в интерфейсе кабинета Логинзы. //$loginzakey='735d3954b3c918e9b7510e0d8bdf1cd7'; //Ключ доступа мы получили в подготовительном этапе в интерфейсе кабинета Логинзы. //$token=$_POST['token']; //Это вернула логинза. //$sig=md5($token.$loginzakey); //Формируем сигнатуру. //$kk="http://loginza.ru/api/authinfo?token=".$token."&id=".$loginzaid."&sig=".$sig.""; //формируем url для получения ответа от Логинзы //$b=file_get_contents($kk); //Получаем данные от Логинзы $Identity=$UserProfile->identity; //Получаем PHP массив с данными авторизации $Provider=$UserProfile->provider; //$name = $children[$i]->name; //print_r($JsonUserProfile); if (1==2){ $DB->setLogger('myLogger'); function myLogger($db, $sql) { $caller = $db->findLibraryCaller(); $tip = "at ".@$caller['file'].' line '.@$caller['line']; // Печатаем запрос (конечно, Debug_HackerConsole лучше) echo ""; print_r($sql); echo ""; } } if ($DB->selectCell("SELECT id FROM ".$object->tables['loginza']." WHERE identity=? and provider=?", $Identity, $Provider)=='') { $DB->query("INSERT INTO ".$object->tables['loginza']." set identity=?, provider=?, date=?, status=0", $Identity, $Provider, $object->today); $LoginzaProfile = new LoginzaUserProfile($UserProfile); $LoginzaId = $DB->selectcell("SELECT LAST_INSERT_ID()"); $DB->query("INSERT INTO ".$object->tables['members']." set login=?, password=?, real_name=?, date_register=?, status=1, provider=?, www=?, avatar=?, loginza=?", iconv('utf-8', 'windows-1251', $LoginzaProfile->genNickName()), md5($object->MakePassword(8)), iconv('utf-8', 'windows-1251',$LoginzaProfile->genFullName()), $object->today, $Provider, $Identity, $UserProfile->photo, $LoginzaId); $UserId=$DB->selectcell("SELECT LAST_INSERT_ID()"); $DB->query("UPDATE ".$object->tables['loginza']." set status=1, user=? WHERE id=?", $UserId, $LoginzaId); } if ($DB->selectCell("SELECT id FROM ".$object->tables['loginza']." WHERE identity=? and provider=? and status=1", $Identity, $Provider)<>'') { $LoginzaId = $DB->selectcell("SELECT id FROM ".$object->tables['loginza']." WHERE identity=? and provider=? and status=1", $Identity, $Provider); $User = $DB->SelectRow("SELECT * FROM ".$object->tables['members']." WHERE loginza=?", $LoginzaId); //echo 'авторизация'; //print_r($User); $object->loginzed($User['login'],$User['password']); } } } if (isset($_POST['login'])) { // echo $_POST['pass']; if (isset($_POST['r_login'])) {$_POST['r_login']=1;} // echo '123'; if ($object->logined($_POST['login'],$_POST['pass'],$_POST['r_login'])) { // echo '123'; // echo '-'; } } //$arrayban=array('3'); //$arrayban=array('13260', '13285'); $arrayban=array(); $arrayblack=array('13260', '13285', '20353', '20457'); $arrayblackip=array('81.24.121.238', '79.165.245.49'); if (in_array($object->getRealIpAddr(), $arrayblackip)) { header("Location: http://kremlin.ru/"); } if (isset($object->users_id) and in_array($object->users_id, $arrayblack) and isset($_POST)) { session_unset(); session_destroy(); setcookie('login', "", time()-3600, '/', '.keminfo.ru'); setcookie('pass', "", time()-3600, '/', '.keminfo.ru'); unset($object->users_id); //echo '123'; //header("Location: http://ya.ru"); } $ShowAdd = true; if ($object->avtorization() and isset($object->users_id) and $object->users_id<>'') { $ShowAdd = true; } //echo $ShowAd ; // echo $object->users_id; $WebMaster = false; if (isset($object->users_id) and $object->users_id == 2) { $WebMaster = true; } if (isset($object->users_id) and in_array($object->users_id, $arrayban)) { header("Location: http://ya.ru"); } if (isset($page_mass[0]) and $page_mass[0] == 'undefined') { header("Location: http://plakat.tele2.ru/"); } // if (1==2 or (isset($page_mass[1]) and $page_mass[1] == 'posutochno1') or (isset($page_mass[1]) and $page_mass[1] == 'posutochno') and $WebMaster and 1==2) // echo $page_mass[0]; if (isset($page_mass[0]) and $page_mass[0] == 'test') { define('ROOTPATH',dirname(__FILE__)); require_once(ROOTPATH.'/lib/ConfigSimple/Config.class.php'); Config::LoadFromFile(ROOTPATH.'/config/config.php'); require_once (ROOTPATH.'/lib/Smarty/Smarty.class.php'); $smarty = new Smarty(); $smarty->caching = false; require_once (ROOTPATH.'/engine/Router.class.php'); $smarty->template_dir = Config::Get('path.template'); $smarty->compile_dir = Config::Get('path.compile'); $smarty->config_dir = Config::Get('path.config'); $smarty->cache_dir = Config::Get('path.cache'); // if (!$bAjax) // { $smarty->display('index.tpl'); // } } else { include_once ($_SERVER['DOCUMENT_ROOT'] . '/_inc/head.inc.php'); // if ($name_url == 'index') { die; } if (isset($page_mass[3]) and file_exists($_SERVER['DOCUMENT_ROOT'].'/_pages/'.$page_mass[0].'/'.$page_mass[1].'/'.$page_mass[2].'/'.$page_mass[3].'/index.php')) { include_once ($_SERVER['DOCUMENT_ROOT'].'/_pages/'.$page_mass[0].'/'.$page_mass[1].'/'.$page_mass[2].'/'.$page_mass[3].'/index.php'); } else if (isset($page_mass[2]) and file_exists($_SERVER['DOCUMENT_ROOT'].'/_pages/'.$page_mass[0].'/'.$page_mass[1].'/'.$page_mass[2].'/index.php')) { include_once ($_SERVER['DOCUMENT_ROOT'].'/_pages/'.$page_mass[0].'/'.$page_mass[1].'/'.$page_mass[2].'/index.php'); } else if (isset($page_mass[1]) and file_exists($_SERVER['DOCUMENT_ROOT'].'/_pages/'.$page_mass[0].'/'.$page_mass[1].'/index.php')) { include_once ($_SERVER['DOCUMENT_ROOT'].'/_pages/'.$page_mass[0].'/'.$page_mass[1].'/index.php'); } else if (file_exists($_SERVER['DOCUMENT_ROOT'].'/_pages/'.$page_mass[0].'/index.php')) { include_once ($_SERVER['DOCUMENT_ROOT'].'/_pages/'.$page_mass[0].'/index.php'); } else if ($name_url=='registration.html') { include_once ($_SERVER['DOCUMENT_ROOT'].'/_pages/registration.html/index.php'); } else if ($name_url=='password.html') { include_once ($_SERVER['DOCUMENT_ROOT'].'/_pages/password.html/index.php'); } else { include_once ($_SERVER['DOCUMENT_ROOT'].'/_pages/index/index.php'); } include_once ($_SERVER['DOCUMENT_ROOT'] . '/_inc/foot.inc.php'); } } ///////////////////////////////////////////////////////////////// else { include_once ($_SERVER['DOCUMENT_ROOT'].'/admin/inc/db.inc.php'); include_once ($_SERVER['DOCUMENT_ROOT'].'/inc/class.inc.php'); include_once ($_SERVER['DOCUMENT_ROOT'].'/inc/forum.class.inc.php'); $object= new class_keminfo(); mysql_query ("set character_set_client='utf8'"); mysql_query ("set character_set_results='utf8'"); mysql_query ("set collation_connection='utf8_general_ci'"); $bad_pass=false; if (isset($_POST['submit_login'])) { if (!isset($_POST['remember_log'])) {$_POST['remember_log']=0;} if ($object->logined($_POST['login_in'],$_POST['password_in'],$_POST['remember_log'])) { $bad_pass=false; //header("Location: /"); } else { $bad_pass=true; } } if (isset($object->users_id) and $object->users_id=='0') { header("Location: http://ya.ru"); } if (isset($_POST['vopros']) and !isset($keminfo_vote)) { setcookie('keminfo_vote', $_POST['vopros'], mktime(0,0,0,1,1,date("Y")+5)); } if ($name_url=='exit') { $object->logout(); unset($_SESSION['loginza']); if (isset($_SERVER['HTTP_REFERER'])) { header("Location: /"); } else { header("Location: /"); } } if (isset($page_mass[0]) and $page_mass[0]=='news' and isset($page_mass[1]) and isset($_GET['id']) and preg_match("/^[0-9\-]{1,10}$/i",$_GET['id'])) { $page_mass[1]=$_GET['id']; } if (isset($page_mass[0]) and $page_mass[0]=='gorod' and isset($page_mass[1]) and isset($_GET['id']) and preg_match("/^[0-9\-]{1,10}$/i",$_GET['id'])) { $page_mass[1]=$_GET['id']; } if (isset($page_mass[0]) and $page_mass[0]=='relax' and isset($page_mass[1]) and isset($_GET['id']) and preg_match("/^[0-9\-]{1,10}$/i",$_GET['id'])) { $page_mass[1]='films'; $page_mass[2]=$_GET['id']; } if (isset($page_mass[0]) and $page_mass[0]=='relax' and isset($page_mass[1]) and isset($_GET['date']) and preg_match("/^[0-9\-]{1,10}$/i",$_GET['date'])) { $page_mass[1]='cinema'; $page_mass[2]=$_GET['date']; } if (isset($page_mass[0]) and $page_mass[0]=='photo' and isset($page_mass[1]) and isset($_GET['id']) and preg_match("/^[0-9\-]{1,10}$/i",$_GET['id']) and isset($_GET['cmd']) and $_GET['cmd']=='photo') { $page_mass[1]='view'; $page_mass[2]=$_GET['id']; } if (isset($page_mass[0]) and $page_mass[0]=='photo' and isset($page_mass[1]) and isset($_GET['album']) and preg_match("/^[0-9\-]{1,10}$/i",$_GET['album']) and isset($_GET['sl']) and $_GET['sl']=='album') { $page_mass[1]='album'; $page_mass[2]=$_GET['album']; } if (isset($page_mass[0]) and $page_mass[0]=='info' and isset($page_mass[1]) and $page_mass[1]=='wether.php') { $page_mass[1]='wether'; } if ($page_mass[0]<>'phorum') { if ($page_mass[0]<>'rss'){ if ($object->users_id=='2' and 1==2) { include_once ($_SERVER['DOCUMENT_ROOT'] . '/inc/head4.inc.php'); } else { include_once ($_SERVER['DOCUMENT_ROOT'] . '/inc/head5.inc.php'); } } else { } } if (isset($page_mass[3]) and file_exists($_SERVER['DOCUMENT_ROOT'].'/razdel/'.$page_mass[0].'/'.$page_mass[1].'/'.$page_mass[2].'/'.$page_mass[3].'/index.php')){ include_once ($_SERVER['DOCUMENT_ROOT'].'/razdel/'.$page_mass[0].'/'.$page_mass[1].'/'.$page_mass[2].'/'.$page_mass[3].'/index.php'); } else if (isset($page_mass[2]) and file_exists($_SERVER['DOCUMENT_ROOT'].'/razdel/'.$page_mass[0].'/'.$page_mass[1].'/'.$page_mass[2].'/index.php')){ include_once ($_SERVER['DOCUMENT_ROOT'].'/razdel/'.$page_mass[0].'/'.$page_mass[1].'/'.$page_mass[2].'/index.php'); } else if (isset($page_mass[1]) and file_exists($_SERVER['DOCUMENT_ROOT'].'/razdel/'.$page_mass[0].'/'.$page_mass[1].'/index.php')){ include_once ($_SERVER['DOCUMENT_ROOT'].'/razdel/'.$page_mass[0].'/'.$page_mass[1].'/index.php'); } else if (file_exists($_SERVER['DOCUMENT_ROOT'].'/razdel/'.$page_mass[0].'/index.php')){ include_once ($_SERVER['DOCUMENT_ROOT'].'/razdel/'.$page_mass[0].'/index.php'); } else { include_once ($_SERVER['DOCUMENT_ROOT'].'/razdel/index/index.php'); } if ($page_mass[0]<>'rss'){ include_once ($_SERVER['DOCUMENT_ROOT'] . '/inc/foot4.inc.php'); $dtime=$gtime-microtime(); echo ''; } else { } } ?>