Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
PKPRequest Class Reference
Inheritance diagram for PKPRequest:
Request Request

Public Member Functions

_checkThis ()
 
_delegateToRouter ($method)
 
 cleanUserVar (&$var)
 
 encodeBasePathFragment ($fragment)
 
 getBasePath ()
 
 getBaseUrl ()
 
 getCompleteUrl ()
 
getContext ()
 
 getCookieVar ($key)
 
getDispatcher ()
 
 getIfModifiedSince ()
 
 getIndexUrl ()
 
 getProtocol ()
 
 getQueryArray ()
 
 getQueryString ()
 
 getRemoteAddr ()
 
 getRemoteDomain ()
 
 getRequestedArgs ()
 
 getRequestedContextPath ($contextLevel=null)
 
 getRequestedOp ()
 
 getRequestedPage ()
 
 getRequestMethod ()
 
 getRequestPath ()
 
 getRequestUrl ()
 
getRouter ()
 
 getServerHost ($default= 'localhost')
 
getSession ()
 
getSite ()
 
getUser ()
 
 getUserAgent ()
 
 getUserDateVar ($prefix, $defaultDay=null, $defaultMonth=null, $defaultYear=null, $defaultHour=0, $defaultMinute=0, $defaultSecond=0)
 
 getUserVar ($key)
 
getUserVars ()
 
 isBot ()
 
 isGet ()
 
 isPathInfoEnabled ()
 
 isPost ()
 
 isRestfulUrlsEnabled ()
 
 redirect ($context=null, $page=null, $op=null, $path=null, $params=null, $anchor=null)
 
 redirectNonSSL ()
 
 redirectSSL ()
 
 redirectUrl ($url)
 
 redirectUrlJson ($url)
 
 setCookieVar ($key, $value)
 
 setDispatcher (&$dispatcher)
 
 setRouter (&$router)
 
 url ($context=null, $page=null, $op=null, $path=null, $params=null, $anchor=null, $escape=false)
 

Detailed Description

Class providing operations associated with HTTP requests.

Definition at line 17 of file PKPRequest.inc.php.

Member Function Documentation

& PKPRequest::_checkThis ( )
& PKPRequest::_delegateToRouter (   $method)

This method exists to maintain backwards compatibility with calls to methods that have been factored into the Router implementations.

It delegates the call to the router and returns the result.

NB: This method is protected and may not be used by external classes. It should also only be used in legacy methods.

Returns
mixed depends on the called method

Definition at line 776 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::cleanUserVar ( $var)

Sanitize a user-submitted variable (i.e., GET/POST/Cookie variable). Strips slashes if necessary, then sanitizes variable as per Core::cleanVar().

Parameters
$varmixed

Definition at line 609 of file PKPRequest.inc.php.

References _checkThis(), and Core\cleanVar().

PKPRequest::encodeBasePathFragment (   $fragment)

Callback function for getBasePath() to correctly encode (or not encode) a basepath fragment.

Parameters
string$fragment
Returns
string

Definition at line 192 of file PKPRequest.inc.php.

PKPRequest::getBasePath ( )

Get the base path of the request (excluding trailing slash).

Returns
string

Definition at line 161 of file PKPRequest.inc.php.

References _checkThis(), and HookRegistry\call().

PKPRequest::getCompleteUrl ( )

Get the complete URL to this page, including parameters.

Returns
string

Definition at line 221 of file PKPRequest.inc.php.

References _checkThis(), and HookRegistry\call().

Referenced by ThesisFeedGatewayPlugin\fetch(), and AnnouncementFeedGatewayPlugin\fetch().

& PKPRequest::getContext ( )

Deprecated

See Also
PKPPageRouter::getContext()

Definition at line 672 of file PKPRequest.inc.php.

References _checkThis().

Referenced by PKPHandler\getRangeInfo().

PKPRequest::getCookieVar (   $key)

Get the value of a cookie variable.

Returns
mixed

Definition at line 628 of file PKPRequest.inc.php.

References _checkThis().

Referenced by AppLocale\getLocale().

& PKPRequest::getDispatcher ( )

Get the dispatcher

Returns
Dispatcher

Definition at line 71 of file PKPRequest.inc.php.

PKPRequest::getIfModifiedSince ( )

Get the IF_MODIFIED_SINCE date (as a numerical timestamp) if available

Returns
int

Definition at line 130 of file PKPRequest.inc.php.

PKPRequest::getIndexUrl ( )
PKPRequest::getProtocol ( )

Get the protocol used for the request (HTTP or HTTPS).

Returns
string

Definition at line 331 of file PKPRequest.inc.php.

References _checkThis(), and HookRegistry\call().

PKPRequest::getQueryArray ( )

Get the complete set of URL parameters to the current request as an associative array.

Returns
array

Definition at line 274 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::getQueryString ( )

Get the complete set of URL parameters to the current request.

Returns
string

Definition at line 257 of file PKPRequest.inc.php.

References _checkThis(), and HookRegistry\call().

PKPRequest::getRemoteAddr ( )
PKPRequest::getRemoteDomain ( )

Get the remote domain of the current request

Returns
string

Definition at line 403 of file PKPRequest.inc.php.

References _checkThis(), and HookRegistry\call().

Referenced by SubscriptionBlockPlugin\getContents(), and IssueAction\subscribedDomain().

PKPRequest::getRequestedArgs ( )
PKPRequest::getRequestedContextPath (   $contextLevel = null)

Deprecated

See Also
PKPPageRouter::getRequestedContextPath()

Definition at line 681 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::getRequestMethod ( )

Get the request method

Returns
string

Definition at line 345 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::getRequestPath ( )

Get the completed path of the request.

Returns
string

Definition at line 291 of file PKPRequest.inc.php.

References _checkThis(), and HookRegistry\call().

PKPRequest::getRequestUrl ( )

Get the complete URL of the request.

Returns
string

Definition at line 240 of file PKPRequest.inc.php.

References _checkThis(), and HookRegistry\call().

Referenced by ArticleHTMLGalley\getHTMLContents().

& PKPRequest::getRouter ( )

get the router instance

Returns
PKPRouter

Definition at line 47 of file PKPRequest.inc.php.

PKPRequest::getServerHost (   $default = 'localhost')

Get the server hostname in the request. May optionally include the port number if non-standard.

Returns
string

Definition at line 314 of file PKPRequest.inc.php.

References _checkThis(), and HookRegistry\call().

Referenced by InstallForm\initData(), and SMTPMailer\mail().

& PKPRequest::getSession ( )

Get the user session associated with the current request.

Returns
Session

Definition at line 499 of file PKPRequest.inc.php.

References _checkThis(), Registry\get(), and SessionManager\getManager().

Referenced by CaptchaManager\createCaptcha(), PeopleHandler\enrollSearch(), PKPHandler\getRangeInfo(), ManagerHandler\index(), and PeopleHandler\people().

& PKPRequest::getUser ( )

Get the user associated with the current request.

Returns
User

Definition at line 516 of file PKPRequest.inc.php.

References _checkThis(), Registry\get(), and SessionManager\getManager().

Referenced by CounterReportPlugin\_assignTemplateCounterXML(), PKPMailTemplate\_handleAttachments(), IssueAction\_roleAllowedPrePublicationAccess(), IssueAction\allowedPrePublicationAccess(), ChangePasswordForm\ChangePasswordForm(), CommentForm\CommentForm(), DOAJPlugin\contact(), Action\deleteComment(), ProfileForm\deleteProfileImage(), PeopleHandler\disableUser(), ChangePasswordForm\display(), ProfileForm\display(), CommentForm\display(), PKPMailTemplate\displayEditForm(), ManualPaymentPlugin\displayPaymentForm(), EditCommentForm\EditCommentForm(), ManagerHandler\email(), PeopleHandler\enableUser(), PeopleHandler\enrollSearch(), ChangePasswordForm\execute(), CommentForm\execute(), ProfileForm\execute(), BookForReviewForm\execute(), RoleBlockPlugin\getBlockTemplateFilename(), ReferralPlugin\handleAuthorTemplateInclude(), RTAdminHandler\index(), CommentForm\initData(), HandlerValidatorSubmissionComment\isValid(), MailTemplate\MailTemplate(), AdminPeopleHandler\mergeUsers(), PeopleHandler\mergeUsers(), MetadataForm\MetadataForm(), PeopleHandler\people(), PKPMailTemplate\PKPMailTemplate(), ProfileForm\ProfileForm(), ProofreaderAction\proofreadEmail(), PeopleHandler\removeUser(), ProofreaderAction\selectProofreader(), PKPMailTemplate\send(), PeopleHandler\showNoRole(), AboutHandler\siteMap(), SubmissionEditHandler\submissionEditing(), IssueAction\subscribedUser(), and SectionEditorHandler\validate().

PKPRequest::getUserAgent ( )

Get the user agent of the current request.

Returns
string

Definition at line 419 of file PKPRequest.inc.php.

References _checkThis(), and HookRegistry\call().

PKPRequest::getUserDateVar (   $prefix,
  $defaultDay = null,
  $defaultMonth = null,
  $defaultYear = null,
  $defaultHour = 0,
  $defaultMinute = 0,
  $defaultSecond = 0 
)

Get the value of a GET/POST variable generated using the Smarty html_select_date and/or html_select_time function.

Parameters
$prefixstring
$defaultDayint
$defaultMonthint
$defaultYearint
$defaultHourint
$defaultMinuteint
$defaultSecondint
Returns
Date

Definition at line 573 of file PKPRequest.inc.php.

References _checkThis().

Referenced by SubscriptionForm\readInputData(), Form\readUserDateVars(), and SubscriptionAction\subscriptions().

PKPRequest::getUserVar (   $key)

Get the value of a GET/POST variable.

Returns
mixed

Definition at line 533 of file PKPRequest.inc.php.

References _checkThis().

Referenced by PKPMailTemplate\_clearAttachments(), SubmissionEditHandler\_getFrom(), PKPMailTemplate\_handleAttachments(), GroupHandler\addMembership(), EditorHandler\assignEditor(), ReviewFormHandler\copyReviewFormElement(), MetsExportDom\createmetsamdSec(), MetsExportDom\createmetsHdr(), ReviewerAction\deleteReviewerVersion(), PeopleHandler\disableUser(), UserManagementForm\display(), SuppFileForm\display(), RegistrationForm\display(), PKPMailTemplate\displayEditForm(), SubscriptionAction\editSubscription(), SubscriptionAction\editSubscriptionType(), ManagerHandler\email(), PeopleHandler\enroll(), PeopleHandler\enrollSearch(), PeopleHandler\enrollSync(), CommentForm\execute(), SectionForm\execute(), ProfileForm\execute(), MetsExportDom\generateArticleFileDom(), MetsExportDom\generateArticleSuppFileDom(), Form\getFormLocale(), AppLocale\getLocale(), PKPHandler\getRangeInfo(), ReferralPlugin\handleAuthorTemplateInclude(), BrowseHandler\identifyTypes(), ThesisHandler\index(), IndexHandler\index(), XMLGalleySettingsForm\initData(), PayMethodSettingsForm\initData(), UserManagementForm\initData(), Form\isLocaleResubmit(), MailTemplate\MailTemplate(), PubIdPlugin\manage(), CustomBlockManagerPlugin\manage(), StaticPagesPlugin\manage(), AbntCitationPlugin\manage(), PiwikPlugin\manage(), LucenePlugin\manage(), AdminPeopleHandler\mergeUsers(), PeopleHandler\mergeUsers(), GroupHandler\moveGroup(), GroupHandler\moveMembership(), ReviewFormHandler\moveReviewForm(), SubscriptionAction\moveSubscriptionType(), PeopleHandler\people(), PKPMailTemplate\PKPMailTemplate(), ProofreaderAction\proofreadEmail(), SectionForm\readInputData(), Form\readUserVars(), RegistrationForm\RegistrationForm(), BrowseHandler\sections(), SubmissionEditHandler\selectProofreader(), SubscriptionAction\selectSubscriber(), BooksForReviewEditorHandler\setupTemplate(), StatisticsHandler\statistics(), AboutHandler\statistics(), SubscriptionAction\subscriptions(), PeopleHandler\suggestUsername(), SubscriptionManagerHandler\suggestUsername(), AdminFunctionsHandler\systemInfo(), PeopleHandler\unEnroll(), EmailHandler\updateEmail(), GroupHandler\updateGroup(), ReferralHandler\updateReferral(), ReviewFormHandler\updateReviewForm(), ReviewFormHandler\updateReviewFormElement(), SubscriptionHandler\updateSubscription(), SubscriptionManagerHandler\updateSubscription(), SubscriptionAction\updateSubscription(), SubscriptionHandler\updateSubscriptionType(), SubscriptionManagerHandler\updateSubscriptionType(), SubscriptionAction\updateSubscriptionType(), and SubscriptionManagerHandler\updateUser().

& PKPRequest::getUserVars ( )

Get all GET/POST variables as an array

Returns
array

Definition at line 550 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::isBot ( )

Determine whether the user agent is a bot or not.

Returns
boolean

Definition at line 442 of file PKPRequest.inc.php.

References _checkThis(), and Core\isUserAgentBot().

PKPRequest::isGet ( )

Determine whether the request is a GET request

Returns
boolean

Definition at line 366 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::isPathInfoEnabled ( )

Return true if PATH_INFO is enabled.

Definition at line 456 of file PKPRequest.inc.php.

References _checkThis(), and Config\getVar().

Referenced by OAI\checkParams().

PKPRequest::isPost ( )

Determine whether the request is a POST request

Returns
boolean

Definition at line 356 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::isRestfulUrlsEnabled ( )

Return true if RESTFUL_URLS is enabled.

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

References _checkThis(), and Config\getVar().

PKPRequest::redirect (   $context = null,
  $page = null,
  $op = null,
  $path = null,
  $params = null,
  $anchor = null 
)

Redirect to the specified page within a PKP Application. Shorthand for a common call to $request->redirect($dispatcher->url($request, ROUTE_PAGE, ...)).

Parameters
$contextArray The optional contextual paths
$pagestring The name of the op to redirect to.
$opstring optional The name of the op to redirect to.
$pathmixed string or array containing path info for redirect.
$paramsarray Map of name => value pairs for additional parameters
$anchorstring Name of desired anchor on the target page

Definition at line 662 of file PKPRequest.inc.php.

References _checkThis().

Referenced by SubmissionEditHandler\_uploadGalley(), ReviewFormHandler\activateReviewForm(), GroupHandler\addMembership(), EditorHandler\assignEditor(), WebFeedPlugin\callbackHandleShortURL(), AdminFunctionsHandler\clearDataCache(), AdminFunctionsHandler\clearTemplateCache(), ReviewFormHandler\copyReviewForm(), ReviewFormHandler\copyReviewFormElement(), ReviewFormHandler\deactivateReviewForm(), EmailHandler\deleteCustomEmail(), GroupHandler\deleteGroup(), GroupHandler\deleteMembership(), ReviewFormHandler\deleteReviewForm(), ReviewFormHandler\deleteReviewFormElement(), SubscriptionHandler\deleteSubscription(), SubscriptionManagerHandler\deleteSubscription(), SubscriptionHandler\deleteSubscriptionType(), SubscriptionManagerHandler\deleteSubscriptionType(), EmailHandler\disableEmail(), PeopleHandler\disableUser(), UsageStatsReportPlugin\display(), AboutHandler\displayMembership(), GroupHandler\editGroup(), AboutHandler\editorialTeamBio(), ReviewFormHandler\editReviewForm(), ReviewFormHandler\editReviewFormElement(), SubscriptionHandler\editSubscription(), SubscriptionManagerHandler\editSubscription(), SubscriptionHandler\editSubscriptionType(), SubscriptionManagerHandler\editSubscriptionType(), ManagerHandler\email(), EmailHandler\enableEmail(), PeopleHandler\enableUser(), PeopleHandler\enroll(), PeopleHandler\enrollSync(), AdminFunctionsHandler\expireSessions(), TranslatorHandler\export(), ResolverPlugin\fetch(), ThesisHandler\index(), InformationHandler\index(), HandlerValidatorSubmissionComment\isValid(), PubIdPlugin\manage(), StaticPagesPlugin\manage(), AbntCitationPlugin\manage(), ImportExportPlugin\manage(), PiwikPlugin\manage(), ReportPlugin\manage(), LucenePlugin\manage(), AdminPeopleHandler\mergeUsers(), PeopleHandler\mergeUsers(), GroupHandler\moveGroup(), GroupHandler\moveMembership(), ReviewFormHandler\moveReviewForm(), SubscriptionHandler\moveSubscriptionType(), SubscriptionManagerHandler\moveSubscriptionType(), PeopleHandler\people(), ReviewFormHandler\previewReviewForm(), ProofreaderAction\proofreadEmail(), Validation\redirectLogin(), PeopleHandler\removeUser(), SubscriptionHandler\renewSubscription(), SubscriptionManagerHandler\renewSubscription(), StatisticsHandler\report(), EmailHandler\resetAllEmails(), EmailHandler\resetEmail(), ReviewFormHandler\reviewFormElements(), ThesisHandler\save(), SubscriptionHandler\selectSubscriber(), SubscriptionManagerHandler\selectSubscriber(), ThesisHandler\submit(), SubscriptionHandler\subscriptions(), SubscriptionManagerHandler\subscriptions(), PeopleHandler\unEnroll(), EmailHandler\updateEmail(), GroupHandler\updateGroup(), ReferralHandler\updateReferral(), ReviewFormHandler\updateReviewForm(), ReviewFormHandler\updateReviewFormElement(), SubscriptionHandler\updateSubscription(), SubscriptionManagerHandler\updateSubscription(), SubscriptionHandler\updateSubscriptionType(), SubscriptionManagerHandler\updateSubscriptionType(), SubscriptionManagerHandler\updateUser(), SectionEditorHandler\validate(), GroupHandler\validate(), IssueManagementHandler\validate(), ThesisHandler\view(), and ThesisHandler\viewCaptcha().

PKPRequest::redirectNonSSL ( )

Redirect to the current URL, forcing the HTTP protocol to be used.

Definition at line 117 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::redirectSSL ( )

Redirect to the current URL, forcing the HTTPS protocol to be used.

Definition at line 105 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::redirectUrl (   $url)

Perform an HTTP redirect to an absolute or relative (to base system URL) URL.

Parameters
$urlstring (exclude protocol for local redirects)

Definition at line 80 of file PKPRequest.inc.php.

References _checkThis(), and HookRegistry\call().

Referenced by DOAJPlugin\contact(), and SubscriptionManagerHandler\updateUser().

PKPRequest::redirectUrlJson (   $url)

Request an HTTP redirect via JSON to be used from components.

Parameters
$urlstring

Definition at line 95 of file PKPRequest.inc.php.

PKPRequest::setCookieVar (   $key,
  $value 
)

Set a cookie variable.

Parameters
$keystring
$valuemixed

Definition at line 645 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::setDispatcher ( $dispatcher)

Set the dispatcher

Parameters
$dispatcherDispatcher

Definition at line 63 of file PKPRequest.inc.php.

PKPRequest::setRouter ( $router)

set the router instance

Parameters
$routerinstance PKPRouter

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

PKPRequest::url (   $context = null,
  $page = null,
  $op = null,
  $path = null,
  $params = null,
  $anchor = null,
  $escape = false 
)

Deprecated

See Also
PKPPageRouter::url()

Definition at line 724 of file PKPRequest.inc.php.

References _checkThis().


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