Stud.IP
2.0 Revision 48548
|
Public Member Functions | |
StudipAuthAbstract () | |
authenticateUser ($username, $password, $jscript=false) | |
getStudipUserid ($username) | |
doNewUserInit ($uid) | |
setUserDomains ($uid) | |
getUserDomains () | |
doDataMapping ($uid) | |
isMappedField ($name) | |
verifyUsername ($username) | |
isUsedUsername ($username) | |
isAuthenticated ($username, $password, $jscript) |
Static Public Member Functions | |
GetInstance ($plugin_name=false) | |
CheckAuthentication ($username, $password, $jscript=false) | |
CheckUsername ($username) | |
CheckField ($field_name, $plugin_name) |
Data Fields | |
$error_msg | |
$is_new_user = false | |
$user_domains | |
$user_data_mapping = null | |
$dbv | |
$plugin_name | |
$error_head |
authenticateUser | ( | $username, | |
$password, | |||
$jscript = false |
|||
) |
authentication method
this method authenticates the passed username, it is used by StudipAuthAbstract::CheckAuthentication() if authentication succeeds it calls StudipAuthAbstract::doDataMapping() to map data fields if the authenticated user logs in for the first time it calls StudipAuthAbstract::doNewUserInit() to initialize the new user private
string | the username to check |
string | the password to check |
bool | indicates if javascript was enabled/disabled during the login process |
Reimplemented in StudipAuthCAS.
|
static |
static method to check authentication in all plugins
if authentication fails in one plugin, the error message is stored and the next plugin is used if authentication succeeds, the uid element in the returned array will contain the Stud.IP user id
public
string | the username to check |
string | the password to check |
bool | indicates if javascript was enabled/disabled during the login process |
|
static |
static method to check for a mapped field
this method checks in the plugin with the passed name, if the passed Stud.IP DB field is mapped to an external data source
public
string | the name of the db field must be in form ' |
string | the name of the plugin to check |
|
static |
static method to check if passed username is used in external data sources
all plugins are checked, the error messages are stored and returned
public
string | the username |
doDataMapping | ( | $uid | ) |
this method handles the data mapping
for each entry in $this->user_data_mapping the according callback will be invoked the return value of the callback method is then written to the db field, which is specified in the key of the array
private
string | the user_id |
Reimplemented in StudipAuthLdapHSW.
doNewUserInit | ( | $uid | ) |
initialize a new user
this method is invoked for one time, if a new user logs in ($this->is_new_user is true) place special treatment of new users here private
string | the user id |
|
static |
static method to instantiate and retrieve a reference to an object (singleton)
use always this method to instantiate a plugin object, it will ensure that only one object of each plugin will exist public
string | name of plugin, if omitted an array with all plugin objects will be returned |
getStudipUserid | ( | $username | ) |
getUserDomains | ( | ) |
Get the user domains to assign to the current user.
Reimplemented in StudipAuthShib.
isAuthenticated | ( | $username, | |
$password, | |||
$jscript | |||
) |
method to check the authentication of a given username and a given password
abstract, MUST be realized
private
string | the username |
string | the password |
bool | is javascript used to hash password ? |
Reimplemented in StudipAuthLdap, StudipAuthLdapReader, StudipAuthStandardExtern, StudipAuthStandard, StudipAuthCAS, and StudipAuthSSO.
isMappedField | ( | $name | ) |
method to check, if a given db field is mapped by the plugin
private
string | the name of the db field (<table_name>.<field_name>) |
Reimplemented in StudipAuthLdapHSW.
isUsedUsername | ( | $username | ) |
method to check, if username is used
abstract MUST be realized
private
string | the username |
Reimplemented in StudipAuthLdap, StudipAuthLdapReader, StudipAuthLdapReadAndBind, StudipAuthStandard, and StudipAuthSSO.
setUserDomains | ( | $uid | ) |
This method sets the user domains for the current user.
private
string | the user id |
Constructor
the constructor is private, you should use StudipAuthAbstract::GetInstance($plugin_name) to get a reference to a plugin object. Make sure the constructor in the base class is called when deriving your own plugin class, it assigns the settings from local.inc as members of the plugin each key of the $STUDIP_AUTH_CONFIG_<plugin name> array will become a member of the object
private
verifyUsername | ( | $username | ) |
method to eliminate bad characters in the given username
private
string | the username |
Reimplemented in StudipAuthShib.
$dbv |
$error_head |
$error_msg |
$is_new_user = false |
$plugin_name |
array $user_data_mapping = null |
associative array with mapping for database fields
associative array with mapping for database fields, should be set in local.inc structure : array("<table name>.<field name>" => array( "callback" => "<name of callback method used for data retrieval>", "map_args" => "<arguments passed to callback method>")) public
array $user_domains |
array of user domains to assign to each user, can be set in local.inc
public