PHP Class AuthPlugin, ojs

Inheritance: extends YagePlugin
显示文件 Open project: pkp/ojs Class Usage Examples

Public Properties

Property Type Description
$authId auth source ID for this plugin instance
$settings settings for this plugin instance

Public Methods

Method Description
__construct ( $settings = [], $authId = null ) Constructor.
authenticate ( $username, $password ) : boolean Authenticate a username and password.
createUser ( $user ) : boolean Create a user on the remote source.
deleteUser ( $username ) : boolean Delete a user from the remote source.
doCreateUser ( $user ) : boolean Create remote user account, if enabled.
doGetUserInfo ( $user ) : boolean Update local user profile from the remote source, if enabled.
doSetUserInfo ( $user ) : boolean Update remote user profile, if enabled.
doSetUserPassword ( $username, $password ) : boolean Update remote user password, if enabled.
getInstance ( $settings, $authId ) : AuthPlugin Returns an instance of the authentication plugin
getSettingsTemplate ( ) : string Return the path to a template for plugin settings.
getUserInfo ( $user ) : boolean Retrieve user profile information from the remote source.
isSitePlugin ( ) Return true iff this is a site-wide plugin.
setUserInfo ( $user ) : boolean Store user profile information on the remote source.
setUserPassword ( $username, $password ) : boolean Change a user's password on the remote source.
userExists ( $username ) : boolean Check if a username exists.

Method Details

__construct() public method

Constructor.
public __construct ( $settings = [], $authId = null )
$settings array
$authId int ID for this instance

authenticate() abstract public method

Authenticate a username and password.
abstract public authenticate ( $username, $password ) : boolean
$username string
$password string
return boolean true if authentication is successful

createUser() public method

Create a user on the remote source.
public createUser ( $user ) : boolean
$user User to create
return boolean true if successful

deleteUser() public method

This function is currently not used within OJS, but is reserved for future use.
public deleteUser ( $username ) : boolean
$username string user to delete
return boolean true if successful

doCreateUser() public method

Create remote user account, if enabled.
public doCreateUser ( $user ) : boolean
$user User to create
return boolean true if successful

doGetUserInfo() public method

Update local user profile from the remote source, if enabled.
public doGetUserInfo ( $user ) : boolean
$user User
return boolean true if successful

doSetUserInfo() public method

Update remote user profile, if enabled.
public doSetUserInfo ( $user ) : boolean
$user User
return boolean true if successful

doSetUserPassword() public method

Update remote user password, if enabled.
public doSetUserPassword ( $username, $password ) : boolean
$username string
$password string
return boolean true if successful

getInstance() abstract public method

Returns an instance of the authentication plugin
abstract public getInstance ( $settings, $authId ) : AuthPlugin
$settings array settings specific to this instance
$authId int identifier for this instance
return AuthPlugin

getSettingsTemplate() public method

Can return null if there are no plugin-specific settings.
public getSettingsTemplate ( ) : string
return string

getUserInfo() public method

Any unsupported fields (e.g., OJS-specific ones) should not be modified.
public getUserInfo ( $user ) : boolean
$user User to update
return boolean true if successful

isSitePlugin() public method

Return true iff this is a site-wide plugin.
public isSitePlugin ( )

setUserInfo() public method

Store user profile information on the remote source.
public setUserInfo ( $user ) : boolean
$user User to store
return boolean true if successful

setUserPassword() public method

Change a user's password on the remote source.
public setUserPassword ( $username, $password ) : boolean
$username string user to update
$password string the new password
return boolean true if successful

userExists() public method

Check if a username exists.
public userExists ( $username ) : boolean
$username string
return boolean

Property Details

$authId public_oe property

auth source ID for this plugin instance
public $authId

$settings public_oe property

settings for this plugin instance
public $settings