public function run($static = false) { $form = new Form(); $form->post('login')->val('blank')->post('password')->val('blank'); if (!$form->submit()) { // Error $this->_error($static); return false; } $data = $form->fetch(); $login = $data['login']; $password = Hash::create('sha256', $data['password'], PASS_HASH_KEY); $query = "SELECT userid, login, role FROM user WHERE login = :login AND password = :password"; if (!($result = $this->db->select($query, array(':login' => $login, ':password' => $password)))) { $this->_error($static); return false; } Session::init(); Session::set('userid', $result[0]['userid']); Session::set('login', $result[0]['login']); Session::set('role', $result[0]['role']); Session::set('loggedIn', true); if ($static) { header('location:' . URL . 'dashboard'); } echo json_encode('success'); }
/** * @copydoc Form::fetch() */ function fetch($request) { $templateMgr = TemplateManager::getManager($request); $pubIdPlugins = PluginRegistry::loadCategory('pubIds', true, $this->getContextId()); $templateMgr->assign(array('pubIdPlugins' => $pubIdPlugins, 'pubObject' => $this->getPubObject(), 'approval' => $this->getApproval(), 'confirmationText' => $this->getConfirmationText())); return parent::fetch($request); }
/** * @copydoc Form::fetch() */ function fetch($request) { $urnNamespaces = array('' => '', 'urn:nbn:de' => 'urn:nbn:de', 'urn:nbn:at' => 'urn:nbn:at', 'urn:nbn:ch' => 'urn:nbn:ch', 'urn:nbn' => 'urn:nbn', 'urn' => 'urn'); $templateMgr = TemplateManager::getManager($request); $templateMgr->assign('urnNamespaces', $urnNamespaces); return parent::fetch($request); }
/** * @copydoc Form::fetch() */ function fetch($request) { $templateMgr = TemplateManager::getManager($request); $noteDao = DAORegistry::getDAO('NoteDAO'); $templateMgr->assign(array('notes' => $noteDao->getByAssoc($this->getAssocType(), $this->getAssocId()), 'submitNoteText' => $this->getSubmitNoteLocaleKey(), 'newNoteFormTemplate' => $this->getNewNoteFormTemplate())); return parent::fetch($request); }
/** * @copydoc Form::fetch() */ function fetch($request, $template = null, $display = false) { $templateMgr = TemplateManager::getManager($request); $site = $request->getSite(); $context = $request->getContext(); if ($this->captchaEnabled) { import('lib.pkp.lib.recaptcha.recaptchalib'); $publicKey = Config::getVar('captcha', 'recaptcha_public_key'); $useSSL = Config::getVar('security', 'force_ssl') ? true : false; $reCaptchaHtml = recaptcha_get_html($publicKey, null, $useSSL); $templateMgr->assign(array('reCaptchaHtml' => $reCaptchaHtml, 'captchaEnabled' => true)); } $countryDao = DAORegistry::getDAO('CountryDAO'); $countries = $countryDao->getCountries(); $templateMgr->assign('countries', $countries); $userDao = DAORegistry::getDAO('UserDAO'); $templateMgr->assign('genderOptions', $userDao->getGenderOptions()); $site = $request->getSite(); $templateMgr->assign('availableLocales', $site->getSupportedLocaleNames()); import('lib.pkp.classes.user.form.UserFormHelper'); $userFormHelper = new UserFormHelper(); $userFormHelper->assignRoleContent($templateMgr, $request); $templateMgr->assign(array('source' => $request->getUserVar('source'), 'minPasswordLength' => $site->getMinPasswordLength(), 'privacyStatement' => $context->getLocalizedSetting('privacyStatement'), 'includeEntirePage' => $display)); return parent::fetch($request, $template, $display); }
/** * Fetch * @param $request PKPRequest * @see Form::fetch() */ function fetch($request) { $templateMgr = TemplateManager::getManager($request); $templateMgr->assign('submissionFileCategories', array(GENRE_CATEGORY_DOCUMENT => __('submission.document'), GENRE_CATEGORY_ARTWORK => __('submission.art'), GENRE_CATEGORY_SUPPLEMENTARY => __('submission.supplementary'))); AppLocale::requireComponents(LOCALE_COMPONENT_APP_MANAGER); return parent::fetch($request); }
/** * Fetch the form. */ function fetch($request) { $templateMgr = TemplateManager::getManager($request); $journal = $request->getJournal(); // set up the accessibility options pulldown $templateMgr->assign('enableDelayedOpenAccess', $journal->getSetting('enableDelayedOpenAccess')); $templateMgr->assign('accessOptions', array(ISSUE_ACCESS_OPEN => AppLocale::Translate('editor.issues.openAccess'), ISSUE_ACCESS_SUBSCRIPTION => AppLocale::Translate('editor.issues.subscription'))); if ($this->issue) { $templateMgr->assign('issue', $this->issue); $templateMgr->assign('issueId', $this->issue->getId()); } // Cover image preview $coverImage = null; if ($this->issue) { $coverImage = $this->issue->getCoverImage(); } // Cover image delete link action if ($coverImage) { import('lib.pkp.classes.linkAction.LinkAction'); import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal'); $router = $request->getRouter(); $deleteCoverImageLinkAction = new LinkAction('deleteCoverImage', new RemoteActionConfirmationModal($request->getSession(), __('common.confirmDelete'), null, $router->url($request, null, null, 'deleteCoverImage', null, array('coverImage' => $coverImage, 'issueId' => $this->issue->getId())), 'modal_delete'), __('common.delete'), null); $templateMgr->assign('deleteCoverImageLinkAction', $deleteCoverImageLinkAction); } return parent::fetch($request); }
/** * Fetch the HTML contents of the form. * @param $request PKPRequest * return string */ function fetch($request) { $templateMgr = TemplateManager::getManager($request); $templateMgr->assign('submissionId', $this->getMonograph()->getId()); $templateMgr->assign('stageId', $this->getStageId()); $templateMgr->assign('formParams', $this->getFormParams()); $onixCodelistItemDao = DAORegistry::getDAO('ONIXCodelistItemDAO'); // get the lists associated with the select elements on this form $audienceCodes = $onixCodelistItemDao->getCodes('List28'); $audienceRangeQualifiers = $onixCodelistItemDao->getCodes('List30'); $audienceRanges = $onixCodelistItemDao->getCodes('List77'); // assign these lists to the form for select options $templateMgr->assign('audienceCodes', $audienceCodes); $templateMgr->assign('audienceRangeQualifiers', $audienceRangeQualifiers); $templateMgr->assign('audienceRanges', $audienceRanges); $publishedMonograph = $this->getPublishedMonograph(); if ($publishedMonograph) { // pre-select the existing values on the form. $templateMgr->assign('audience', $publishedMonograph->getAudience()); $templateMgr->assign('audienceRangeQualifier', $publishedMonograph->getAudienceRangeQualifier()); $templateMgr->assign('audienceRangeFrom', $publishedMonograph->getAudienceRangeFrom()); $templateMgr->assign('audienceRangeTo', $publishedMonograph->getAudienceRangeTo()); $templateMgr->assign('audienceRangeExact', $publishedMonograph->getAudienceRangeExact()); $templateMgr->assign('coverImage', $publishedMonograph->getCoverImage()); } return parent::fetch($request); }
/** * Display the form. * @param $args array * @param $request PKPRequest */ function fetch($args, $request) { $templateMgr = TemplateManager::getManager($request); import('lib.pkp.classes.reviewForm.ReviewFormElement'); $templateMgr->assign(array('reviewFormId' => $this->reviewFormId, 'reviewFormElementId' => $this->reviewFormElementId, 'multipleResponsesElementTypes' => ReviewFormElement::getMultipleResponsesElementTypes(), 'multipleResponsesElementTypesString' => ';' . implode(';', ReviewFormElement::getMultipleResponsesElementTypes()) . ';', 'reviewFormElementTypeOptions' => ReviewFormElement::getReviewFormElementTypeOptions())); return parent::fetch($request); }
/** * Fetch * @param $request PKPRequest * @see Form::fetch() */ function fetch(&$request) { $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('monographFileCategories', array(GENRE_CATEGORY_DOCUMENT => Locale::translate('submission.document'), GENRE_CATEGORY_ARTWORK => Locale::translate('submission.art'))); Locale::requireComponents(array(LOCALE_COMPONENT_OMP_MANAGER)); return parent::fetch($request); }
/** * Fetch the HTML contents of the form. * @param $request PKPRequest * return string */ function fetch($request) { $context = $request->getContext(); $templateMgr = TemplateManager::getManager($request); $templateMgr->assign('submissionId', $this->getSubmission()->getId()); $templateMgr->assign('stageId', $this->getStageId()); $templateMgr->assign('formParams', $this->getFormParams()); $templateMgr->assign('context', $context); $journalSettingsDao = DAORegistry::getDAO('JournalSettingsDAO'); $templateMgr->assign('issueOptions', $this->getIssueOptions($context)); $publishedArticle = $this->getPublishedArticle(); if ($publishedArticle) { $templateMgr->assign('publishedArticle', $publishedArticle); $issueDao = DAORegistry::getDAO('IssueDAO'); $issue = $issueDao->getById($publishedArticle->getIssueId()); if ($issue) { $templateMgr->assign('issueAccess', $issue->getAccessStatus()); $templateMgr->assign('accessOptions', array(ARTICLE_ACCESS_ISSUE_DEFAULT => __('editor.issues.default'), ARTICLE_ACCESS_OPEN => __('editor.issues.open'))); } } // include payment information // Set up required Payment Related Information import('classes.payment.ojs.OJSPaymentManager'); $paymentManager = new OJSPaymentManager($request); $completedPaymentDao = DAORegistry::getDAO('OJSCompletedPaymentDAO'); $publicationFeeEnabled = $paymentManager->publicationEnabled(); $templateMgr->assign('publicationFeeEnabled', $publicationFeeEnabled); if ($publicationFeeEnabled) { $templateMgr->assign('publicationPayment', $completedPaymentDao->getPublicationCompletedPayment($context->getId(), $this->getSubission()->getId())); } $templateMgr->assign('submission', $this->getSubmission()); return parent::fetch($request); }
function fetch(&$request) { $monograph =& $this->getMonograph(); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign_by_ref('monograph', $this->getMonograph()); return parent::fetch($request); }
/** * Display the form. */ function fetch($args, $request) { $json = new JSONMessage(); $templateMgr = TemplateManager::getManager($request); $templateMgr->assign('reviewFormId', $this->reviewFormId); return parent::fetch($request); }
/** * Fetch the form. * @see Form::fetch() */ function fetch(&$request) { $templateMgr =& TemplateManager::getManager(); $noteDao =& DAORegistry::getDAO('NoteDAO'); $notes =& $noteDao->getByAssoc($this->getAssocType(), $this->getAssocId()); $templateMgr->assign_by_ref('notes', $notes); return parent::fetch($request); }
/** * Display the form. * @param $request PKPRequest * @param $requestArgs array Request parameters to bounce back with the form submission. */ function fetch($request, $requestArgs = array()) { $userDao = DAORegistry::getDAO('UserDAO'); $user = $userDao->getById($this->_reviewAssignment->getReviewerId()); $templateMgr = TemplateManager::getManager($request); $templateMgr->assign(array('userFullName' => $this->_reviewAssignment->getReviewerFullName(), 'requestArgs' => $requestArgs, 'reviewAssignmentId' => $this->_reviewAssignment->getId())); return parent::fetch($request); }
/** * Fetch * @param $request PKPRequest * @see Form::fetch() */ function fetch($request) { AppLocale::requireComponents(LOCALE_COMPONENT_APP_MANAGER); $templateMgr = TemplateManager::getManager($request); $templateMgr->assign('institution', $this->_data['institution']); $templateMgr->assign('url', $this->_data['url']); return parent::fetch($request); }
/** * Display the form. * @param $args array * @param $request PKPRequest */ function fetch($args, $request) { $userDao = DAORegistry::getDAO('UserDAO'); $user = $userDao->getById($this->userId); $templateMgr = TemplateManager::getManager($request); $templateMgr->assign(array('userId' => $this->userId, 'userFullName' => $user->getFullName(), 'userEmail' => $user->getEmail())); return parent::fetch($request); }
/** * Display the grid's containing page. * @param $args array * @param $request PKPRequest */ function index($args, $request) { $context = $request->getContext(); import('lib.pkp.classes.form.Form'); $form = new Form(self::$plugin->getTemplatePath() . 'staticPages.tpl'); $json = new JSONMessage(true, $form->fetch($request)); return $json->getString(); }
/** * Fetch the form. * @see Form::fetch() */ function fetch(&$request) { $templateMgr =& TemplateManager::getManager(); $templateMgr->assign_by_ref('group', $this->group); $templateMgr->assign('helpTopicId', 'press.managementPages.groups'); $templateMgr->assign('groupContextOptions', array(GROUP_CONTEXT_EDITORIAL_TEAM => 'manager.groups.context.editorialTeam', GROUP_CONTEXT_PEOPLE => 'manager.groups.context.people')); return parent::fetch($request); }
/** * Fetch the form. */ function fetch($request) { $templateMgr = TemplateManager::getManager($request); if ($this->issue) { $templateMgr->assign('issue', $this->issue); $templateMgr->assign('issueId', $this->issue->getId()); } return parent::fetch($request); }
/** * @copydoc */ function fetch($request) { $context = $request->getContext(); $userId = $request->getUser()->getId(); $notificationSubscriptionSettingsDao = DAORegistry::getDAO('NotificationSubscriptionSettingsDAO'); $templateMgr = TemplateManager::getManager($request); $templateMgr->assign(array('blockedNotifications' => $notificationSubscriptionSettingsDao->getNotificationSubscriptionSettings('blocked_notification', $userId, $context->getId()), 'emailSettings' => $notificationSubscriptionSettingsDao->getNotificationSubscriptionSettings('blocked_emailed_notification', $userId, $context->getId()), 'notificationSettingCategories' => $this->getNotificationSettingCategories(), 'notificationSettings' => $this->getNotificationSettingsMap())); return parent::fetch($request); }
/** * @see Form::fetch */ function fetch($request) { $templateMgr = TemplateManager::getManager(); $templateMgr->assign('submissionId', $this->_submissionId); $templateMgr->assign('submissionFileId', $this->_submissionFileId); $templateMgr->assign('vgWortPublic', $this->getData('vgWortPublic')); $templateMgr->assign('vgWortPrivate', $this->getData('vgWortPrivate')); return parent::fetch($request); }
/** * @see Form::fetch */ function fetch($request) { $templateMgr = TemplateManager::getManager(); $templateMgr->assign('submissionId', $this->_submissionId); $templateMgr->assign('contextId', $this->_contextId); $templateMgr->assign('stageId', $this->_stageId); $templateMgr->assign('formParams', $this->_formParams); return parent::fetch($request); }
/** * @see Form::fetch() */ function fetch($request) { $reviewAssignment = $this->getReviewAssignment(); $templateMgr = TemplateManager::getManager($request); $templateMgr->assign('submission', $this->getReviewerSubmission()); $templateMgr->assign('reviewIsComplete', (bool) $reviewAssignment->getDateCompleted()); $templateMgr->assign('step', $this->getStep()); return parent::fetch($request); }
/** * @copydoc Form::fetch() */ function fetch($request, $params = null) { $templateMgr = TemplateManager::getManager($request); if (!is_null($params)) { $templateMgr->assign($params); } $templateMgr->assign('fileSettingName', $this->getFileSettingName()); return parent::fetch($request); }
/** * Fetch * @param $request PKPRequest * @see Form::fetch() */ function fetch($request) { AppLocale::requireComponents(LOCALE_COMPONENT_APP_MANAGER); // load the file types for the selector on the form. $templateMgr = TemplateManager::getManager($request); $fileTypeKeys = $this->libraryFileManager->getTypeTitleKeyMap(); $templateMgr->assign('fileTypes', $fileTypeKeys); return parent::fetch($request); }
/** * @copydoc Form::fetch() */ function fetch($request) { $templateMgr = TemplateManager::getManager($request); $templateMgr->assign(array('pubIdPlugins' => PluginRegistry::loadCategory('pubIds', true, $this->getContextId()), 'pubObject' => $this->getPubObject(), 'stageId' => $this->getStageId(), 'formParams' => $this->getFormParams())); // consider JavaScripts $pubIdPluginHelper = new PKPPubIdPluginHelper(); $pubIdPluginHelper->addJavaScripts($this->getContextId(), $request, $templateMgr); return parent::fetch($request); }
/** * Fetch * @see Form::fetch() */ function fetch(&$request) { $templateMgr =& TemplateManager::getManager(); $seriesEditorSubmissionDAO =& DAORegistry::getDAO('SeriesEditorSubmissionDAO'); $reviewerValues = $seriesEditorSubmissionDAO->getAnonymousReviewerStatistics(); $templateMgr->assign('reviewerValues', $reviewerValues); $templateMgr->assign('monographId', $this->getMonographId()); return parent::fetch($request); }
/** * Fetch the Edit Review Form form * @param $request PKPRequest * @see Form::fetch() */ function fetch($request) { $templateMgr = TemplateManager::getManager($request); // Pass along various necessary parameters from request $templateMgr->assign('stageId', $this->_reviewAssignment->getStageId()); $templateMgr->assign('reviewRoundId', $this->_reviewRound->getId()); $templateMgr->assign('submissionId', $this->_reviewAssignment->getSubmissionId()); $templateMgr->assign('reviewAssignmentId', $this->_reviewAssignment->getId()); return parent::fetch($request); }
/** * Display the form. */ function fetch($request) { $journal = $request->getJournal(); $templateMgr = TemplateManager::getManager($request); if ($this->_articleGalley) { $templateMgr->assign(array('representationId' => $this->_articleGalley->getId(), 'articleGalley' => $this->_articleGalley, 'articleGalleyFile' => $this->_articleGalley->getFile())); } $templateMgr->assign(array('supportedLocales' => $journal->getSupportedLocaleNames(), 'submissionId' => $this->_submission->getId())); return parent::fetch($request); }