<?php /** * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/ * CC-BY License - http://creativecommons.org/licenses/by/3.0/ * * @defgroup TridentEndAdmin Trident Studio End Admin Pages * @ingroup TridentStudio * @{ */ require_once './../inc/header.inc.php'; require_once BX_DIRECTORY_PATH_INC . 'design.inc.php'; bx_import('BxDolLanguages'); bx_require_authentication(true); $sPage = bx_get('page'); $sPage = $sPage !== false ? bx_process_input($sPage) : ''; $oPage = new BxTemplStudioPolyglot($sPage); $oPage->init(); $oTemplate = BxDolStudioTemplate::getInstance(); $oTemplate->setPageNameIndex($oPage->getPageIndex()); $oTemplate->setPageHeader($oPage->getPageHeader()); $oTemplate->setPageContent('page_caption_code', $oPage->getPageCaption()); $oTemplate->setPageContent('page_attributes', $oPage->getPageAttributes()); $oTemplate->setPageContent('page_menu_code', $oPage->getPageMenu()); $oTemplate->setPageContent('page_main_code', $oPage->getPageJsCode() . $oPage->getPageCode()); $oTemplate->addCss($oPage->getPageCss()); $oTemplate->addJs($oPage->getPageJs()); $oTemplate->getPageCode(); /** @} */
$oForm = BxDolForm::getObjectInstance('sys_login', 'sys_login'); bx_alert('account', 'before_login', 0, 0, array('form' => $oForm)); $oForm->initChecker(); $oForm->setRole(bx_get('role')); $bLoginSuccess = $oForm->isSubmittedAndValid(); $bAjxMode = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' ? true : false; if ($bAjxMode) { header('Content-type: text/html; charset=utf-8'); echo $bLoginSuccess ? 'OK' : $oForm->getLoginError(); exit; } elseif ($bLoginSuccess) { bx_import('BxDolAccount'); $oAccount = BxDolAccount::getInstance($oForm->getCleanValue('ID')); $aAccount = bx_login($oAccount->id(), $oForm->getCleanValue('rememberMe') ? true : false); $sUrlRelocate = $oForm->getCleanValue('relocate'); if (!$sUrlRelocate || 0 != strncmp($sUrlRelocate, BX_DOL_URL_ROOT, strlen(BX_DOL_URL_ROOT))) { $sUrlRelocate = BX_DOL_ROLE_ADMIN == $oForm->getRole() ? BX_DOL_URL_STUDIO . 'launcher.php' : BX_DOL_URL_ROOT . 'member.php'; } bx_import('BxDolTemplate'); BxDolTemplate::getInstance()->setPageNameIndex(BX_PAGE_TRANSITION); BxDolTemplate::getInstance()->setPageHeader(_t('_Please Wait')); BxDolTemplate::getInstance()->setPageContent('page_main_code', MsgBox(_t('_Please Wait'))); BxDolTemplate::getInstance()->setPageContent('url_relocate', bx_html_attribute($sUrlRelocate, BX_ESCAPE_STR_QUOTE)); BxDolTemplate::getInstance()->getPageCode(); exit; } } bx_require_authentication(); bx_import('BxDolPermalinks'); header('Location: ' . BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=account-profile-switcher')); /** @} */