예제 #1
0
파일: home.php 프로젝트: rratcliffe/fsen
 public function on_start()
 {
     Loader::model('fsen_localization');
     $locale = FSENLocalization::getSessionDefaultLocale();
     if (strncasecmp($locale, 'zh_', 3) == 0) {
         header('Location: /zh');
     } else {
         header('Location: /en');
     }
 }
예제 #2
0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
defined('C5_EXECUTE') or die('Access Denied.');
Loader::model('fsen_localization');
FSENLocalization::setupInterfaceLocalization4AjaxRequest();
require_once 'helpers/check_login.php';
require_once 'helpers/fsen/DocSectionManager.php';
require_once 'helpers/fsen/ProjectInfo.php';
$domain_handle = $_REQUEST['domainHandle'];
$section_id = $_REQUEST['sectionID'];
$current_ver_code = $_REQUEST['currentVerCode'];
if (!fse_try_to_login()) {
    $error_info = t('You are not signed in.');
} else {
    if (preg_match("/^[a-f0-9]{32}\$/", $section_id) && in_array($domain_handle, ProjectInfo::$mDomainList)) {
        $db = Loader::db();
        $section_info = DocSectionManager::getSectionInfo($domain_handle, $section_id);
        if (count($section_info) == 0) {
            $error_info = t('No such section ID!');
        } else {