Public Member Functions

Validation Class Reference

Class providing user validation/authentication operations. More...

List of all members.

Public Member Functions

 canAdminister ($conferenceId, $userId)
 checkCredentials ($username, $password)
 encryptCredentials ($username, $password, $encryption=false)
 generatePassword ($length=8)
 generatePasswordResetHash ($userId)
 isAuthor ($conferenceId=-1, $schedConfId=-1)
 isAuthorized ($roleId, $conferenceId=0, $schedConfId=0)
 isConferenceManager ($conferenceId=-1)
 isDirector ($conferenceId=-1, $schedConfId=-1)
 isLoggedIn ()
 isReader ($conferenceId=-1, $schedConfId=-1)
 isReviewer ($conferenceId=-1, $schedConfId=-1)
 isSiteAdmin ()
 isTrackDirector ($conferenceId=-1, $schedConfId=-1)
login ($username, $password, &$reason, $remember=false)
 logout ()
 redirectLogin ($message=null, $args=array())
 suggestUsername ($firstName, $lastName)

Detailed Description

Class providing user validation/authentication operations.

Definition at line 19 of file Validation.inc.php.


Member Function Documentation

Validation.canAdminister ( conferenceId,
userId 
)

Check whether a user is allowed to administer another user.

Parameters:
$conferenceId int
$userId int
Returns:
boolean

Definition at line 348 of file Validation.inc.php.

References isConferenceManager(), and isSiteAdmin().

Referenced by PeopleHandler.disableUser(), PeopleHandler.editUser(), PeopleHandler.mergeUsers(), LoginHandler.signInAsUser(), and PeopleHandler.updateUser().

Validation.checkCredentials ( username,
password 
)

Check if a user's credentials are valid.

Parameters:
$username string username
$password string unencrypted password
Returns:
boolean

Definition at line 145 of file Validation.inc.php.

References encryptCredentials().

Validation.encryptCredentials ( username,
password,
encryption = false 
)

Encrypt user passwords for database storage. The username is used as a unique salt to make dictionary attacks against a compromised database more difficult.

Parameters:
$username string username
$password string unencrypted password
$encryption string optional encryption algorithm to use, defaulting to the value from the site configuration
Returns:
string encrypted password

Definition at line 206 of file Validation.inc.php.

Referenced by checkCredentials(), Install.createData(), LoginChangePasswordForm.execute(), CreateAccountForm.execute(), ChangePasswordForm.execute(), CreateReviewerForm.execute(), UserRegistrationForm.execute(), UserManagementForm.execute(), UserXMLParser.generatePassword(), ImportOCS1.importPapers(), ImportOCS1.importRegistrations(), ImportOCS1.importReviewers(), UserXMLParser.importUsers(), and login().

Validation.generatePassword ( length = 8  ) 

Generate a random password. Assumes the random number generator has already been seeded.

Parameters:
$length int the length of the password to generate (default 8)
Returns:
string

Definition at line 230 of file Validation.inc.php.

Referenced by LoginChangePasswordForm.execute(), ChangePasswordForm.execute(), CreateReviewerForm.execute(), UserManagementForm.execute(), ImportOCS1.importPapers(), ImportOCS1.importRegistrations(), and ImportOCS1.importReviewers().

Validation.generatePasswordResetHash ( userId  ) 

Generate a hash value to use for confirmation to reset a password.

Parameters:
$userId int
Returns:
string (boolean false if user is invalid)

Definition at line 246 of file Validation.inc.php.

Referenced by TrackDirectorAction.notifyReviewer(), and TrackDirectorAction.remindReviewer().

Validation.isAuthor ( conferenceId = -1,
schedConfId = -1 
)

Shortcut for checking authorization as author.

Parameters:
$conferenceId int
Returns:
boolean

Definition at line 329 of file Validation.inc.php.

References isAuthorized().

Referenced by ProfileForm.execute(), UserHandler.getRoleDataForConference(), ProfileForm.initData(), and SubmitHandler.submit().

Validation.isAuthorized ( roleId,
conferenceId = 0,
schedConfId = 0 
)

Check if a user is authorized to access the specified role in the specified conference.

Parameters:
$roleId int
$conferenceId optional (e.g., for global site admin role), the ID of the conference
Returns:
boolean

Definition at line 172 of file Validation.inc.php.

References Request.getConference(), Request.getSchedConf(), and isLoggedIn().

Referenced by isAuthor(), isConferenceManager(), isDirector(), isReader(), isReviewer(), isSiteAdmin(), and isTrackDirector().

Validation.isConferenceManager ( conferenceId = -1  ) 
Validation.isDirector ( conferenceId = -1,
schedConfId = -1 
)
Validation.isLoggedIn (  ) 

Check if the user must change their password in order to log in.

Returns:
boolean

Definition at line 272 of file Validation.inc.php.

Referenced by isAuthorized(), SchedConfHandler.register(), UserHandler.validate(), PaperHandler.validate(), CommentHandler.validate(), ReviewerHandler.validateAccessKey(), PaperHandler.viewPaper(), and PaperHandler.viewRST().

Validation.isReader ( conferenceId = -1,
schedConfId = -1 
)

Shortcut for checking authorization as reader.

Parameters:
$conferenceId int
Returns:
boolean

Definition at line 338 of file Validation.inc.php.

References isAuthorized().

Referenced by ProfileForm.execute(), ProfileForm.initData(), and SchedConfAction.mayViewPapers().

Validation.isReviewer ( conferenceId = -1,
schedConfId = -1 
)

Shortcut for checking authorization as reviewer.

Parameters:
$conferenceId int
Returns:
boolean

Definition at line 320 of file Validation.inc.php.

References isAuthorized().

Referenced by NotificationSettingsForm.display(), ProfileForm.execute(), UserHandler.getRoleDataForConference(), and ProfileForm.initData().

Validation.isSiteAdmin (  ) 
Validation.isTrackDirector ( conferenceId = -1,
schedConfId = -1 
)

Shortcut for checking authorization as track director.

Parameters:
$conferenceId int
Returns:
boolean

Definition at line 311 of file Validation.inc.php.

References isAuthorized().

Referenced by EmailHandler.email(), UserHandler.getRoleDataForConference(), AuthorHandler.index(), SchedConfAction.mayViewPapers(), SchedConfAction.mayViewProceedings(), SchedConfAction.mayViewSchedConf(), TrackDirectorHandler.validate(), and SubmitHandler.validate().

& Validation.login ( username,
password,
&$  reason,
remember = false 
)

Authenticate user credentials and mark the user as logged in in the current session.

Parameters:
$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
Returns:
User the User associated with the login credentials, or false if the credentials are invalid

Definition at line 29 of file Validation.inc.php.

References encryptCredentials().

Referenced by CreateAccountHandler.createAccount(), and UserRegistrationForm.execute().

Validation.logout (  ) 

Mark the user as logged out in the current session.

Returns:
boolean

Definition at line 106 of file Validation.inc.php.

Referenced by ReviewerHandler.validateAccessKey().

Validation.redirectLogin ( message = null,
args = array() 
)

Redirect to the login page, appending the current URL as the source.

Definition at line 127 of file Validation.inc.php.

References Request.redirect().

Referenced by RTAdminHandler.index(), UserHandler.validate(), TrackDirectorHandler.validate(), PaperHandler.validate(), and CommentHandler.validate().

Validation.suggestUsername ( firstName,
lastName 
)

Suggest a username given the first and last names.

Returns:
string

Definition at line 259 of file Validation.inc.php.


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