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 (ErrorHandler::getEnvironment() === 'production') { exit; } }
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 (!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) { 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(); }
/** * __construct() */ public function __construct() { parent::__construct(); $sPath = self::usePath(); try { $this->oModule = FileModule::getModuleInstance($sPath, self::$REQUEST_PATH); } catch (Exception $e) { throw new UserError('wns.error.user.invalid_file_module', array('name' => $sPath)); } $this->oModule->renderFile(); }
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); $this->sWidgetType = Manager::usePath(); $this->sAction = Manager::usePath(); }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); }
public function __construct($aRequestPath) { parent::__construct($aRequestPath); $this->oJournalComment = JournalCommentQuery::create()->findHash(Manager::usePath()); $this->sAction = Manager::usePath(); }
return $contents; } else { return $defaultValue; } } $parser = new Parser(); $projectName = $_REQUEST['projectName']; $fileName = basename($_FILES['fileaddress']['name']); $tempFileName = $_FILES['fileaddress']['tmp_name']; $fileContents = file_get_contents($tempFileName); $formattedOption = isset($_REQUEST['isFormatted']); $publicOption = (int) isset($_REQUEST['public']); $userName = $loginModel->getUserName(); // Use the fileModule.php to upload files include 'fileModule.php'; $fileMod = new FileModule($connection); // $connection comes from the header.php echo "<div class='container'>"; $xmlFileName = realpath($tempFileName); if ($formattedOption) { $xml = $parser->parseFormattedText($fileContents); $parsedFileName = pathinfo($fileName, PATHINFO_FILENAME) . ".xml"; file_put_contents($parsedFileName, $xml); } else { $xml = $parser->parseUnformattedText($fileContents); $parsedFileName = pathinfo($fileName, PATHINFO_FILENAME) . ".xml"; file_put_contents($parsedFileName, $xml); } if ($fileMod->upload($userName, $projectName, $fileName, $publicOption, $parsedFileName)) { echo "<p>Your upload was successful!</p>"; } else {
<div id="fileOptions"> <form action="GraphicalInterface.php" method="post"> <input type="Hidden" name="owner" /> <input type="Hidden" name="filename" /> <button id="toggleBtn" type="button" ><input id="selectAll" type="checkbox" /></button> <button id="uploadBtn" type="button" >Upload New File</button> <button id="editBtn" type="Submit" >Edit In Workspace</button> </form> </div> <br /><br /> <div id="projectTable"> <?php //get files from database here and put them into a table $fileMod = new FileModule($connection); $userName = $loginModel->getUserName(); $fileArray = $fileMod->getFilesInfo($userName); echo "<table id='myFileTable'>\n \t\t\t\t\t<tr>\n \t\t\t\t\t\t<th></th>\n \t\t\t\t\t\t<th>Project Name</th>\n \t\t\t\t\t\t<th>Public</th>\n \t\t\t\t\t\t<th>Last Update</th>\n \t\t\t\t\t</tr>"; for ($i = 0; $i < count($fileArray); $i++) { $row = $fileArray[$i]; $projectName = $row['projectName']; $fileName = $row['fileName']; if ($row['public']) { $public = "Yes"; } else { $public = "No"; } $lastUpdate = $row['lastUpdate']; echo "<tr>"; echo "<td><input type='checkbox' class='userCheckbox' id='{$fileName}'></td>\n \t\t\t\t <td>{$projectName}</td>\n \t\t\t\t <td>{$public}</td>\n \t\t\t\t <td>{$lastUpdate}</td>";
<?php include 'header.php'; include 'fileModule.php'; $fileMod = new FileModule($connection); //$connection comes from the header.php $username = $_POST['owner']; $filename = $_POST['filename']; $returnedContent = $fileMod->getFileContents($username, $filename); echo $returnedContent; ?> <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title> - Graphical Interface</title> <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script> <link rel="stylesheet" type="text/css" href="/css/result-light.css"> <script type='text/javascript' src="http://jsplumb.org/js/1.3.4/jquery.jsPlumb-1.3.4-all.js"></script> <style type='text/css'> .window { background-color: white; border: 3px solid #cccccc; font-size: 0.8em; height: 150px; opacity: 0.8; padding: 40px; position: absolute; width: 150px;