Open Journal Systems
3.3.0
|
Static Public Member Functions | |
static | canAdminister ($administeredUserId, $administratorUserId) |
static | checkCredentials ($username, $password) |
static | encryptCredentials ($username, $password, $encryption=false, $legacy=false) |
static | generatePassword ($length=null) |
static | generatePasswordResetHash ($userId, $expiry=null) |
static | isAuthorized ($roleId, $contextId=0) |
static | isLoggedIn () |
static | isLoggedIn () |
static | isLoggedInAs () |
static | isSiteAdmin () |
static | login ($username, $password, &$reason, $remember=false) |
static | logout () |
static | redirectLogin ($message=null) |
static | registerUserSession ($user, &$reason, $remember=false) |
static | setIsLoggedIn ($isLoggedIn) |
static | suggestUsername ($givenName, $familyName=null) |
static | verifyPassword ($username, $password, $hash, &$rehash) |
static | verifyPasswordResetHash ($userId, $hash) |
Static Public Attributes | |
static | $_isLoggedIn = false |
Class providing user validation/authentication operations.
Mock implementation of the Validation class for the PKPPageRouterTest.
Definition at line 16 of file Validation.inc.php.
|
static |
Check whether a user is allowed to administer another user.
$administeredUserId | int User ID of user to potentially administer |
$administratorUserId | int User ID of user who wants to do the administrating |
Definition at line 410 of file Validation.inc.php.
References DAORegistry\getDAO().
Referenced by UserGridHandler\disableUser(), UserGridHandler\editDisableUser(), UserGridHandler\editUser(), UserGridRow\initialize(), ReviewerGridRow\initialize(), StageParticipantGridRow\initialize(), UserGridHandler\mergeUsers(), UserGridHandler\removeUser(), LoginHandler\signInAsUser(), UserGridHandler\updateUser(), and UserGridHandler\updateUserRoles().
|
static |
Check if a user's credentials are valid.
$username | string username |
$password | string unencrypted password |
Definition at line 188 of file Validation.inc.php.
References DAORegistry\getDAO(), and verifyPassword().
Referenced by LoginChangePasswordForm\__construct(), and ChangePasswordForm\__construct().
|
static |
Encrypt user passwords for database storage. The username is used as a unique salt to make dictionary attacks against a compromised database more difficult.
$username | string username (kept for backwards compatibility) |
$password | string unencrypted password |
$encryption | string optional encryption algorithm to use, defaulting to the value from the site configuration |
$legacy | boolean if true, use legacy hashing technique for backwards compatibility |
Definition at line 255 of file Validation.inc.php.
References Config\getVar().
Referenced by PKPInstall\createData(), LoginChangePasswordForm\execute(), CreateReviewerForm\execute(), ChangePasswordForm\execute(), RegistrationForm\execute(), UserDetailsForm\execute(), UserXmlPKPUserFilter\importUserPasswordValidation(), LoginHandler\resetPassword(), and verifyPassword().
|
static |
Generate a random password. Assumes the random number generator has already been seeded.
$length | int the length of the password to generate (default is site minimum) |
Definition at line 283 of file Validation.inc.php.
References DAORegistry\getDAO().
Referenced by AccessKeyManager\createKey(), LoginChangePasswordForm\execute(), CreateReviewerForm\execute(), ChangePasswordForm\execute(), UserDetailsForm\execute(), UserXmlPKPUserFilter\importUserPasswordValidation(), and LoginHandler\resetPassword().
|
static |
Generate a hash value to use for confirmation to reset a password.
$userId | int |
$expiry | int timestamp when hash expires, defaults to CURRENT_TIME + RESET_SECONDS |
Definition at line 305 of file Validation.inc.php.
References DAORegistry\getDAO(), and Config\getVar().
Referenced by ReviewReminderForm\execute(), ThankReviewerForm\initData(), ReviewReminderForm\initData(), LoginHandler\requestResetPassword(), and ReviewReminder\sendReminder().
|
static |
Check if a user is authorized to access the specified role in the specified context.
$roleId | int |
$contextId | optional (e.g., for global site admin role), the ID of the context |
Definition at line 225 of file Validation.inc.php.
References PKPApplication\get(), DAORegistry\getDAO(), and SessionManager\getManager().
Referenced by isSiteAdmin().
|
static |
Definition at line 20 of file MockValidation.inc.php.
References $_isLoggedIn.
|
static |
Check if the user must change their password in order to log in.
Definition at line 376 of file Validation.inc.php.
References SessionManager\getManager().
Referenced by PKPUserHandler\authorizationDenied(), RestrictedSiteAccessPolicy\effect(), PKP\Services\PKPNavigationMenuService\getDisplayStatus(), APP\Services\NavigationMenuService\getDisplayStatusCallback(), LoginHandler\index(), PKPTemplateManager\initialize(), PKPPageRouter\isCacheable(), PaymentHandler\pay(), RegistrationHandler\register(), LoginHandler\signIn(), LoginHandler\signOut(), IssueHandler\userCanViewGalley(), and ArticleHandler\userCanViewGalley().
|
static |
Check if the user is logged in as a different user.
Definition at line 388 of file Validation.inc.php.
References SessionManager\getManager().
Referenced by PKP\Services\PKPNavigationMenuService\getDisplayStatus(), APP\Services\NavigationMenuService\getDisplayStatusCallback(), UserGridRow\initialize(), ReviewerGridRow\initialize(), StageParticipantGridRow\initialize(), StageParticipantGridHandler\initialize(), PKPTemplateManager\initialize(), and SubmissionLog\logEvent().
|
static |
Shortcut for checking authorization as site admin.
Definition at line 400 of file Validation.inc.php.
References isAuthorized().
Referenced by CounterReportPlugin\display(), IndexHandler\index(), LanguageGridRow\initialize(), and PluginGalleryGridHandler\viewPlugin().
|
static |
Authenticate user credentials and mark the user as logged in in the current session.
$username | string |
$password | string unencrypted password |
$reason | string reference to string to receive the reason an account was disabled; null otherwise |
$remember | boolean remember a user's session past the current browser session |
Definition at line 26 of file Validation.inc.php.
References DAORegistry\getDAO(), registerUserSession(), and verifyPassword().
Referenced by RegistrationHandler\register(), LoginHandler\savePassword(), and LoginHandler\signIn().
|
static |
Mark the user as logged out in the current session.
Definition at line 146 of file Validation.inc.php.
References DAORegistry\getDAO(), and SessionManager\getManager().
Referenced by LoginHandler\signIn(), and LoginHandler\signOut().
|
static |
Redirect to the login page, appending the current URL as the source.
$message | string Optional name of locale key to add to login page |
Definition at line 168 of file Validation.inc.php.
References PKPApplication\get().
Referenced by PKPUserHandler\authorizationDenied(), CounterReportPlugin\display(), PKPPageRouter\handleAuthorizationFailure(), PaymentHandler\pay(), IssueHandler\userCanViewGalley(), ArticleHandler\userCanViewGalley(), and PKPHandler\validate().
|
static |
Mark the user as logged in in the current session.
$user | User user to register in the session |
$reason | string reference to string to receive the reason an account was disabled; null otherwise |
$remember | boolean remember a user's session past the current browser session |
Definition at line 107 of file Validation.inc.php.
References Core\getCurrentDate(), DAORegistry\getDAO(), SessionManager\getManager(), and Config\getVar().
Referenced by ReviewerHandler\_validateAccessKey(), and login().
|
static |
Definition at line 24 of file MockValidation.inc.php.
References $_isLoggedIn.
Referenced by PKPPageRouterTest\testIsCacheableWithPathinfoSuccess().
|
static |
Suggest a username given the first and last names.
$givenName | string |
$familyName | string |
Definition at line 359 of file Validation.inc.php.
References DAORegistry\getDAO(), PKPString\regexp_replace(), and PKPString\substr().
Referenced by UserApiHandler\suggestUsername().
|
static |
Verify if the input password is correct
string | $username | the string username |
string | $password | the plaintext password |
string | $hash | the password hash from the database |
string | &$rehash | if password needs rehash, this variable is used |
Definition at line 84 of file Validation.inc.php.
References encryptCredentials().
Referenced by checkCredentials(), and login().
|
static |
Check if provided password reset hash is valid.
$userId | int |
$hash | string |
Definition at line 341 of file Validation.inc.php.
Referenced by LoginHandler\resetPassword().
|
static |
Definition at line 18 of file MockValidation.inc.php.
Referenced by isLoggedIn(), and setIsLoggedIn().