芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/cloud.pulsehost.co.uk/modules/Ios/Module.php
oModuleSettings; } /***** private functions *****/ /** * Initializes IOS Module. * * @ignore */ public function init() { $this->AddEntries( array( 'ios' => 'EntryIos', 'ios-error' => 'EntryIosError', 'profile' => 'EntryProfile' ) ); } /***** private functions *****/ /***** public functions *****/ /** * * @return array */ public function GetSettings() { \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::Anonymous); return array( 'AllowIosProfile' => $this->oModuleSettings->AllowIosProfile, 'SyncIosAfterLogin' => $this->oModuleSettings->SyncIosAfterLogin ); } /** * @ignore * @return string */ public function EntryIos() { $sResult = \file_get_contents($this->GetPath() . '/templates/Ios.html'); $oApiIntegrator = \Aurora\System\Managers\Integrator::getInstance(); $iUserId = \Aurora\System\Api::getAuthenticatedUserId(); if (0 < $iUserId) { $sResult = strtr($sResult, array( '{{IOS/HELLO}}' => $this->i18N('HELLO'), '{{IOS/DESC_P1}}' => $this->i18N('DESC_P1'), '{{IOS/DESC_P2}}' => $this->i18N('DESC_P2'), '{{IOS/DESC_P3}}' => $this->i18N('DESC_P3'), '{{IOS/DESC_P4}}' => $this->i18N('DESC_P4'), '{{IOS/DESC_P5}}' => $this->i18N('DESC_P5'), '{{IOS/DESC_P6}}' => $this->i18N('DESC_P6'), '{{IOS/DESC_P7}}' => $this->i18N('DESC_P7'), '{{IOS/DESC_BUTTON_YES}}' => $this->i18N('DESC_BUTTON_YES'), '{{IOS/DESC_BUTTON_SKIP}}' => $this->i18N('DESC_BUTTON_SKIP'), '{{IOS/DESC_BUTTON_OPEN}}' => $this->i18N('DESC_BUTTON_OPEN'), '{{AppVersion}}' => Application::GetVersion(), '{{IntegratorLinks}}' => $oApiIntegrator->buildHeadersLink() )); \Aurora\Modules\CoreWebclient\Module::Decorator()->SetHtmlOutputHeaders(); } else { \Aurora\System\Api::Location('./'); } return $sResult; } /** * @ignore * @return string */ public function EntryIosError() { $sResult = \file_get_contents($this->GetPath() . '/templates/Ios-error.html'); $oApiIntegrator = \Aurora\System\Managers\Integrator::getInstance(); $iUserId = \Aurora\System\Api::getAuthenticatedUserId(); if (0 < $iUserId) { $sResult = strtr($sResult, array( '{{IOS/ERROR_TITLE}}' => $this->i18N('ERROR_TITLE'), '{{IOS/ERROR_DESC}}' => $this->i18N('ERROR_DESC'), '{{IOS/DESC_BUTTON_OPEN}}' => $this->i18N('DESC_BUTTON_OPEN'), '{{AppVersion}}' => Application::GetVersion(), '{{IntegratorLinks}}' => $oApiIntegrator->buildHeadersLink() )); \Aurora\Modules\CoreWebclient\Module::Decorator()->SetHtmlOutputHeaders(); } else { \Aurora\System\Api::Location('./'); } return $sResult; } /** * @ignore */ public function EntryProfile() { $oIosManager = new Manager($this); $oUser = \Aurora\System\Api::getAuthenticatedUser(); $mResultProfile = false; if (!$oUser) { \Aurora\System\Api::Log('Ios profile error: user is not authorized!'); } else { $mResultProfile = $oIosManager->generateXMLProfile($oUser); } if (!$mResultProfile) { \Aurora\System\Api::Location('./?ios-error'); } else { \header('Content-type: application/x-apple-aspen-config; chatset=utf-8'); \header('Content-Disposition: attachment; filename="afterlogic.mobileconfig"'); echo $mResultProfile; } } /***** public functions *****/ }