Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
PKPHandler Class Reference
Inheritance diagram for PKPHandler:
CitationApiHandler CitationGridHandler CoverHandler GridHandler Handler UserApiHandler AddThisStatisticsGridHandler AnnouncementGridHandler ApprovedProofFilesGridHandler AuthorSignoffFilesGridHandler CategoryGridHandler ContextGridHandler ExportableUsersGridHandler IdentificationCodeGridHandler LanguageGridHandler ListbuilderHandler ManageSocialMediaGridHandler MarketsGridHandler NotificationsGridHandler PKPAuthorGridHandler PKPFilterGridHandler PublicationDateGridHandler PublicationFormatGridHandler ReviewerSelectGridHandler SalesRightsGridHandler ServerInfoGridHandler SetupGridHandler SubmissionEventLogGridHandler SubmissionFilesGridHandler SubmissionsListGridHandler UserGridHandler VersionInfoGridHandler AboutContextHandler AboutSiteHandler AdminHandler CarouselHandler CatalogBookHandler CatalogHandler ContextSettingsWizardHandler DashboardHandler FileApiHandler FileManagementHandler IndexHandler InformationCenterHandler InformationHandler ManageCatalogHandler ManagementHandler ManagerHandler NotificationHandler OAIHandler PageHandler PaymentHandler PKPAnnouncementHandler PKPAuthorDashboardHandler PKPInstallHandler PKPLoginHandler PKPManageFileApiHandler PKPSubmissionHandler PKPUserHandler PublicationEntryHandler PublicationEntryTabHandler PublicationFormatHandler ReportGeneratorHandler SelectMonographHandler SettingsTabHandler SignoffInformationCenterHandler SubmissionMetadataHandler TranslatorHandler

Public Member Functions

 addCheck (&$handlerValidator)
 
 addPolicy ($authorizationPolicy, $addToTop=false)
 
 addRoleAssignment ($roleIds, $operations)
 
 authorize ($request, &$args, $roleAssignments, $enforceRestrictedSite=true)
 
getAuthorizedContext ()
 
getAuthorizedContextObject ($assocType)
 
getDispatcher ()
 
 getFirstUserContext ($user, $contexts)
 
 getId ()
 
 getLastAuthorizationMessage ()
 
 getLoginExemptions ()
 
 getRoleAssignment ($roleId)
 
 getRoleAssignments ()
 
 getWorkingContexts ($request)
 
 index ($args, $request)
 
 initialize ($request, $args=null)
 
 PKPHandler ()
 
 setDispatcher ($dispatcher)
 
 setId ($id)
 
 setupTemplate ($request)
 
 validate ($requiredContexts=null, $request=null)
 

Static Public Member Functions

static getPageParamName ($rangeName)
 
static getRangeInfo ($request, $rangeName, $contextData=null)
 
static hashPageContext ($request, $contextData=array())
 

Public Attributes

 $_authorizationDecisionManager
 
 $_checks = array()
 
 $_dispatcher
 
 $_id
 
 $_roleAssignments = array()
 

Detailed Description

Base request handler abstract class.

Definition at line 22 of file PKPHandler.inc.php.

Member Function Documentation

PKPHandler::addCheck ( $handlerValidator)

Add a validation check to the handler.

NB: deprecated!

Parameters
$handlerValidatorHandlerValidator

Definition at line 128 of file PKPHandler.inc.php.

Referenced by LoginHandler\signInAsUser(), and TranslatorHandler\TranslatorHandler().

PKPHandler::addPolicy (   $authorizationPolicy,
  $addToTop = false 
)

Add an authorization policy for this handler which will be applied in the authorize() method.

Policies must be added in the class constructor or in the subclasses' authorize() method before the parent::authorize() call so that PKPHandler::authorize() will be able to enforce them.

Parameters
$authorizationPolicyAuthorizationPolicy
$addToTopboolean whether to insert the new policy to the top of the list.

Definition at line 147 of file PKPHandler.inc.php.

Referenced by PKPSubmissionHandler\authorize(), AboutContextHandler\authorize(), DashboardHandler\authorize(), PageHandler\authorize(), ProfileHandler\authorize(), BlockPluginsListbuilderHandler\authorize(), FileManagementHandler\authorize(), AdminHandler\authorize(), ManagerHandler\authorize(), ProofFilesListbuilderHandler\authorize(), ReviewerSubmissionMetadataHandler\authorize(), AuthorDashboardHandler\authorize(), PKPReviewerSubmissionMetadataHandler\authorize(), AnnouncementGridHandler\authorize(), CitationApiHandler\authorize(), AuthorDashboardReviewRoundTabHandler\authorize(), CatalogHandler\authorize(), ManageLanguageGridHandler\authorize(), AuthorSubmissionMetadataHandler\authorize(), ContextGridHandler\authorize(), ProductionSubmissionMetadataHandler\authorize(), ServerInfoGridHandler\authorize(), VersionInfoGridHandler\authorize(), UserApiHandler\authorize(), SystemInfoGridHandler\authorize(), CatalogBookHandler\authorize(), ReviewRoundTabHandler\authorize(), CitationGridHandler\authorize(), PublicationFormatHandler\authorize(), ExportableUsersGridHandler\authorize(), ContextSettingsWizardHandler\authorize(), DependentFilesGridHandler\authorize(), ReviewerSelectGridHandler\authorize(), SelectMonographHandler\authorize(), SetupGridHandler\authorize(), LimitReviewFilesGridHandler\authorize(), ManagementHandler\authorize(), NotificationsGridHandler\authorize(), UserGridHandler\authorize(), AdminPluginGridHandler\authorize(), ManageCatalogHandler\authorize(), AuthorGridHandler\authorize(), FilesListbuilderHandler\authorize(), UserGroupGridHandler\authorize(), SubmissionFileEventLogGridHandler\authorize(), CategoryCategoryGridHandler\authorize(), PublicationEntryHandler\authorize(), SettingsPluginGridHandler\authorize(), NotifyUsersListbuilderHandler\authorize(), ChapterAuthorListbuilderHandler\getChapterId(), SetupListbuilderHandler\getContext(), PublicationFormatGridHandler\getInCatalogEntryModal(), UserUserGroupListbuilderHandler\loadData(), ManageSocialMediaGridHandler\setContext(), RepresentativesGridHandler\setMonograph(), AddThisStatisticsGridHandler\setPlugin(), MarketsGridHandler\setPublicationFormat(), IdentificationCodeGridHandler\setPublicationFormat(), SalesRightsGridHandler\setPublicationFormat(), PublicationDateGridHandler\setPublicationFormat(), ChapterGridHandler\setReadOnly(), SubmissionEventLogGridHandler\setSubmission(), and SubmissionsListGridHandler\SubmissionsListGridHandler().

PKPHandler::addRoleAssignment (   $roleIds,
  $operations 
)

Add role - operation assignments to the handler.

Parameters
$roleIdsinteger|array one or more of the ROLE_ID_* constants
$operationsstring|array a single method name or an array of method names to be assigned.

Definition at line 203 of file PKPHandler.inc.php.

Referenced by AdminContextHandler\AdminContextHandler(), AdminFunctionsHandler\AdminFunctionsHandler(), AdminHandler\AdminHandler(), AdminPluginGridHandler\AdminPluginGridHandler(), AdminSettingsTabHandler\AdminSettingsTabHandler(), ArchivedSubmissionsListGridHandler\ArchivedSubmissionsListGridHandler(), AssignedSubmissionsListGridHandler\AssignedSubmissionsListGridHandler(), AuthorDashboardReviewRoundTabHandler\AuthorDashboardReviewRoundTabHandler(), AuthorGridHandler\AuthorGridHandler(), AuthorProofingSignoffFilesGridHandler\AuthorProofingSignoffFilesGridHandler(), AuthorReviewAttachmentsGridHandler\AuthorReviewAttachmentsGridHandler(), AuthorSignoffFilesGridHandler\AuthorSignoffFilesGridHandler(), AuthorSubmissionDetailsFilesGridHandler\AuthorSubmissionDetailsFilesGridHandler(), AuthorSubmissionMetadataHandler\AuthorSubmissionMetadataHandler(), BlockPluginsListbuilderHandler\BlockPluginsListbuilderHandler(), CatalogEntryTabHandler\CatalogEntryTabHandler(), CategoryCategoryGridHandler\CategoryCategoryGridHandler(), CitationGridHandler\CitationGridHandler(), ContextGridHandler\ContextGridHandler(), ContextSettingsWizardHandler\ContextSettingsWizardHandler(), ContributorGridHandler\ContributorGridHandler(), DashboardHandler\DashboardHandler(), DependentFilesGridHandler\DependentFilesGridHandler(), DistributionSettingsTabHandler\DistributionSettingsTabHandler(), EditorReviewAttachmentsGridHandler\EditorReviewAttachmentsGridHandler(), EditorReviewFilesGridHandler\EditorReviewFilesGridHandler(), EditorSelectableReviewAttachmentsGridHandler\EditorSelectableReviewAttachmentsGridHandler(), EditorSubmissionDetailsFilesGridHandler\EditorSubmissionDetailsFilesGridHandler(), ExportableSubmissionsListGridHandler\ExportableSubmissionsListGridHandler(), ExportableUsersGridHandler\ExportableUsersGridHandler(), FairCopyFilesGridHandler\FairCopyFilesGridHandler(), FileApiHandler\FileApiHandler(), FilesListbuilderHandler\FilesListbuilderHandler(), FinalDraftFilesGridHandler\FinalDraftFilesGridHandler(), GenreGridHandler\GenreGridHandler(), ImportExportHandler\ImportExportHandler(), LanguageGridHandler\LanguageGridHandler(), LibraryFileAdminGridHandler\LibraryFileAdminGridHandler(), LibraryFileGridHandler\LibraryFileGridHandler(), LimitReviewFilesGridHandler\LimitReviewFilesGridHandler(), ManageCatalogHandler\ManageCatalogHandler(), ManageFinalDraftFilesGridHandler\ManageFinalDraftFilesGridHandler(), ManageLanguageGridHandler\ManageLanguageGridHandler(), ManagerHandler\ManagerHandler(), MySubmissionsListGridHandler\MySubmissionsListGridHandler(), NotificationsGridHandler\NotificationsGridHandler(), NotifyUsersListbuilderHandler\NotifyUsersListbuilderHandler(), PKPAuthorDashboardHandler\PKPAuthorDashboardHandler(), PKPManageFileApiHandler\PKPManageFileApiHandler(), PKPReviewerSubmissionMetadataHandler\PKPReviewerSubmissionMetadataHandler(), PKPToolsHandler\PKPToolsHandler(), PluginGridHandler\PluginGridHandler(), ProductionReadyFilesGridHandler\ProductionReadyFilesGridHandler(), ProductionSubmissionMetadataHandler\ProductionSubmissionMetadataHandler(), PublicationEntryHandler\PublicationEntryHandler(), PublicationFormatHandler\PublicationFormatHandler(), ReportGeneratorHandler\ReportGeneratorHandler(), ReviewerReviewAttachmentsGridHandler\ReviewerReviewAttachmentsGridHandler(), ReviewerReviewFilesGridHandler\ReviewerReviewFilesGridHandler(), ReviewerSelectGridHandler\ReviewerSelectGridHandler(), ReviewRevisionsGridHandler\ReviewRevisionsGridHandler(), ReviewRoundTabHandler\ReviewRoundTabHandler(), SelectableCopyeditingFilesGridHandler\SelectableCopyeditingFilesGridHandler(), SelectableReviewRevisionsGridHandler\SelectableReviewRevisionsGridHandler(), SelectableSubmissionDetailsFilesGridHandler\SelectableSubmissionDetailsFilesGridHandler(), SelectMonographHandler\SelectMonographHandler(), SeriesGridHandler\SeriesGridHandler(), ServerInfoGridHandler\ServerInfoGridHandler(), SettingsHandler\SettingsHandler(), SettingsPluginGridHandler\SettingsPluginGridHandler(), SetupGridHandler\SetupGridHandler(), SponsorGridHandler\SponsorGridHandler(), SubmissionChecklistGridHandler\SubmissionChecklistGridHandler(), SubmissionDetailsFilesGridHandler\SubmissionDetailsFilesGridHandler(), SubmissionHandler\SubmissionHandler(), SubmissionWizardFilesGridHandler\SubmissionWizardFilesGridHandler(), SystemInfoGridHandler\SystemInfoGridHandler(), UnassignedSubmissionsListGridHandler\UnassignedSubmissionsListGridHandler(), UserGridHandler\UserGridHandler(), UserGroupGridHandler\UserGroupGridHandler(), VersionInfoGridHandler\VersionInfoGridHandler(), WebsiteSettingsTabHandler\WebsiteSettingsTabHandler(), and WorkflowHandler\WorkflowHandler().

PKPHandler::authorize (   $request,
$args,
  $roleAssignments,
  $enforceRestrictedSite = true 
)

Authorize this request.

Routers will call this method automatically thereby enforcing authorization. This method will be called before the validate() method and before passing control on to the handler operation.

NB: This method will be called once for every request only.

Parameters
$requestRequest
$argsarray request arguments
$roleAssignmentsarray the operation role assignment, see getRoleAssignment() for more details.
$enforceRestrictedSiteboolean True iff site restrictions are to be enforced
Returns
boolean

Definition at line 269 of file PKPHandler.inc.php.

& PKPHandler::getAuthorizedContext ( )

Get the authorized context.

NB: You should avoid accessing the authorized context directly to avoid accidentally overwriting an object in the context. Try to use getAuthorizedContextObject() instead where possible.

Returns
array

Definition at line 179 of file PKPHandler.inc.php.

Referenced by GridHandler\renderRow().

& PKPHandler::getAuthorizedContextObject (   $assocType)

Retrieve authorized context objects from the decision manager.

Parameters
$assocTypeinteger any of the ASSOC_TYPE_* constants
Returns
mixed

Definition at line 164 of file PKPHandler.inc.php.

Referenced by AdminLanguageGridHandler\_canManage(), WorkflowHandler\_notificationOptionsByStage(), LoginHandler\_redirectAfterLogin(), PKPSubmissionHandler\authorize(), PKPAuthorGridHandler\authorize(), PublicationFormatGridHandler\authorize(), MarketsGridHandler\authorize(), IdentificationCodeGridHandler\authorize(), PublicationDateGridHandler\authorize(), SalesRightsGridHandler\authorize(), CatalogBookHandler\book(), AuthorGridHandler\canAdminister(), PKPManageFileApiHandler\deleteFile(), PluginGridHandler\deletePlugin(), CatalogBookHandler\download(), FileApiHandler\downloadAllFiles(), FileApiHandler\downloadFile(), WorkflowHandler\expedite(), PKPReviewerSubmissionMetadataHandler\fetch(), SubmissionMetadataHandler\fetch(), AuthorDashboardReviewRoundTabHandler\fetchReviewRoundInfo(), SettingsPluginGridHandler\getCategoryData(), SubmissionFileEventLogGridHandler\getFilterForm(), ReviewerSelectGridHandler\getFilterForm(), CopyeditingFilesListbuilderHandler\getOptions(), ProofFilesListbuilderHandler\getOptions(), DependentFilesGridHandler\getRequestArgs(), ProofFilesListbuilderHandler\getRequestArgs(), FilesListbuilderHandler\getRequestArgs(), FilesListbuilderHandler\getRowDataElement(), AdminPluginGridHandler\getRowInstance(), SettingsPluginGridHandler\getRowInstance(), FileManagementHandler\getStageId(), NotifyUsersListbuilderHandler\getSubmission(), FileManagementHandler\getSubmission(), AuthorProofingSignoffFilesGridHandler\initialize(), PluginGridHandler\initialize(), PublicationEntryHandler\initialize(), CitationGridHandler\initialize(), AuthorSignoffFilesGridHandler\initialize(), SubmissionFileEventLogGridHandler\initialize(), LimitReviewFilesGridHandler\isDataElementSelected(), ReviewerSelectGridHandler\loadData(), SubmissionInformationCenterHandler\metadata(), PKPSubmissionInformationCenterHandler\metadata(), PluginGridHandler\plugin(), WorkflowHandler\production(), WorkflowHandler\productionFormatsTab(), PKPAuthorDashboardHandler\readSubmissionEmail(), FileApiHandler\recordDownload(), PKPSubmissionHandler\saveStep(), PublicationFormatHandler\setupTemplate(), PKPSubmissionHandler\step(), PKPAuthorDashboardHandler\submission(), AuthorDashboardHandler\submission(), WorkflowHandler\submissionProgressBar(), FileApiHandler\viewFile(), and PKPSubmissionHandler\wizard().

& PKPHandler::getDispatcher ( )

Get the dispatcher

NB: The dispatcher will only be set after handler instantiation. Calling getDispatcher() in the constructor will fail.

Returns
Dispatcher

Definition at line 97 of file PKPHandler.inc.php.

Referenced by CitationGridHandler\exportCitations().

PKPHandler::getFirstUserContext (   $user,
  $contexts 
)

Return the first context that user is enrolled with.

Parameters
$userUser
$contextsArray
Returns
mixed Either Context or null

Definition at line 508 of file PKPHandler.inc.php.

Referenced by Handler\getTargetContext().

PKPHandler::getLastAuthorizationMessage ( )

Retrieve the last authorization message from the decision manager.

Returns
string

Definition at line 189 of file PKPHandler.inc.php.

PKPHandler::getLoginExemptions ( )

Get a list of pages that don't require login, even if the system does FIXME: Delete this method when authorization re-factoring is complete.

Returns
array

Definition at line 488 of file PKPHandler.inc.php.

static PKPHandler::getPageParamName (   $rangeName)
static

Get the range info page parameter name.

Parameters
$rangeNamestring
Returns
string

Definition at line 436 of file PKPHandler.inc.php.

static PKPHandler::getRangeInfo (   $request,
  $rangeName,
  $contextData = null 
)
static

Return the DBResultRange structure and misc. variables describing the current page of a set of pages.

Parameters
$requestPKPRequest
$rangeNamestring Symbolic name of range of pages; must match the Smarty {page_list ...} name.
$contextDataarray If set, this should contain a set of data that are required to define the context of this request (for maintaining page numbers across requests). To disable persistent page contexts, set this variable to null.
Returns
DBResultRange

Definition at line 395 of file PKPHandler.inc.php.

Referenced by PagingFeature\getJSClass(), and NotificationHandler\index().

PKPHandler::getRoleAssignment (   $roleId)

This method returns an assignment of operation names for the given role.

Parameters
$roleIdint
Returns
array assignment for the given role.

Definition at line 233 of file PKPHandler.inc.php.

References $_roleAssignments.

PKPHandler::getRoleAssignments ( )

This method returns an assignment of roles to operation names.

Returns
array assignments for all roles.

Definition at line 248 of file PKPHandler.inc.php.

PKPHandler::getWorkingContexts (   $request)

Get the iterator of working contexts.

Parameters
$requestPKPRequest
Returns
ItemIterator

Definition at line 498 of file PKPHandler.inc.php.

static PKPHandler::hashPageContext (   $request,
  $contextData = array() 
)
static

Generate a unique-ish hash of the page's identity, including all context that differentiates it from other similar pages (e.g. all articles vs. all articles starting with "l").

Parameters
$requestPKPRequest
$contextDataarray A set of information identifying the page
Returns
string hash

Definition at line 474 of file PKPHandler.inc.php.

PKPHandler::index (   $args,
  $request 
)

Fallback method in case request handler does not implement index method.

Parameters
$argsarray
$requestPKPRequest

Definition at line 115 of file PKPHandler.inc.php.

PKPHandler::initialize (   $request,
  $args = null 
)

Subclasses can override this method to configure the handler.

NB: This method will be called after validation and authorization.

Parameters
$requestPKPRequest
$argsarray

Definition at line 367 of file PKPHandler.inc.php.

PKPHandler::PKPHandler ( )

Constructor

Definition at line 66 of file PKPHandler.inc.php.

PKPHandler::setDispatcher (   $dispatcher)

Set the dispatcher

Parameters
$dispatcherPKPDispatcher

Definition at line 106 of file PKPHandler.inc.php.

PKPHandler::setId (   $id)

Set the controller id

Parameters
$idstring

Definition at line 76 of file PKPHandler.inc.php.

Referenced by SubmissionChecklistGridHandler\initialize().

PKPHandler::setupTemplate (   $request)

Set up the basic template.

Parameters
$requestPKPRequest

Definition at line 444 of file PKPHandler.inc.php.

Referenced by PluginGridHandler\_showUploadPluginForm(), SettingsHandler\access(), PKPUserHandler\authorizationDenied(), CatalogBookHandler\book(), SettingsHandler\categories(), ProfileHandler\changePassword(), PKPLoginHandler\changePassword(), PKPManageFileApiHandler\deleteFile(), PluginGridHandler\deletePlugin(), SettingsHandler\distribution(), CatalogBookHandler\download(), GenreGridHandler\editGenre(), SeriesGridHandler\editSeries(), CarouselHandler\fetch(), PublicationEntryHandler\fetch(), PayPalPlugin\handle(), PageHandler\header(), PKPLoginHandler\index(), IndexHandler\index(), SettingsHandler\index(), SubmissionMetadataHandler\initialize(), PublicationEntryHandler\initialize(), ManageCatalogHandler\initialize(), SettingsTabHandler\initialize(), PKPLoginHandler\lostPassword(), PluginGridHandler\plugin(), SettingsHandler\press(), ProfileHandler\profile(), SettingsHandler\publication(), RegistrationHandler\register(), RegistrationHandler\registerUser(), RegistrationHandler\registrationDisabled(), PKPLoginHandler\requestResetPassword(), PKPLoginHandler\resetPassword(), ProfileHandler\savePassword(), PKPLoginHandler\savePassword(), ProfileHandler\saveProfile(), SettingsHandler\series(), PageHandler\sidebar(), PKPLoginHandler\signIn(), PKPLoginHandler\signOut(), ContextSettingsWizardHandler\startWizard(), AdminFunctionsHandler\systemInfo(), ManageReviewFilesGridHandler\updateReviewFiles(), and SettingsHandler\website().

PKPHandler::validate (   $requiredContexts = null,
  $request = null 
)

Perform data integrity checks.

This method will be called once for every request only.

NB: Any kind of authorization check is now deprecated within this method. This method is purely meant for data integrity checks that do not lead to denial of access to resources (e.g. via redirect) like handler operations or data objects.

Parameters
$requiredContextsarray
$requestRequest

Definition at line 330 of file PKPHandler.inc.php.

Referenced by PKPAnnouncementHandler\announcements(), PKPAnnouncementHandler\announcementTypes(), NotificationHandler\delete(), TranslatorHandler\export(), ReportGeneratorHandler\fetchArticlesInfo(), ReportGeneratorHandler\fetchRegions(), InformationHandler\index(), NotificationHandler\index(), NotificationHandler\saveSettings(), NotificationHandler\saveSubscribeMailList(), NotificationHandler\settings(), LoginHandler\signInAsUser(), and LoginHandler\signOutAsUser().

Member Data Documentation

AuthorizationDecisionManager PKPHandler::$_authorizationDecisionManager

authorization decision manager for this handler

Definition at line 61 of file PKPHandler.inc.php.

array PKPHandler::$_checks = array()

validation checks for this page - deprecated!

Definition at line 42 of file PKPHandler.inc.php.

Dispatcher PKPHandler::$_dispatcher

mainly needed for cross-router url construction

Definition at line 36 of file PKPHandler.inc.php.

string PKPHandler::$_id

identifier of the controller instance - must be unique among all instances of a given controller type.

Definition at line 30 of file PKPHandler.inc.php.

array PKPHandler::$_roleAssignments = array()

The value of this variable should look like this: array( ROLE_ID_... => array(...allowed handler operations...), ... )

Definition at line 55 of file PKPHandler.inc.php.

Referenced by getRoleAssignment().


The documentation for this class was generated from the following file: