Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
PKPHandler Class Reference
Inheritance diagram for PKPHandler:
CitationApiHandler CitationGridHandler GridHandler Handler UserApiHandler CategoryGridHandler ListbuilderHandler PKPCitationGridHandler PKPFilterGridHandler AboutHandler AdminHandler ArticleHandler AuthorHandler BooksForReviewAuthorHandler BooksForReviewEditorHandler BooksForReviewHandler BrowseHandler CommentHandler CopyeditorHandler CustomLocaleHandler DataverseHandler DonationsHandler GatewayHandler GiftsHandler HelpHandler IndexHandler InformationHandler IssueHandler LayoutEditorHandler LuceneHandler ManagerHandler NotificationHandler OAIHandler ObjectsForReviewAuthorHandler ObjectsForReviewEditorHandler ObjectsForReviewHandler PaymentHandler PKPAnnouncementHandler PKPInstallHandler PKPLoginHandler PKPUserHandler ProofreaderHandler ReferralHandler ReportGeneratorHandler ReviewerHandler ReviewObjectTypesEditorHandler RTAdminHandler SearchHandler SectionEditorHandler SitemapHandler StaticPagesHandler SubscriptionManagerHandler SwordHandler ThesisHandler TranslatorHandler UserHandler

Public Member Functions

 addCheck (&$handlerValidator)
 
 addPolicy (&$authorizationPolicy, $addToTop=false)
 
 addRoleAssignment ($roleIds, $operations)
 
 authorize (&$request, &$args, $roleAssignments)
 
getAuthorizedContext ()
 
getAuthorizedContextObject ($assocType)
 
getDispatcher ()
 
 getId ()
 
 getLastAuthorizationMessage ()
 
 getLoginExemptions ()
 
getRangeInfo ($rangeName, $contextData=null)
 
 getRoleAssignment ($roleId)
 
 getRoleAssignments ()
 
 hashPageContext ($contextData=array())
 
 index ()
 
 initialize (&$request, $args=null)
 
 PKPHandler ()
 
 requireSSL ()
 
 setDispatcher (&$dispatcher)
 
 setId ($id)
 
 validate ($requiredContexts=null, $request=null)
 

Detailed Description

Base request handler abstract class.

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

Member Function Documentation

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 130 of file PKPHandler.inc.php.

Referenced by CitationApiHandler\authorize(), UserApiHandler\authorize(), FilterGridHandler\authorize(), CitationGridHandler\authorize(), authorize(), and GridHandler\authorize().

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 186 of file PKPHandler.inc.php.

Referenced by CitationGridHandler\CitationGridHandler(), FilterGridHandler\FilterGridHandler(), and ReportGeneratorHandler\ReportGeneratorHandler().

PKPHandler::authorize ( $request,
$args,
  $roleAssignments 
)

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
$roleAssignmentarray the operation role assignment, see getRoleAssignment() for more details.
Returns
boolean

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

References addPolicy(), and requireSSL().

& 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 162 of file PKPHandler.inc.php.

Referenced by GridHandler\authorize().

& PKPHandler::getAuthorizedContextObject (   $assocType)

Retrieve authorized context objects from the decision manager.

Parameters
$assocTypeinteger any of the ASSOC_TYPE_* constants
Returns
mixed

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

Referenced by CitationGridHandler\initialize().

& 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 82 of file PKPHandler.inc.php.

Referenced by CitationGridHandler\exportCitations(), index(), SetupHandler\saveSetup(), and SetupHandler\setup().

PKPHandler::getLastAuthorizationMessage ( )

Retrieve the last authorization message from the decision manager.

Returns
string

Definition at line 172 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 459 of file PKPHandler.inc.php.

References RestrictedSiteAccessPolicy\_getLoginExemptions().

& PKPHandler::getRangeInfo (   $rangeName,
  $contextData = null 
)

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

Parameters
$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
array ($pageNum, $dbResultRange)

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

References PKPRequest\getContext(), PKPRequest\getSession(), PKPRequest\getUserVar(), Config\getVar(), and hashPageContext().

Referenced by DOIExportPlugin\_displayArticleList(), DOIExportPlugin\_displayGalleyList(), DOIExportPlugin\_displayIssueList(), PKPAnnouncementHandler\announcements(), PKPAnnouncementHandler\announcementTypes(), IssueHandler\archive(), EditorHandler\assignEditor(), SearchHandler\authors(), IssueManagementHandler\backIssues(), LayoutEditorHandler\backIssues(), BooksForReviewAuthorHandler\booksForReview(), BooksForReviewEditorHandler\booksForReview(), AdminCategoriesHandler\categories(), PubIdImportExportPlugin\display(), DataciteExportPlugin\displaySuppFileList(), EmailHandler\emails(), PeopleHandler\enrollSearch(), SubmissionEditHandler\enrollSearch(), METSGatewayPlugin\fetch(), IssueManagementHandler\futureIssues(), LayoutEditorHandler\futureIssues(), GroupHandler\groupMembership(), GroupHandler\groups(), ReferralPlugin\handleAuthorTemplateInclude(), BrowseHandler\identifyTypes(), BooksForReviewHandler\index(), ObjectsForReviewHandler\index(), NotificationHandler\index(), PKPAnnouncementHandler\index(), ThesisHandler\index(), IndexHandler\index(), AuthorHandler\index(), CopyeditorHandler\index(), ProofreaderHandler\index(), ReviewerHandler\index(), EditorHandler\index(), SectionEditorHandler\index(), StaticPagesSettingsForm\initData(), AdminJournalHandler\journals(), ThesisPlugin\manage(), ExternalFeedPlugin\manage(), AdminPeopleHandler\mergeUsers(), PeopleHandler\mergeUsers(), ObjectsForReviewAuthorHandler\objectsForReview(), ObjectsForReviewEditorHandler\objectsForReview(), PeopleHandler\people(), ReviewFormHandler\reviewFormElements(), ReviewFormHandler\reviewForms(), ReviewObjectTypesEditorHandler\reviewObjectTypes(), SearchHandler\search(), BrowseHandler\sections(), SectionHandler\sections(), BooksForReviewEditorHandler\selectBookForReviewAuthor(), BooksForReviewEditorHandler\selectBookForReviewSubmission(), ObjectsForReviewEditorHandler\selectObjectForReviewAuthor(), ObjectsForReviewEditorHandler\selectObjectForReviewSubmission(), SubmissionEditHandler\selectReviewer(), SubmissionEditHandler\selectReviewForm(), SubscriptionAction\selectSubscriber(), PeopleHandler\showNoRole(), SubmissionEditHandler\submissionEmailLog(), SubmissionEditHandler\submissionEventLog(), SubmissionEditHandler\submissionHistory(), SubmissionEditHandler\submissionNotes(), LayoutEditorHandler\submissions(), EditorHandler\submissions(), SubscriptionAction\subscriptions(), SubscriptionAction\subscriptionTypes(), SearchHandler\titles(), and OJSPaymentAction\viewPayments().

PKPHandler::getRoleAssignment (   $roleId)

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

Returns
array assignment for the given role.

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

PKPHandler::getRoleAssignments ( )

This method returns an assignment of roles to operation names.

Returns
array assignments for all roles.

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

PKPHandler::hashPageContext (   $contextData = array())

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
$contextDataarray A set of information identifying the page
Returns
string hash

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

References Request\getRequestedContextPath(), PKPRequest\getRequestedOp(), and PKPRequest\getRequestedPage().

Referenced by getRangeInfo().

PKPHandler::index ( )

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

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

References getDispatcher(), and Dispatcher\handle404().

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 357 of file PKPHandler.inc.php.

References setId(), String\strtolower(), and String\substr().

PKPHandler::PKPHandler ( )

Constructor

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

PKPHandler::requireSSL ( )

Assume SSL is required for all handlers, unless overridden in subclasses.

Returns
boolean

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

Referenced by authorize().

PKPHandler::setDispatcher ( $dispatcher)

Set the dispatcher

Parameters
$dispatcherPKPDispatcher

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

PKPHandler::setId (   $id)

Set the controller id

Parameters
$idstring

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

Referenced by initialize().

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 312 of file PKPHandler.inc.php.

References Registry\get(), and Validation\redirectLogin().

Referenced by PluginManagementHandler\_deletePlugin(), PluginManagementHandler\_installPlugin(), PluginManagementHandler\_showDeleteForm(), PluginManagementHandler\_showInstallForm(), PluginManagementHandler\_showUpgradeForm(), PluginManagementHandler\_upgradePlugin(), PluginManagementHandler\_uploadPlugin(), AboutHandler\aboutThisPublishingSystem(), ReviewFormHandler\activateReviewForm(), PKPAnnouncementHandler\announcements(), PKPAnnouncementHandler\announcementTypes(), AuthSourcesHandler\auth(), SearchHandler\authors(), SearchHandler\categories(), SearchHandler\category(), PKPLoginHandler\changePassword(), AdminFunctionsHandler\clearDataCache(), AdminFunctionsHandler\clearTemplateCache(), AboutHandler\contact(), ReviewFormHandler\copyReviewForm(), ReviewFormHandler\copyReviewFormElement(), AuthSourcesHandler\createAuthSource(), SubscriptionManagerHandler\createUser(), ReviewFormHandler\deactivateReviewForm(), NotificationHandler\delete(), PKPAnnouncementHandler\deleteAnnouncement(), PKPAnnouncementHandler\deleteAnnouncementType(), AuthSourcesHandler\deleteAuthSource(), AdminJournalHandler\deleteJournal(), ReviewFormHandler\deleteReviewForm(), ReviewFormHandler\deleteReviewFormElement(), SectionHandler\deleteSection(), SubscriptionHandler\deleteSubscription(), SubscriptionManagerHandler\deleteSubscription(), SubscriptionHandler\deleteSubscriptionType(), SubscriptionManagerHandler\deleteSubscriptionType(), PeopleHandler\disableUser(), AboutHandler\displayMembership(), SetupHandler\downloadLayoutTemplate(), AdminLanguagesHandler\downloadLocale(), PKPAnnouncementHandler\editAnnouncement(), PKPAnnouncementHandler\editAnnouncementType(), AuthSourcesHandler\editAuthSource(), AdminJournalHandler\editJournal(), AboutHandler\editorialPolicies(), AboutHandler\editorialTeam(), AboutHandler\editorialTeamBio(), ReviewFormHandler\editReviewForm(), ReviewFormHandler\editReviewFormElement(), SectionHandler\editSection(), SubscriptionHandler\editSubscription(), SubscriptionManagerHandler\editSubscription(), SubscriptionHandler\editSubscriptionType(), SubscriptionManagerHandler\editSubscriptionType(), PeopleHandler\editUser(), ManagerHandler\email(), PeopleHandler\enableUser(), PeopleHandler\enroll(), PeopleHandler\enrollSearch(), PeopleHandler\enrollSync(), PeopleHandler\enrollSyncSelect(), AdminFunctionsHandler\expireSessions(), TranslatorHandler\export(), ReportGeneratorHandler\fetchArticlesInfo(), ReportGeneratorHandler\fetchRegions(), FilesHandler\fileDelete(), FilesHandler\fileMakeDir(), FilesHandler\files(), FilesHandler\fileUpload(), StatisticsHandler\generateReport(), AboutHandler\history(), PKPLoginHandler\implicitAuthReturn(), ImportExportHandler\importexport(), PKPLoginHandler\index(), NotificationHandler\index(), PKPAnnouncementHandler\index(), SwordHandler\index(), InformationHandler\index(), ThesisHandler\index(), AboutHandler\index(), AdminHandler\index(), IndexHandler\index(), ManagerHandler\index(), SearchHandler\index(), RTAdminHandler\index(), AdminLanguagesHandler\installLocale(), AdminJournalHandler\journals(), AboutHandler\journalSponsorship(), JournalLanguagesHandler\languages(), AdminLanguagesHandler\languages(), PKPLoginHandler\lostPassword(), PluginManagementHandler\managePlugins(), AboutHandler\memberships(), AdminPeopleHandler\mergeUsers(), PeopleHandler\mergeUsers(), AdminJournalHandler\moveJournal(), ReviewFormHandler\moveReviewForm(), ReviewFormHandler\moveReviewFormElement(), SectionHandler\moveSection(), SubscriptionHandler\moveSubscriptionType(), SubscriptionManagerHandler\moveSubscriptionType(), ManagerPaymentHandler\payments(), SubscriptionManagerHandler\payments(), ManagerPaymentHandler\payMethodSettings(), SubscriptionManagerHandler\payMethodSettings(), PeopleHandler\people(), AdminFunctionsHandler\phpinfo(), PluginHandler\plugin(), GatewayHandler\plugin(), PluginHandler\plugins(), ReviewFormHandler\previewReviewForm(), LuceneHandler\pullChangedArticles(), LuceneHandler\queryAutocomplete(), AdminLanguagesHandler\reloadLocale(), JournalLanguagesHandler\reloadLocalizedDefaultSettings(), PeopleHandler\removeUser(), SubscriptionHandler\renewSubscription(), SubscriptionManagerHandler\renewSubscription(), StatisticsHandler\report(), StatisticsHandler\reportGenerator(), PKPLoginHandler\requestResetPassword(), SubscriptionHandler\resetDateReminded(), SubscriptionManagerHandler\resetDateReminded(), PKPLoginHandler\resetPassword(), SetupHandler\resetPermissions(), ReviewFormHandler\reviewFormElements(), ReviewFormHandler\reviewForms(), ThesisHandler\save(), JournalLanguagesHandler\saveLanguageSettings(), AdminLanguagesHandler\saveLanguageSettings(), PKPLoginHandler\savePassword(), ManagerPaymentHandler\savePaymentSettings(), SubscriptionManagerHandler\savePaymentSettings(), ManagerPaymentHandler\savePayMethodSettings(), SubscriptionManagerHandler\savePayMethodSettings(), AdminSettingsHandler\saveSettings(), NotificationHandler\saveSettings(), SetupHandler\saveSetup(), NotificationHandler\saveSubscribeMailList(), SubscriptionHandler\saveSubscriptionPolicies(), SubscriptionManagerHandler\saveSubscriptionPolicies(), HelpHandler\search(), SearchHandler\search(), SectionHandler\sections(), SubscriptionHandler\selectSubscriber(), SubscriptionManagerHandler\selectSubscriber(), AdminSettingsHandler\settings(), NotificationHandler\settings(), SetupHandler\setup(), SetupHandler\setupSaved(), PeopleHandler\showNoRole(), PKPLoginHandler\signIn(), LoginHandler\signInAsUser(), PKPLoginHandler\signOut(), LoginHandler\signOutAsUser(), LuceneHandler\similarDocuments(), AboutHandler\siteMap(), StatisticsHandler\statistics(), AboutHandler\statistics(), AboutHandler\submissions(), ThesisHandler\submit(), SubscriptionHandler\subscriptionPolicies(), SubscriptionManagerHandler\subscriptionPolicies(), SubscriptionHandler\subscriptions(), SubscriptionManagerHandler\subscriptions(), AboutHandler\subscriptions(), SubscriptionHandler\subscriptionsSummary(), SubscriptionManagerHandler\subscriptionsSummary(), SubscriptionHandler\subscriptionTypes(), SubscriptionManagerHandler\subscriptionTypes(), PeopleHandler\suggestUsername(), SubscriptionManagerHandler\suggestUsername(), AdminFunctionsHandler\systemInfo(), SearchHandler\titles(), HelpHandler\toc(), PeopleHandler\unEnroll(), AdminLanguagesHandler\uninstallLocale(), PKPAnnouncementHandler\updateAnnouncement(), PKPAnnouncementHandler\updateAnnouncementType(), AuthSourcesHandler\updateAuthSource(), AuthSourcesHandler\updateAuthSources(), AdminJournalHandler\updateJournal(), ReviewFormHandler\updateReviewForm(), ReviewFormHandler\updateReviewFormElement(), SectionHandler\updateSection(), SubscriptionHandler\updateSubscription(), SubscriptionManagerHandler\updateSubscription(), SubscriptionHandler\updateSubscriptionType(), SubscriptionManagerHandler\updateSubscriptionType(), SubscriptionManagerHandler\updateUser(), PeopleHandler\updateUser(), SubscriptionManagerHandler\userProfile(), PeopleHandler\userProfile(), PKPAnnouncementHandler\view(), HelpHandler\view(), ThesisHandler\view(), ThesisHandler\viewCaptcha(), ManagerPaymentHandler\viewPayment(), SubscriptionManagerHandler\viewPayment(), ManagerPaymentHandler\viewPayments(), and SubscriptionManagerHandler\viewPayments().


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