SetCookieLive("LANG", $_SESSION['lang']); header('HTTP/1.1 301 Moved Permanently'); $_SERVER['REQUEST_URI']=str_replace('&lang='.$ar_get_clean['lang'],'',$_SERVER['REQUEST_URI']); $_SERVER['REQUEST_URI']=str_replace('?lang='.$ar_get_clean['lang'],'',$_SERVER['REQUEST_URI']); header("Location: ".$_SERVER['REQUEST_URI']); exit; } $_SESSION['site_id']=0; if(!isset($_COOKIE['LANG'])) { $Accaunt->SetCookieLive("LANG", $GLOBALS['ar_define_settings']['MAIN_LANG']); $_COOKIE['LANG']=$GLOBALS['ar_define_settings']['MAIN_LANG']; } if(!isset($_SESSION['lang'])) { $_SESSION['lang']=$GLOBALS['ar_define_settings']['MAIN_LANG']; } else { if(!empty($_COOKIE['LANG']))$_SESSION['lang']=$_COOKIE['LANG']; } $Accaunt->CheckTokenIfNotAuth(); $GLOBALS['ar_define_langterms'] = $Main->GetDefineLangTerms(); //защита от иньекций $CCpu->inject(); $pageData = $CCpu->GetCPU(); if(!$pageData) { $_SERVER['REQUEST_URI']='/404/'; $pageData = $CCpu->GetCPU(); } elseif($pageData==301) { header('HTTP/1.1 301 Moved Permanently'); header("Location: ".$_SERVER['REQUEST_URI']."/"); exit; } $Main->lang = $CCpu->lang=$_SESSION['lang']; $page_data = $CCpu->GetPageData($pageData); //Если раздел авторизационный, то проверяем авторизован ли юзер if($page_data['auth_page']==1)$Accaunt->CheckAuth(); //Имя сессии устанавливаем в имя юзера if(!isset($_SESSION['userlog']))$_SESSION['userlog']=$Accaunt->GenerateUserId(); //Устанавливаем IP юзера if(!isset($_SESSION['user_ip']))$_SESSION['user_ip']=GetRealIp(); if(!isset($_COOKIE['REMEMBER']))$Accaunt->SetCookieLive("REMEMBER",false); if(!isset($_COOKIE['ID']))$Accaunt->SetCookieLive("ID",0); if(!isset($_COOKIE['TOKEN']))$Accaunt->SetCookieLive("TOKEN",''); if(isset($_GET['logout'])) { $Accaunt=new CAccaunt(); $Accaunt->Logout($boolRememberPassword); header('Location: /'); exit; } $Main->lang = $CCpu->lang= $_SESSION['lang']; $_SESSION['last_lang'] = $Main->lang; $GLOBALS['ar_define_langterms'] = $Main->GetDefineLangTerms(); $_SESSION['FILE_MANAGE_HOME_DIR']=$GLOBALS['ar_define_langterms']['MSG_ACCAUNT_FILE_MANAGER_HOME_DIRECTORY']; header('Content-Type: text/html; charset=utf-8'); $indexPage = $CCpu->getURLs(1); if(isset($ar_post_clean['task'])) { /*Авторизация*/ if($ar_post_clean['task']=='Auth') { if(!isset($ar_post_clean['auth_email'],$ar_post_clean['auth_password']) or empty($ar_post_clean['auth_email']) or empty($ar_post_clean['auth_password']))exit; $objRes=$Accaunt->Auth(trim($ar_post_clean['auth_email']),$ar_post_clean['auth_password'],$ar_post_clean['remember']); if($objRes===false) { exit; } elseif($objRes===true) { echo $CCpu->getURLs(59)[$CCpu->lang]; } else { echo $objRes; } exit; } //Восстановление пароля - высылаем ссылку на активацию нового пароля if($ar_post_clean['task']=='SendRecoveryUrl' and !empty($ar_post_clean['recovery_email']) and !empty($ar_post_clean['secret_code'])) { if($ar_post_clean['secret_code']==$_SESSION['captcha']['code']) { if($Accaunt->SendForgotPassword(trim($ar_post_clean['recovery_email']))) { echo 1; } } exit; } else{ } } //Восстановление пароля - высылаем письмо с новым паролем после ег оактивации if(!empty($ar_get_clean['token']) && isset($ar_get_clean['recovery'])) { if($Accaunt->ActivateNewPassword($ar_get_clean['token'])) { $location=$CCpu->getURLs(74)[$CCpu->lang].'?success'; } else { $location=$CCpu->getURLs(74)[$CCpu->lang].'?error'; } header('Location: '.$location); exit; } $Banner=new CBanner(); $UserForm=new CUserForm($_SESSION['auth_id']); $URLs = $CCpu->getURLs($pageData['page_id'], $pageData['elem_id']); if(isMobileControl()){ if( file_exists($_SERVER['DOCUMENT_ROOT']."/mobile/pages".$pageData['page']) ){ include($_SERVER['DOCUMENT_ROOT']."/mobile/pages".$pageData['page']); exit(); }else{ include($_SERVER['DOCUMENT_ROOT']."/pages".$pageData['page']); exit(); } } else{ include($_SERVER['DOCUMENT_ROOT']."/pages".$pageData['page']); exit(); } //$strPageContent= ob_get_contents(); //ob_end_clean(); //echo HtmlCompress($strPageContent); ?>