MyResearchController
extends AbstractBase
in package
Uses
BulkActionControllerTrait, CatchIlsExceptionsTrait, SummaryTrait, ListItemSelectionTrait
Controller for the user account area.
Tags
Table of Contents
- $accessDeniedBehavior : string
- Behavior when access is denied (used unless overridden through permissionBehavior.ini). Valid values are 'promptLogin' and 'exception'.
- $accessPermission : string|bool
- Permission that must be granted to access this module (false for no restriction, null to use configured default (which is usually the same as false)).
- $configLoader : PluginManager
- Configuration loader
- $export : Export
- Export support class
- $ilsExceptionResponse : mixed
- Optional custom exception response
- $paginationHelper : PaginationHelper
- ILS Pagination Helper
- $serviceLocator : ContainerInterface
- Service manager
- $session : Container
- Session container
- $translator : TranslatorInterface
- Translator
- __construct() : mixed
- Constructor
- accountAction() : mixed
- "Create account" action
- addAccountBlocksToFlashMessenger() : void
- Add account blocks to the flash messenger as errors.
- captcha() : Captcha
- catalogloginAction() : mixed
- Catalog Login Action
- changeEmailAction() : mixed
- Handling submission of a new email for a user.
- changePasswordAction() : mixed
- Handling submission of a new password for a user.
- checkedoutAction() : mixed
- Send list of checked out books to view
- completeLoginAction() : mixed
- Complete login - perform a user login followed by a catalog login.
- confirm() : mixed
- Confirm an action.
- dbUpgrade() : DbUpgrade
- deleteAccountAction() : mixed
- Account deletion
- deleteAction() : mixed
- Delete group of records from favorites.
- deletelistAction() : mixed
- Creates a confirmation box to delete or not delete the current list
- deleteLoginTokenAction() : mixed
- Delete a login token
- deleteUserLoginTokensAction() : mixed
- Delete all login tokens for a user
- editAction() : mixed
- Edit record
- editlistAction() : mixed
- Send user's saved favorites from a particular list to the edit view
- emailNotVerifiedAction() : mixed
- Creates a message that the verification email has been sent to the user's mail address.
- favoritesAction() : mixed
- Action for sending all of a user's saved favorites to the view
- finesAction() : mixed
- Send list of fines to view
- flashMessenger() : FlashMessenger
- followup() : Followup
- forceLogin() : mixed
- Redirect the user to the login screen.
- forwardTo() : mixed
- Convenience method to make invocation of forward() helper less verbose.
- getAccessPermission() : string|bool|null
- Getter for access permission (string for required permission name, false for no permission required, null to use default permission).
- getConfig() : Config
- Get a VuFind configuration.
- getDbService() : T
- Get a database service object.
- getILS() : Connection
- Get the ILS connection.
- getRecordCache() : Cache
- Get the record cache
- getRecordLoader() : Loader
- Get the record loader
- getRecordRouter() : Router
- Get the record router.
- getRequest() : Request
- Get request object
- getSearchMemory() : Memory
- Get the search memory
- getServerUrl() : string
- Get the full URL to one of VuFind's routes.
- getService() : T
- Retrieve a service
- getTable() : Gateway
- Get a database table object.
- getTranslator() : TranslatorInterface
- Get translator object.
- getTranslatorLocale() : string
- Get the locale from the translator.
- historicloansAction() : mixed
- Send list of historic loans to view
- holds() : Holds
- holdsAction() : mixed
- Send list of holds to view
- homeAction() : mixed
- Prepare and direct the home page where it needs to go
- ILLRequests() : ILLRequests
- illRequestsAction() : mixed
- Send list of ill requests to view
- ilsRecords() : IlsRecords
- loginAction() : mixed
- Login Action
- logoutAction() : mixed
- Logout Action
- mylistAction() : mixed
- Send user's saved favorites from a particular list to the view
- newItems() : NewItems
- newPasswordAction() : mixed
- Handling submission of a new password for a user.
- onDispatch() : mixed
- Execute the request
- performDeleteFavorite() : mixed
- Delete record
- permission() : Permission
- profileAction() : mixed
- Gather user profile data
- recoverAction() : mixed
- Send account recovery email
- redirectToSource() : mixed
- Support method: redirect to the page we were on when the bulk action was initiated.
- renewals() : Renewals
- reserves() : Reserves
- resultScroller() : ResultScroller
- savesearchAction() : mixed
- Handle 'save/unsave search' request
- schedulesearchAction() : mixed
- Handle search subscription request
- setAccessPermission() : void
- Getter for access permission.
- setTranslator() : TranslatorAwareInterface
- Set a translator
- storageRetrievalRequests() : StorageRetrievalRequests
- storageRetrievalRequestsAction() : mixed
- Send list of storage retrieval requests to view
- translate() : string
- Translate a string (or string-castable object)
- translateWithPrefix() : string
- Translate a string (or string-castable object) using a prefix, or without the prefix if a prefixed translation is not found.
- unsubscribeAction() : mixed
- Unsubscribe a scheduled alert for a saved search.
- userloginAction() : mixed
- User login action -- clear any previous follow-up information prior to triggering a login process. This is used for explicit login links within the UI to differentiate them from contextual login links that are triggered by attempting to access protected actions.
- validateAccessPermission() : void
- Use preDispatch event to block access when appropriate.
- verifyAction() : mixed
- Receive a hash and display the new password form if it's valid
- verifyEmailAction() : mixed
- Receive a hash and display the new password form if it's valid
- addPendingEmailChangeMessage() : void
- Add a message about any pending email change to the flash messenger
- attachDefaultListeners() : void
- Register the default events for this controller
- catalogLogin() : bool|array<string|int, mixed>|ViewModel
- Does the user have catalog credentials available? Returns associative array of patron data if so, otherwise forwards to appropriate login prompt and returns false. If there is an ILS exception, a flash message is added and a newly created ViewModel is returned.
- clearFollowupUrl() : void
- Sometimes we need to unset the followup to trigger default behaviors
- commentsEnabled() : bool
- Are comments enabled?
- confirmDeleteFavorite() : mixed
- Confirm a request to delete a favorite item.
- createEmailViewModel() : ViewModel
- Create a new ViewModel to use as an email form.
- createViewModel() : ViewModel
- Create a new ViewModel.
- disableSessionWrites() : void
- Prevent session writes -- this is designed to be called prior to time- consuming AJAX operations to help reduce the odds of a timing-related bug that causes the wrong version of session data to be written to disk (see VUFIND-716 for more details).
- extractTextDomain() : array<string|int, mixed>
- Given a translation string with or without a text domain, return an array with the raw string and the text domain separated.
- formWasSubmitted() : bool
- Check to see if a form was submitted from its post value Also validate the Captcha, if it's activated
- getAndClearFollowupUrl() : string
- Retrieve a referer to keep post-login redirect pointing to an appropriate location.
- getAuthManager() : Manager
- Get the account manager object.
- getAuthorizationService() : AuthorizationService
- Get the authorization service (note that we're doing this on-demand rather than through injection with the AuthorizationServiceAwareInterface to minimize expensive initialization when authorization is not needed.
- getDebugTranslation() : string
- Build a debug-mode translation
- getFineSummary() : array<string|int, mixed>
- Get a status summary for an array of fines
- getHashAge() : int
- Helper function for verification hashes
- getILSAuthenticator() : ILSAuthenticator
- Get the ILS authenticator.
- getILSLoginMethod() : string
- What login method does the ILS use (password, email, vufind)
- getILSLoginSettings() : array<string|int, mixed>
- Get settings required for displaying the catalog login form
- getPaginationHelper() : PaginationHelper
- Get the ILS pagination helper
- getRecordTabManager() : TabManager
- Get the tab configuration for this controller.
- getRefreshResponse() : Response
- Construct an HTTP 205 (refresh) response. Useful for reporting success in the lightbox without actually rendering content.
- getRequestSummary() : array<string|int, mixed>
- Get a status summary for an array of requests
- getSearchRowSecurely() : SearchEntityInterface
- Get a search row, but throw an exception if it is not owned by the specified user or current active session.
- getSelectedIds() : array<string|int, mixed>
- Get selected ids
- getSessionInitiator() : string|bool
- Convenience method to get a session initiator URL. Returns false if not applicable.
- getTransactionSummary() : array<string|int, mixed>
- Get a status summary for an array of checkouts
- getUser() : UserEntityInterface|null
- Get the user object if logged in, false otherwise.
- getUserVerificationContainer() : Container
- Return a session container for use in user email verification.
- getViewRenderer() : RendererInterface
- Get the view renderer
- hasFollowupUrl() : bool
- Checks if a followup url is set
- inLightbox() : bool
- Are we currently in a lightbox context?
- isDuplicateOfSavedSearch() : int|null
- Is the provided search row a duplicate of a search that is already saved?
- isLocalUrl() : bool
- Is the provided URL local to this instance?
- listsEnabled() : bool
- Are lists enabled?
- listTagsEnabled() : bool
- Are list tags enabled?
- normalizeUrlForComparison() : string
- Normalize the referer URL so that inconsistencies in protocol and trailing slashes do not break comparisons.
- processAuthenticationException() : void
- Process an authentication error.
- processEditList() : object|bool
- Process the "edit list" submission.
- processEditSubmit() : object
- Process the submission of the edit favorite form.
- resetNewPasswordForm() : ViewModel
- Reset the new password form and return the modified view. When a user has already been loaded from an existing hash, this resets the hash and updates the form so that the user can try again.
- sanitizeTranslationKey() : string
- Make sure there are not any illegal characters in the translation key that might prevent successful lookup in language files.
- scheduleSearch() : mixed
- Support method for savesearchAction() -- schedule a search.
- sendChangeNotificationEmail() : void
- When a request to change a user's email address has been received, we should send a notification to the old email address for the user's information.
- sendFirstVerificationEmail() : void
- Send a verify email message for the first time (only if the user does not already have a hash).
- sendRecoveryEmail() : void
- Helper function for recoverAction
- sendVerificationEmail() : void
- Send a verify email message.
- setFollowupUrlToReferer() : void
- Store a referer (if appropriate) to keep post-login redirect pointing to an appropriate location. This is used when the user clicks the log in link from an arbitrary page or when a password is mistyped; separate logic is used for storing followup information when VuFind forces the user to log in from another context.
- setSavedFlagSecurely() : void
- Support method for savesearchAction(): set the saved flag in a secure fashion, throwing an exception if somebody attempts something invalid.
- setUpAuthenticationFromRequest() : void
- Configure the authentication manager to use a user-specified method.
- storeRefererForPostLoginRedirect() : void
- Maintaining this method for backwards compatibility; logic moved to parent and method re-named
- tagsEnabled() : bool
- Are tags enabled?
- translateString() : string
- Get translation for a string
Properties
$accessDeniedBehavior
Behavior when access is denied (used unless overridden through permissionBehavior.ini). Valid values are 'promptLogin' and 'exception'.
protected
string
$accessDeniedBehavior
= null
Leave at null to use the defaultDeniedControllerBehavior set in permissionBehavior.ini (normally 'promptLogin' unless changed).
$accessPermission
Permission that must be granted to access this module (false for no restriction, null to use configured default (which is usually the same as false)).
protected
string|bool
$accessPermission
= false
For this controller, we default to false rather than null because we don't want a default setting to override the controller's accessibility and break the login process!
$configLoader
Configuration loader
protected
PluginManager
$configLoader
$export
Export support class
protected
Export
$export
$ilsExceptionResponse
Optional custom exception response
protected
mixed
$ilsExceptionResponse
= null
If set, this is returned on exception instead of a default ViewModel
$paginationHelper
ILS Pagination Helper
protected
PaginationHelper
$paginationHelper
= null
$serviceLocator
Service manager
protected
ContainerInterface
$serviceLocator
$session
Session container
protected
Container
$session
$translator
Translator
protected
TranslatorInterface
$translator
= null
Methods
__construct()
Constructor
public
__construct(ServiceLocatorInterface $sm, Container $container, PluginManager $configLoader, Export $export) : mixed
Parameters
- $sm : ServiceLocatorInterface
-
Service locator
- $container : Container
-
Session container
- $configLoader : PluginManager
-
Configuration loader
- $export : Export
-
Export support class
Return values
mixed —accountAction()
"Create account" action
public
accountAction() : mixed
Return values
mixed —addAccountBlocksToFlashMessenger()
Add account blocks to the flash messenger as errors.
public
addAccountBlocksToFlashMessenger(Connection $catalog, array<string|int, mixed> $patron) : void
These messages are lightbox ignored.
Parameters
- $catalog : Connection
-
Catalog connection
- $patron : array<string|int, mixed>
-
Patron details
Return values
void —captcha()
public
captcha() : Captcha
Captcha plugin
Return values
Captcha —catalogloginAction()
Catalog Login Action
public
catalogloginAction() : mixed
Return values
mixed —changeEmailAction()
Handling submission of a new email for a user.
public
changeEmailAction() : mixed
Return values
mixed —changePasswordAction()
Handling submission of a new password for a user.
public
changePasswordAction() : mixed
Return values
mixed —checkedoutAction()
Send list of checked out books to view
public
checkedoutAction() : mixed
Return values
mixed —completeLoginAction()
Complete login - perform a user login followed by a catalog login.
public
completeLoginAction() : mixed
Return values
mixed —confirm()
Confirm an action.
public
confirm(string $title, string $yesTarget, string $noTarget[, string|array<string|int, mixed> $messages = [] ][, array<string|int, mixed> $extras = [] ]) : mixed
Parameters
- $title : string
-
Title of confirm dialog
- $yesTarget : string
-
Form target for "confirm" action
- $noTarget : string
-
Form target for "cancel" action
- $messages : string|array<string|int, mixed> = []
-
Info messages for confirm dialog
- $extras : array<string|int, mixed> = []
-
Extra details to include in form
Return values
mixed —dbUpgrade()
public
dbUpgrade() : DbUpgrade
DbUpgrade plugin
Return values
DbUpgrade —deleteAccountAction()
Account deletion
public
deleteAccountAction() : mixed
Return values
mixed —deleteAction()
Delete group of records from favorites.
public
deleteAction() : mixed
Return values
mixed —deletelistAction()
Creates a confirmation box to delete or not delete the current list
public
deletelistAction() : mixed
Return values
mixed —deleteLoginTokenAction()
Delete a login token
public
deleteLoginTokenAction() : mixed
Return values
mixed —deleteUserLoginTokensAction()
Delete all login tokens for a user
public
deleteUserLoginTokensAction() : mixed
Return values
mixed —editAction()
Edit record
public
editAction() : mixed
Return values
mixed —editlistAction()
Send user's saved favorites from a particular list to the edit view
public
editlistAction() : mixed
Return values
mixed —emailNotVerifiedAction()
Creates a message that the verification email has been sent to the user's mail address.
public
emailNotVerifiedAction() : mixed
Return values
mixed —favoritesAction()
Action for sending all of a user's saved favorites to the view
public
favoritesAction() : mixed
Return values
mixed —finesAction()
Send list of fines to view
public
finesAction() : mixed
Return values
mixed —flashMessenger()
public
flashMessenger() : FlashMessenger
FlashMessenger plugin
Return values
FlashMessenger —followup()
public
followup() : Followup
Followup plugin
Return values
Followup —forceLogin()
Redirect the user to the login screen.
public
forceLogin([string $msg = null ][, array<string|int, mixed> $extras = [] ][, bool $forward = true ]) : mixed
Parameters
- $msg : string = null
-
Flash message to display on login screen
- $extras : array<string|int, mixed> = []
-
Associative array of extra fields to store
- $forward : bool = true
-
True to forward, false to redirect
Return values
mixed —forwardTo()
Convenience method to make invocation of forward() helper less verbose.
public
forwardTo(string $controller, string $action[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
- $controller : string
-
Controller to invoke
- $action : string
-
Action to invoke
- $params : array<string|int, mixed> = []
-
Extra parameters for the RouteMatch object (no need to provide action here, since $action takes care of that)
Return values
mixed —getAccessPermission()
Getter for access permission (string for required permission name, false for no permission required, null to use default permission).
public
getAccessPermission() : string|bool|null
Return values
string|bool|null —getConfig()
Get a VuFind configuration.
public
getConfig([string $id = 'config' ]) : Config
Parameters
- $id : string = 'config'
-
Configuration identifier (default = main VuFind config)
Return values
Config —getDbService()
Get a database service object.
public
getDbService(class-string<\VuFind\Controller\T> $name) : T
Parameters
- $name : class-string<\VuFind\Controller\T>
-
Name of service to retrieve
Tags
Return values
T —getILS()
Get the ILS connection.
public
getILS() : Connection
Return values
Connection —getRecordCache()
Get the record cache
public
getRecordCache() : Cache
Return values
Cache —getRecordLoader()
Get the record loader
public
getRecordLoader() : Loader
Return values
Loader —getRecordRouter()
Get the record router.
public
getRecordRouter() : Router
Return values
Router —getRequest()
Get request object
public
getRequest() : Request
Return values
Request —getSearchMemory()
Get the search memory
public
getSearchMemory() : Memory
Return values
Memory —getServerUrl()
Get the full URL to one of VuFind's routes.
public
getServerUrl([bool|string $route = true ]) : string
Parameters
- $route : bool|string = true
-
Boolean true for current URL, otherwise name of route to render as URL
Return values
string —getService()
Retrieve a service
public
getService(class-string<\VuFind\Service\T> $name) : T
Parameters
- $name : class-string<\VuFind\Service\T>
-
Name of service to retrieve
Tags
Return values
T —getTable()
Get a database table object.
public
getTable(string $table) : Gateway
Parameters
- $table : string
-
Name of table to retrieve
Return values
Gateway —getTranslator()
Get translator object.
public
getTranslator() : TranslatorInterface
Return values
TranslatorInterface —getTranslatorLocale()
Get the locale from the translator.
public
getTranslatorLocale([string $default = 'en' ]) : string
Parameters
- $default : string = 'en'
-
Default to use if translator absent.
Return values
string —historicloansAction()
Send list of historic loans to view
public
historicloansAction() : mixed
Return values
mixed —holds()
public
holds() : Holds
Holds plugin
Return values
Holds —holdsAction()
Send list of holds to view
public
holdsAction() : mixed
Tags
Return values
mixed —homeAction()
Prepare and direct the home page where it needs to go
public
homeAction() : mixed
Return values
mixed —ILLRequests()
public
ILLRequests() : ILLRequests
ILLRequests plugin
Return values
ILLRequests —illRequestsAction()
Send list of ill requests to view
public
illRequestsAction() : mixed
Return values
mixed —ilsRecords()
public
ilsRecords() : IlsRecords
IlsRecords plugin
Return values
IlsRecords —loginAction()
Login Action
public
loginAction() : mixed
Return values
mixed —logoutAction()
Logout Action
public
logoutAction() : mixed
Return values
mixed —mylistAction()
Send user's saved favorites from a particular list to the view
public
mylistAction() : mixed
Return values
mixed —newItems()
public
newItems() : NewItems
NewItems plugin
Return values
NewItems —newPasswordAction()
Handling submission of a new password for a user.
public
newPasswordAction() : mixed
Return values
mixed —onDispatch()
Execute the request
public
onDispatch(MvcEvent $event) : mixed
Parameters
- $event : MvcEvent
-
Event
Tags
Return values
mixed —performDeleteFavorite()
Delete record
public
performDeleteFavorite(string $id, string $source) : mixed
Parameters
- $id : string
-
ID of record to delete
- $source : string
-
Source of record to delete
Return values
mixed —True on success; otherwise returns a value that can be returned by the controller to forward to another action (i.e. force login)
permission()
public
permission() : Permission
Permission plugin
Return values
Permission —profileAction()
Gather user profile data
public
profileAction() : mixed
Return values
mixed —recoverAction()
Send account recovery email
public
recoverAction() : mixed
Return values
mixed —redirectToSource()
Support method: redirect to the page we were on when the bulk action was initiated.
public
redirectToSource([string $flashNamespace = null ][, string $flashMsg = null ][, bool $redirectInLightbox = false ]) : mixed
Parameters
- $flashNamespace : string = null
-
Namespace for flash message (null for none)
- $flashMsg : string = null
-
Flash message to set (ignored if namespace null)
- $redirectInLightbox : bool = false
-
If the redirects are performed even if in lightbox
Return values
mixed —renewals()
public
renewals() : Renewals
Renewals plugin
Return values
Renewals —reserves()
public
reserves() : Reserves
Reserves plugin
Return values
Reserves —resultScroller()
public
resultScroller() : ResultScroller
ResultScroller plugin
Return values
ResultScroller —savesearchAction()
Handle 'save/unsave search' request
public
savesearchAction() : mixed
Return values
mixed —schedulesearchAction()
Handle search subscription request
public
schedulesearchAction() : mixed
Return values
mixed —setAccessPermission()
Getter for access permission.
public
setAccessPermission(string|false $ap) : void
Parameters
- $ap : string|false
-
Permission to require for access to the controller (false for no requirement)
Return values
void —setTranslator()
Set a translator
public
setTranslator(TranslatorInterface $translator) : TranslatorAwareInterface
Parameters
- $translator : TranslatorInterface
-
Translator
Return values
TranslatorAwareInterface —storageRetrievalRequests()
public
storageRetrievalRequests() : StorageRetrievalRequests
StorageRetrievalRequests plugin
Return values
StorageRetrievalRequests —storageRetrievalRequestsAction()
Send list of storage retrieval requests to view
public
storageRetrievalRequestsAction() : mixed
Return values
mixed —translate()
Translate a string (or string-castable object)
public
translate(string|object|array<string|int, mixed> $target[, array<string|int, mixed> $tokens = [] ][, string $default = null ][, bool $useIcuFormatter = false ][, array<string|int, string> $fallbackDomains = [] ]) : string
Parameters
- $target : string|object|array<string|int, mixed>
-
String to translate or an array of text domain and string to translate
- $tokens : array<string|int, mixed> = []
-
Tokens to inject into the translated string
- $default : string = null
-
Default value to use if no translation is found (null for no default).
- $useIcuFormatter : bool = false
-
Should we use an ICU message formatter instead of the default behavior?
- $fallbackDomains : array<string|int, string> = []
-
Text domains to check if no match is found in the domain specified in $target
Return values
string —translateWithPrefix()
Translate a string (or string-castable object) using a prefix, or without the prefix if a prefixed translation is not found.
public
translateWithPrefix(string $prefix, string|object|array<string|int, mixed> $target[, array<string|int, mixed> $tokens = [] ][, string $default = null ][, bool $useIcuFormatter = false ][, array<string|int, string> $fallbackDomains = [] ]) : string
Parameters
- $prefix : string
-
Translation key prefix
- $target : string|object|array<string|int, mixed>
-
String to translate or an array of text domain and string to translate
- $tokens : array<string|int, mixed> = []
-
Tokens to inject into the translated string
- $default : string = null
-
Default value to use if no translation is found (null for no default).
- $useIcuFormatter : bool = false
-
Should we use an ICU message formatter instead of the default behavior?
- $fallbackDomains : array<string|int, string> = []
-
Text domains to check if no match is found in the domain specified in $target
Return values
string —unsubscribeAction()
Unsubscribe a scheduled alert for a saved search.
public
unsubscribeAction() : mixed
Return values
mixed —userloginAction()
User login action -- clear any previous follow-up information prior to triggering a login process. This is used for explicit login links within the UI to differentiate them from contextual login links that are triggered by attempting to access protected actions.
public
userloginAction() : mixed
Return values
mixed —validateAccessPermission()
Use preDispatch event to block access when appropriate.
public
validateAccessPermission(MvcEvent $e) : void
Parameters
- $e : MvcEvent
-
Event object
Return values
void —verifyAction()
Receive a hash and display the new password form if it's valid
public
verifyAction() : mixed
Return values
mixed —verifyEmailAction()
Receive a hash and display the new password form if it's valid
public
verifyEmailAction() : mixed
Return values
mixed —addPendingEmailChangeMessage()
Add a message about any pending email change to the flash messenger
protected
addPendingEmailChangeMessage(UserEntityInterface $user) : void
Parameters
- $user : UserEntityInterface
-
User
Return values
void —attachDefaultListeners()
Register the default events for this controller
protected
attachDefaultListeners() : void
Return values
void —catalogLogin()
Does the user have catalog credentials available? Returns associative array of patron data if so, otherwise forwards to appropriate login prompt and returns false. If there is an ILS exception, a flash message is added and a newly created ViewModel is returned.
protected
catalogLogin() : bool|array<string|int, mixed>|ViewModel
Return values
bool|array<string|int, mixed>|ViewModel —clearFollowupUrl()
Sometimes we need to unset the followup to trigger default behaviors
protected
clearFollowupUrl() : void
Return values
void —commentsEnabled()
Are comments enabled?
protected
commentsEnabled() : bool
Return values
bool —confirmDeleteFavorite()
Confirm a request to delete a favorite item.
protected
confirmDeleteFavorite(string $id, string $source) : mixed
Parameters
- $id : string
-
ID of record to delete
- $source : string
-
Source of record to delete
Return values
mixed —createEmailViewModel()
Create a new ViewModel to use as an email form.
protected
createEmailViewModel([array<string|int, mixed> $params = null ][, string $defaultSubject = null ]) : ViewModel
Parameters
- $params : array<string|int, mixed> = null
-
Parameters to pass to ViewModel constructor.
- $defaultSubject : string = null
-
Default subject line to use.
Return values
ViewModel —createViewModel()
Create a new ViewModel.
protected
createViewModel([array<string|int, mixed> $params = null ]) : ViewModel
Parameters
- $params : array<string|int, mixed> = null
-
Parameters to pass to ViewModel constructor.
Return values
ViewModel —disableSessionWrites()
Prevent session writes -- this is designed to be called prior to time- consuming AJAX operations to help reduce the odds of a timing-related bug that causes the wrong version of session data to be written to disk (see VUFIND-716 for more details).
protected
disableSessionWrites() : void
Return values
void —extractTextDomain()
Given a translation string with or without a text domain, return an array with the raw string and the text domain separated.
protected
extractTextDomain(string|object|array<string|int, mixed> $target) : array<string|int, mixed>
Parameters
- $target : string|object|array<string|int, mixed>
-
String to translate or an array of text domain and string to translate
Return values
array<string|int, mixed> —formWasSubmitted()
Check to see if a form was submitted from its post value Also validate the Captcha, if it's activated
protected
formWasSubmitted([string|array<string|int, string>|null $submitElements = null ][, bool $useCaptcha = false ]) : bool
Parameters
- $submitElements : string|array<string|int, string>|null = null
-
Name of the post field(s) to check to indicate a form submission (or null for default)
- $useCaptcha : bool = false
-
Are we using captcha in this situation?
Return values
bool —getAndClearFollowupUrl()
Retrieve a referer to keep post-login redirect pointing to an appropriate location.
protected
getAndClearFollowupUrl([bool $checkRedirect = false ]) : string
Unset the followup before returning.
Parameters
- $checkRedirect : bool = false
-
Whether the query should be checked for param 'redirect'
Return values
string —getAuthManager()
Get the account manager object.
protected
getAuthManager() : Manager
Return values
Manager —getAuthorizationService()
Get the authorization service (note that we're doing this on-demand rather than through injection with the AuthorizationServiceAwareInterface to minimize expensive initialization when authorization is not needed.
protected
getAuthorizationService() : AuthorizationService
Return values
AuthorizationService —getDebugTranslation()
Build a debug-mode translation
protected
getDebugTranslation(string $domain, string $str, array<string|int, mixed> $tokens) : string
Parameters
- $domain : string
-
Text domain
- $str : string
-
String to translate
- $tokens : array<string|int, mixed>
-
Tokens to inject into the translated string
Return values
string —getFineSummary()
Get a status summary for an array of fines
protected
getFineSummary(iteratable<string|int, mixed> $fines, CurrencyFormatter $formatter) : array<string|int, mixed>
Parameters
- $fines : iteratable<string|int, mixed>
-
Fines
- $formatter : CurrencyFormatter
-
Currency formatter
Return values
array<string|int, mixed> —Associative array with keys total and display.
getHashAge()
Helper function for verification hashes
protected
getHashAge(string $hash) : int
Parameters
- $hash : string
-
User-unique hash string from request
Return values
int —age in seconds
getILSAuthenticator()
Get the ILS authenticator.
protected
getILSAuthenticator() : ILSAuthenticator
Return values
ILSAuthenticator —getILSLoginMethod()
What login method does the ILS use (password, email, vufind)
protected
getILSLoginMethod([string $target = '' ]) : string
Parameters
- $target : string = ''
-
Login target (MultiILS only)
Return values
string —getILSLoginSettings()
Get settings required for displaying the catalog login form
protected
getILSLoginSettings() : array<string|int, mixed>
Return values
array<string|int, mixed> —getPaginationHelper()
Get the ILS pagination helper
protected
getPaginationHelper() : PaginationHelper
Return values
PaginationHelper —getRecordTabManager()
Get the tab configuration for this controller.
protected
getRecordTabManager() : TabManager
Return values
TabManager —getRefreshResponse()
Construct an HTTP 205 (refresh) response. Useful for reporting success in the lightbox without actually rendering content.
protected
getRefreshResponse() : Response
Return values
Response —getRequestSummary()
Get a status summary for an array of requests
protected
getRequestSummary(iteratable<string|int, mixed> $requests) : array<string|int, mixed>
Parameters
- $requests : iteratable<string|int, mixed>
-
Requests
Return values
array<string|int, mixed> —Associative array with keys available, in_transit and other.
getSearchRowSecurely()
Get a search row, but throw an exception if it is not owned by the specified user or current active session.
protected
getSearchRowSecurely(int $searchId, int $userId) : SearchEntityInterface
Parameters
- $searchId : int
-
ID of search row
- $userId : int
-
ID of active user
Tags
Return values
SearchEntityInterface —getSelectedIds()
Get selected ids
protected
getSelectedIds() : array<string|int, mixed>
Return values
array<string|int, mixed> —getSessionInitiator()
Convenience method to get a session initiator URL. Returns false if not applicable.
protected
getSessionInitiator() : string|bool
Return values
string|bool —getTransactionSummary()
Get a status summary for an array of checkouts
protected
getTransactionSummary(iteratable<string|int, mixed> $transactions) : array<string|int, mixed>
Parameters
- $transactions : iteratable<string|int, mixed>
-
Checkouts
Return values
array<string|int, mixed> —Associative array with keys available, in_transit and other.
getUser()
Get the user object if logged in, false otherwise.
protected
getUser() : UserEntityInterface|null
Return values
UserEntityInterface|null —getUserVerificationContainer()
Return a session container for use in user email verification.
protected
getUserVerificationContainer() : Container
Return values
Container —getViewRenderer()
Get the view renderer
protected
getViewRenderer() : RendererInterface
Return values
RendererInterface —hasFollowupUrl()
Checks if a followup url is set
protected
hasFollowupUrl() : bool
Return values
bool —inLightbox()
Are we currently in a lightbox context?
protected
inLightbox() : bool
Return values
bool —isDuplicateOfSavedSearch()
Is the provided search row a duplicate of a search that is already saved?
protected
isDuplicateOfSavedSearch(SearchEntityInterface|null $rowToCheck, string $sessId, int $userId) : int|null
Parameters
- $rowToCheck : SearchEntityInterface|null
-
Search row to check (if any)
- $sessId : string
-
Current session ID
- $userId : int
-
Current user ID
Return values
int|null —isLocalUrl()
Is the provided URL local to this instance?
protected
isLocalUrl(string $url) : bool
Parameters
- $url : string
-
URL to check
Return values
bool —listsEnabled()
Are lists enabled?
protected
listsEnabled() : bool
Return values
bool —listTagsEnabled()
Are list tags enabled?
protected
listTagsEnabled() : bool
Return values
bool —normalizeUrlForComparison()
Normalize the referer URL so that inconsistencies in protocol and trailing slashes do not break comparisons.
protected
normalizeUrlForComparison(string $url) : string
Parameters
- $url : string
-
URL to normalize
Return values
string —processAuthenticationException()
Process an authentication error.
protected
processAuthenticationException(Auth $e) : void
Parameters
- $e : Auth
-
Exception to process.
Return values
void —processEditList()
Process the "edit list" submission.
protected
processEditList(UserEntityInterface $user, UserListEntityInterface $list) : object|bool
Parameters
- $user : UserEntityInterface
-
Logged in user
- $list : UserListEntityInterface
-
List being created/edited
Return values
object|bool —Response object if redirect is needed, false if form needs to be redisplayed.
processEditSubmit()
Process the submission of the edit favorite form.
protected
processEditSubmit(UserEntityInterface $user, AbstractBase $driver, int $listID) : object
Parameters
- $user : UserEntityInterface
-
Logged-in user
- $driver : AbstractBase
-
Record driver for favorite
- $listID : int
-
List being edited (null if editing all favorites)
Return values
object —resetNewPasswordForm()
Reset the new password form and return the modified view. When a user has already been loaded from an existing hash, this resets the hash and updates the form so that the user can try again.
protected
resetNewPasswordForm(UserEntityInterface|null $userFromHash, ViewModel $view) : ViewModel
Parameters
- $userFromHash : UserEntityInterface|null
-
User loaded from database, or null if none.
- $view : ViewModel
-
View object
Return values
ViewModel —sanitizeTranslationKey()
Make sure there are not any illegal characters in the translation key that might prevent successful lookup in language files.
protected
sanitizeTranslationKey(string $key) : string
Parameters
- $key : string
-
Key to sanitize
Return values
string —Sanitized key
scheduleSearch()
Support method for savesearchAction() -- schedule a search.
protected
scheduleSearch(UserEntityInterface $user, int $schedule, int $sid) : mixed
Parameters
- $user : UserEntityInterface
-
Logged-in user object
- $schedule : int
-
Requested schedule setting
- $sid : int
-
Search ID to schedule
Return values
mixed —sendChangeNotificationEmail()
When a request to change a user's email address has been received, we should send a notification to the old email address for the user's information.
protected
sendChangeNotificationEmail(UserEntityInterface $user, string $newEmail) : void
Parameters
- $user : UserEntityInterface
-
User whose email address is being changed
- $newEmail : string
-
New email address
Return values
void —(sends email or adds error message)
sendFirstVerificationEmail()
Send a verify email message for the first time (only if the user does not already have a hash).
protected
sendFirstVerificationEmail(UserEntityInterface $user) : void
Parameters
- $user : UserEntityInterface
-
User object we're recovering
Return values
void —(sends email or adds error message)
sendRecoveryEmail()
Helper function for recoverAction
protected
sendRecoveryEmail(UserEntityInterface $user, Config $config) : void
Parameters
- $user : UserEntityInterface
-
User object we're recovering
- $config : Config
-
Configuration object
Return values
void —(sends email or adds error message)
sendVerificationEmail()
Send a verify email message.
protected
sendVerificationEmail(UserEntityInterface|null $user[, bool $change = false ]) : void
Parameters
- $user : UserEntityInterface|null
-
User object we're recovering
- $change : bool = false
-
Is the user changing their email (true) or setting up a new account (false).
Return values
void —(sends email or adds error message)
setFollowupUrlToReferer()
Store a referer (if appropriate) to keep post-login redirect pointing to an appropriate location. This is used when the user clicks the log in link from an arbitrary page or when a password is mistyped; separate logic is used for storing followup information when VuFind forces the user to log in from another context.
protected
setFollowupUrlToReferer([bool $allowCurrentUrl = true ][, array<string|int, mixed> $extras = [] ]) : void
Parameters
- $allowCurrentUrl : bool = true
-
Whether the current URL is valid for followup
- $extras : array<string|int, mixed> = []
-
Extra data for the followup
Return values
void —setSavedFlagSecurely()
Support method for savesearchAction(): set the saved flag in a secure fashion, throwing an exception if somebody attempts something invalid.
protected
setSavedFlagSecurely(int $searchId, bool $saved, int $userId) : void
Parameters
- $searchId : int
-
The search ID to save/unsave
- $saved : bool
-
The new desired state of the saved flag
- $userId : int
-
The user ID requesting the change
Tags
Return values
void —setUpAuthenticationFromRequest()
Configure the authentication manager to use a user-specified method.
protected
setUpAuthenticationFromRequest() : void
Return values
void —storeRefererForPostLoginRedirect()
Maintaining this method for backwards compatibility; logic moved to parent and method re-named
protected
storeRefererForPostLoginRedirect() : void
Return values
void —tagsEnabled()
Are tags enabled?
protected
tagsEnabled() : bool
Return values
bool —translateString()
Get translation for a string
protected
translateString(string $rawStr[, array<string|int, mixed> $tokens = [] ][, string $default = null ][, string $domain = 'default' ][, bool $useIcuFormatter = false ]) : string
Parameters
- $rawStr : string
-
String to translate
- $tokens : array<string|int, mixed> = []
-
Tokens to inject into the translated string
- $default : string = null
-
Default value to use if no translation is found (null for no default).
- $domain : string = 'default'
-
Text domain (omit for default)
- $useIcuFormatter : bool = false
-
Should we use an ICU message formatter instead of the default behavior?