public function __construct($aRequestPath) { parent::__construct($aRequestPath); $sBase = Manager::usePath(); $iId = Manager::usePath(); // Base path "newsletter" > display newsletter if ($sBase === 'newsletter') { $iId = is_numeric($sBase) ? $sBase : $iId; $this->oNewsletter = NewsletterQuery::create()->findPk($iId); if ($this->oNewsletter === null) { throw new Exception('No such newsletter exists'); } } else { if ($sBase === 'mailing') { $this->oMailing = NewsletterMailingQuery::create()->findPk($iId); if ($this->oMailing === null) { throw new Exception('No such mailing exists'); } $this->oNewsletter = $this->oMailing->getNewsletter(); } elseif (is_numeric($sBase)) { $this->oNewsletter = NewsletterQuery::create()->findPk($sBase); } } // Throw exception if no newsletter is found if ($this->oNewsletter === null) { throw new Exception('Error in DisplayNewsletterFileModule::__construct(): No such newsletter exists'); } // Optional handling of authentication FilterModule::getFilters()->handleNewsletterDisplayRequested($this->oNewsletter); }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); if (!isset($this->aPath[1])) { throw new Exception("Error in FormFileModule->__construct: no object ID or no language ID given"); } $this->sLanguageId = $this->aPath[0]; $this->iObjectId = $this->aPath[1]; $oFormDataLanguageObject = LanguageObjectQuery::create()->findPk(array($this->iObjectId, $this->sLanguageId)); if ($oFormDataLanguageObject == null || $oFormDataLanguageObject->getContentObject()->getObjectType() !== 'form') { throw new Exception("Error in FormFileModule->__construct: object ID does not correspond to form object in given language"); } $this->oFormStorage = unserialize(stream_get_contents($oFormDataLanguageObject->getData())); $this->sPageName = $oFormDataLanguageObject->getContentObject()->getPage()->getName(); if ($this->oFormStorage->getFormType() !== 'email') { throw new Exception("Error in FormFileModule->renderFile(): form type {$this->oFormStorage->getFormType()} is not supported"); } $this->sEmailAddress = $this->oFormStorage->getFormOption('email_address'); $sTemplateName = $this->oFormStorage->getFormOption('template_addition'); if ($sTemplateName) { $sTemplateName = 'e_mail_form_output_' . $sTemplateName; } else { $sTemplateName = 'e_mail_form_output'; } $this->oEmailTemplate = $this->constructTemplate($sTemplateName); $this->oEmailItemTemplate = $this->constructTemplate('e_mail_form_item'); }
public function __construct($aRequestPath) { if (!Session::user() || !Session::user()->getIsAdmin()) { die(TranslationPeer::getString('wns.page.not_found')); } parent::__construct($aRequestPath); }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); if (ErrorHandler::getEnvironment() === 'production') { exit; } }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); $this->aLibraryName = Manager::usePath(); $this->aVersion = Manager::usePath(); $sExtension = Manager::usePath(); $this->bUseCompression = $sExtension === 'min.js'; }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); // if(!Session::getSession()->isAuthenticated() || !Session::getSession()->getUser()->getIsBackendLoginEnabled()) { // throw new Exception("Not allowed"); // } array_unshift($aRequestPath, DIRNAME_WEB, ResourceIncluder::RESOURCE_TYPE_CSS); $this->oFile = ResourceFinder::findResourceObject($aRequestPath); }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); $this->sResourceType = Manager::usePath(); if (!in_array($this->sResourceType, self::$RESOURCE_TYPES)) { throw new Exception("Error in " . __METHOD__ . ": Resource type {$this->sResourceType} not allowed"); } $this->sModuleName = Manager::usePath(); $this->sModuleType = $this->getModuleType(); }
public function __construct($aRequestPath) { global $xmlrpcInt, $xmlrpcString, $xmlrpcStruct, $xmlrpc_internalencoding; parent::__construct($aRequestPath); require_once 'xmlrpc/xmlrpc.php'; require_once 'xmlrpc/xmlrpcs.php'; $this->oServer = new xmlrpc_server(array('metaWeblog.newPost' => array('function' => 'JournalApiFileModule::newPost'), 'metaWeblog.editPost' => array('function' => 'JournalApiFileModule::editPost'), 'metaWeblog.getPost' => array('function' => 'JournalApiFileModule::getPost'), 'metaWeblog.getRecentPosts' => array('function' => 'JournalApiFileModule::getRecentPosts'), 'metaWeblog.getUserInfo' => array('function' => 'JournalApiFileModule::getUserInfo'), 'metaWeblog.getCategories' => array('function' => 'JournalApiFileModule::getCategories'), 'blogger.getUserInfo' => array('function' => 'JournalApiFileModule::getUserInfo'), 'blogger.getUsersBlogs' => array('function' => 'JournalApiFileModule::getUsersBlogs'), 'blogger.deletePost' => array('function' => 'JournalApiFileModule::deletePost')), false); $this->oServer->functions_parameters_type = 'phpvals'; $this->oServer->response_charset_encoding = 'UTF-8'; $xmlrpc_internalencoding = 'UTF-8'; $this->oServer->compress_response = false; }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); $this->sLicense = Manager::usePath(); if (!isset(DocumentPeer::$LICENSES[$this->sLicense])) { throw new Exception("License invalid: " . $this->sLicense); } $aLicenseInfo = DocumentPeer::$LICENSES[$this->sLicense]; if (!isset($aLicenseInfo['image'])) { throw new Exception("No Image for license: " . $this->sLicense); } $this->sURL = $aLicenseInfo['image']; }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); if (!isset($this->aPath[0])) { throw new Exception("Error in DocumentTypePreviewFileModule->__construct: no type given"); } $this->oDocumentType = DocumentTypeQuery::create()->findPk($this->aPath[0]); if ($this->oDocumentType === null) { throw new Exception("Error in DocumentTypePreviewFileModule->__construct: type invalid: {$this->aPath[0]}"); } $this->iSize = 512; if (isset($_REQUEST['size'])) { $this->iSize = min($this->iSize, (int) $_REQUEST['size']); } }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); $sSessionKey = Manager::usePath(); $this->oListWidget = Session::getSession()->getArrayAttributeValueForKey(WidgetModule::WIDGET_SESSION_KEY, $sSessionKey); if ($this->oListWidget === null) { throw new Exception('Invalid list widget session key: ' . $sSessionKey); } $this->sWidgetType = $this->oListWidget->getModuleName(); if ($this->oListWidget->getDelegate() instanceof WidgetModule) { $this->sWidgetType = $this->oListWidget->getDelegate()->getModuleName(); } else { if ($this->oListWidget->getDelegate() instanceof CriteriaListWidgetDelegate) { $this->sWidgetType = $this->oListWidget->getDelegate()->getModelName(); } } }
public function __construct($aRequestPath, $sLanguageId = null, $bSkipSecret = false) { parent::__construct($aRequestPath); if ($sLanguageId === null) { $this->sLanguageId = Manager::usePath(); if ($this->sLanguageId === null) { throw new Exception('No language given'); } } else { $this->sLanguageId = $sLanguageId; } if (!$bSkipSecret) { if (!isset($_REQUEST['secret']) || $_REQUEST['secret'] !== Settings::getSetting('full_text_search', 'update_secret', null)) { throw new Exception('Not Authorized'); } } $this->aIndexPaths = array(); }
public function __construct($aRequestPath, Page $oJournalPage = null, $aJournalIds = null) { if ($aRequestPath === false) { $this->oJournalPage = $oJournalPage; $this->aJournalIds = $aJournalIds; } else { parent::__construct($aRequestPath); Manager::usePath(); //the “journal” bit $this->oJournalPage = PagePeer::getRootPage()->getPageOfType('journal'); $sLanguageId = Manager::usePath(); if (LanguagePeer::languageIsActive($sLanguageId)) { Session::getSession()->setLanguage($sLanguageId); } } header("Content-Type: application/rss+xml;charset=" . Settings::getSetting('encoding', 'db', 'utf-8')); RichtextUtil::$USE_ABSOLUTE_LINKS = LinkUtil::isSSL(); }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); if (!isset($this->aPath[0])) { // Exceptions thrown in a file module’s constructor yield a UserError but that’s OK. throw new Exception("Error in DisplayDocumentFileModule->__construct: no key given"); } $this->oSession = Session::close(); $this->oDocument = DocumentQuery::create()->findPk(intval($this->aPath[0])); if ($this->oDocument === null || $this->oDocument->getIsProtected() && !$this->isAuthenticated()) { $oErrorPage = PageQuery::create()->findOneByName(Settings::getSetting('error_pages', 'not_found', 'error_404')); if ($oErrorPage) { LinkUtil::redirect(LinkUtil::link($oErrorPage->getLinkArray(), "FrontendManager")); } else { print "Not found"; exit; } } Session::close(); }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); $this->sWidgetType = Manager::usePath(); $this->sAction = Manager::usePath(); }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); $this->oJournalComment = JournalCommentQuery::create()->findHash(Manager::usePath()); $this->sAction = Manager::usePath(); }