Open Journal Systems  2.4.8
 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=null, $includePort=true)
 
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, $expire=0)
 
 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 808 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 637 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 200 of file PKPRequest.inc.php.

PKPRequest::getBasePath ( )

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

Returns
string

Definition at line 165 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 229 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 704 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 656 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 134 of file PKPRequest.inc.php.

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

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

Returns
string

Definition at line 358 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. (Excludes reserved parameters, such as "path", which are used by disable_path_info mode.)

Returns
array

Definition at line 284 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 265 of file PKPRequest.inc.php.

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

PKPRequest::getRemoteDomain ( )

Get the remote domain of the current request

Returns
string

Definition at line 431 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 713 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::getRequestMethod ( )

Get the request method

Returns
string

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

References _checkThis().

PKPRequest::getRequestPath ( )

Get the completed path of the request.

Returns
string

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

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

PKPRequest::getRequestUrl ( )

Get the complete URL of the request.

Returns
string

Definition at line 248 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 = null,
  $includePort = true 
)

Get the server hostname in the request.

Parameters
$defaultstring Default hostname (defaults to localhost)
$includePortboolean Whether to include non-standard port number; default true
Returns
string

Definition at line 330 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 527 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 544 of file PKPRequest.inc.php.

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

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

PKPRequest::getUserAgent ( )

Get the user agent of the current request.

Returns
string

Definition at line 447 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 601 of file PKPRequest.inc.php.

References _checkThis().

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

PKPRequest::getUserVar (   $key)

Get the value of a GET/POST variable.

Returns
mixed

Definition at line 561 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(), PubIdPlugin\editIssue(), 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(), AnnouncementFeedPlugin\manage(), ThesisFeedPlugin\manage(), CustomThemePlugin\manage(), PhpMyVisitesPlugin\manage(), BrowsePlugin\manage(), WebFeedPlugin\manage(), DataversePlugin\manage(), ThesisPlugin\manage(), StopForumSpamPlugin\manage(), PiwikPlugin\manage(), XMLGalleyPlugin\manage(), GoogleAnalyticsPlugin\manage(), LucenePlugin\manage(), SwordPlugin\manage(), ExternalFeedPlugin\manage(), PLNPlugin\manage(), AdminPeopleHandler\mergeUsers(), PeopleHandler\mergeUsers(), GroupHandler\moveGroup(), GroupHandler\moveMembership(), ReviewFormHandler\moveReviewForm(), SubscriptionAction\moveSubscriptionType(), PeopleHandler\people(), PKPMailTemplate\PKPMailTemplate(), ProofreaderAction\proofreadEmail(), PLNSettingsForm\readInputData(), SectionForm\readInputData(), Form\readUserVars(), RegistrationForm\RegistrationForm(), SubscriptionAction\resetDateReminded(), BrowseHandler\sections(), SubmissionEditHandler\selectProofreader(), SubscriptionAction\selectSubscriber(), BooksForReviewEditorHandler\setupTemplate(), 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 578 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::isBot ( )

Determine whether the user agent is a bot or not.

Returns
boolean

Definition at line 470 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 393 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::isPathInfoEnabled ( )

Return true if PATH_INFO is enabled.

Definition at line 484 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 383 of file PKPRequest.inc.php.

References _checkThis().

PKPRequest::isRestfulUrlsEnabled ( )

Return true if RESTFUL_URLS is enabled.

Definition at line 496 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 694 of file PKPRequest.inc.php.

References _checkThis().

Referenced by SubmissionEditHandler\_uploadGalley(), ReviewFormHandler\activateReviewForm(), GroupHandler\addMembership(), EditorHandler\assignEditor(), WebFeedPlugin\callbackHandleShortURL(), AdminFunctionsHandler\clearDataCache(), AdminFunctionsHandler\clearScheduledTaskLogFiles(), 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(), TranslatorPlugin\manage(), PubIdPlugin\manage(), StaticPagesPlugin\manage(), AbntCitationPlugin\manage(), ThesisFeedPlugin\manage(), ImportExportPlugin\manage(), CustomThemePlugin\manage(), PhpMyVisitesPlugin\manage(), BrowsePlugin\manage(), WebFeedPlugin\manage(), DataversePlugin\manage(), ThesisPlugin\manage(), StopForumSpamPlugin\manage(), PiwikPlugin\manage(), GoogleAnalyticsPlugin\manage(), ReportPlugin\manage(), LucenePlugin\manage(), SwordPlugin\manage(), ExternalFeedPlugin\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(), SubscriptionHandler\resetDateReminded(), SubscriptionManagerHandler\resetDateReminded(), 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 119 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 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,
  $expire = 0 
)

Set a cookie variable.

Parameters
$keystring
$valuemixed
$expireint (optional)

Definition at line 674 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 756 of file PKPRequest.inc.php.

References _checkThis().


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